[PATCH] LangRef syntax for Global Variables is missing the initializer

Bob Wilson bob.wilson at apple.com
Thu Jun 12 11:52:59 PDT 2014


Using just plain <Constant> does not make it clear what the constant is for. I looked around other descriptions of syntax and found things like “returntype” being used instead of just plain “type”, so I’ll follow that precedent and call this <InitializerConstant>.

Committed in r210808.

On Jun 11, 2014, at 6:05 PM, Reid Kleckner <rnk at google.com> wrote:

> lgtm
> 
> I'd call it <Constant> instead of <Initializer>.  We don't have grammar rules for either, but if we did, we'd probably call it <Constant>.
> 
> 
> On Wed, Jun 11, 2014 at 5:30 PM, Bob Wilson <bob.wilson at apple.com> wrote:
> 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 think this patch fixes it. I’ve marked the initializer as optional because this syntax is used for both declarations and definitions.
> 
> Comments?
> 
> diff --git docs/LangRef.rst docs/LangRef.rst
> index 213b99a..01acb4a 100644
> --- docs/LangRef.rst
> +++ docs/LangRef.rst
> @@ -589,8 +589,8 @@ Syntax::
> 
>      [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
>                           [unnamed_addr] [AddrSpace] [ExternallyInitialized]
> -                         <global | constant> <Type>
> -                         [, section "name"] [, align <Alignment>]
> +                         <global | constant> <Type> [<Initializer>
> +                         [, section "name"] [, align <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
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140612/09fe2bce/attachment.html>


More information about the llvm-commits mailing list