[llvm] r210808 - Add missing "InitializerConstant" to global variable syntax in LangRef.

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Jun 12 13:03:20 PDT 2014


> On 2014-Jun-12, at 11:42, Bob Wilson <bob.wilson at apple.com> wrote:
> 
> Author: bwilson
> Date: Thu Jun 12 13:42:55 2014
> New Revision: 210808
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=210808&view=rev
> Log:
> Add missing "InitializerConstant" to global variable syntax in LangRef.
> 
> The syntax for Global Variables in LangRef is missing the initializer.
> This syntax section was added in r199218 along with changes to the
> dllexport/dllimport handling, and I guess it was just an oversight to omit the
> initializer values. I’ve marked the initializer as optional because this syntax
> is used for both declarations and definitions.
> 
> Modified:
>    llvm/trunk/docs/LangRef.rst
> 
> Modified: llvm/trunk/docs/LangRef.rst
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=210808&r1=210807&r2=210808&view=diff
> ==============================================================================
> --- llvm/trunk/docs/LangRef.rst (original)
> +++ llvm/trunk/docs/LangRef.rst Thu Jun 12 13:42:55 2014
> @@ -589,8 +589,8 @@ Syntax::
> 
>     [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
>                          [unnamed_addr] [AddrSpace] [ExternallyInitialized]
> -                         <global | constant> <Type>
> -                         [, section "name"] [, align <Alignment>]
> +                         <global | constant> <Type> [<InitializerConstant>
> +                         [, section "name"] [, align <Alignment>]]

Was it intentional to require an InitializerConstant any time there's a
section name and/or an Alignment?  In particular, it seems unlikely that
a declaration (without a value) can't specify the alignment.

> 
> For example, the following defines a global in a numbered address space
> with an initializer, section, and alignment:
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list