diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-02-03 09:57:15 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-02-03 09:57:15 +0000 |
commit | 4283499dcd76355d1c8ee4b28883635e967b7c81 (patch) | |
tree | 9c2de755fe4ff05d829b0ee47305fce67a09c8af | |
parent | a8eefc7cc7c6e8be06d570fff76dc42b43a23392 (diff) | |
download | external_llvm-4283499dcd76355d1c8ee4b28883635e967b7c81.zip external_llvm-4283499dcd76355d1c8ee4b28883635e967b7c81.tar.gz external_llvm-4283499dcd76355d1c8ee4b28883635e967b7c81.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174269 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/LangRef.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index d3bfddd..c9f37bd 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -501,6 +501,13 @@ is zero. The address space qualifier must precede any other attributes. 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 |