This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ARM] TLS Descriptor support


On Tue, 10 May 2011, Nathan Sidwell wrote:

> +@item -mtls-dialect=@var{dialect}
> +@opindex mtls-dialect
> +Specify the dialect to use for accessing thread local storage.  Two
> +dialects are supported - @option{arm} and @option{gnu}.  The

Use "---" (em dash, unspaced) instead of " - ".

> +@option{arm} dialect selects the ARM EABI scheme for supporting local
> +and global dynamic tls models.  The @option{gnu} dialect selects the

"TLS" not "tls".

> +Specify the default tls dialect, for systems were there is a choice.

Likewise.

> +	with_tls=${with_tls:arm}

Do you mean ${with_tls:-arm}?

> @@ -1755,6 +1759,17 @@ arm_option_override (void)
>  	error ("invalid thread pointer option: -mtp=%s", target_thread_switch);
>      }
>  
> +  if (target_tls_dialect_switch)
> +    {
> +      if (strcmp (target_tls_dialect_switch, "arm") == 0)
> +	target_tls_dialect = TLS_ARM;
> +      else if (strcmp (target_tls_dialect_switch, "gnu") == 0)
> +	target_tls_dialect = TLS_GNU;
> +      else
> +	error ("invalid thread dialect option: -mtls-dialect=%s",
> +	       target_tls_dialect_switch);
> +    }

Rather than checking for strings manually like this, it's now better to 
use the .opt Enum facility for options such as this with a fixed 
enumerated set of values, so target_tls_dialect can be set directly from 
the .opt file using Var and Enum.  (If you want a custom error message, 
you can use UnknownError on the enumeration record to specify it.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]