<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">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>.<div><br></div><div>Committed in r210808.</div><div><br><div><div>On Jun 11, 2014, at 6:05 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">lgtm<div><br></div><div>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>.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jun 11, 2014 at 5:30 PM, Bob Wilson <span dir="ltr"><<a href="mailto:bob.wilson@apple.com" target="_blank">bob.wilson@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>

<br>
Comments?<br>
<br>
diff --git docs/LangRef.rst docs/LangRef.rst<br>
index 213b99a..01acb4a 100644<br>
--- docs/LangRef.rst<br>
+++ docs/LangRef.rst<br>
@@ -589,8 +589,8 @@ Syntax::<br>
<br>
     [@<GlobalVarName> =] [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]<br>
                          [unnamed_addr] [AddrSpace] [ExternallyInitialized]<br>
-                         <global | constant> <Type><br>
-                         [, section "name"] [, align <Alignment>]<br>
+                         <global | constant> <Type> [<Initializer><br>
+                         [, section "name"] [, align <Alignment>]]<br>
<br>
 For example, the following defines a global in a numbered address space<br>
 with an initializer, section, and alignment:<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</blockquote></div><br></div></body></html>