[llvm] r174269 - Added clarification paragraph to LangRef's documentation of

Michael Gottesman mgottesman at apple.com
Sun Feb 3 01:57:15 PST 2013


Author: mgottesman
Date: Sun Feb  3 03:57:15 2013
New Revision: 174269

URL: http://llvm.org/viewvc/llvm-project?rev=174269&view=rev
Log:
Added clarification paragraph to LangRef's documentation of
GlobalVariable about LLVM's assumptions vis-a-vis Global Variable
initial values and Global Variable initializers.

This is in preparation for adding the new keyword
externally_initialized.

Specifically, the patch explains how LLVM optimizes global initializers
by assumign that global variables defined within the module are not
modified from their initial values before the start of the global
initializer.

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=174269&r1=174268&r2=174269&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Sun Feb  3 03:57:15 2013
@@ -501,6 +501,13 @@ is zero. The address space qualifier mus
 LLVM allows an explicit section to be specified for globals. If the
 target supports it, it will emit globals to the section specified.
 
+By default, LLVM optimizes global initializers by assuming that global
+variables defined within the module are not modified from their
+initial values before the start of the global initializer.  This is
+true even for variables potentially accessible from outside the
+module, including those with external linkage or appearing in
+``@llvm.used``.
+
 An explicit alignment may be specified for a global, which must be a
 power of 2. If not present, or if the alignment is set to zero, the
 alignment of the global is set by the target to whatever it feels





More information about the llvm-commits mailing list