llvm-project/llvm/lib/ExecutionEngine/Orc
Peter Collingbourne 96efdd6107 IR: Introduce local_unnamed_addr attribute.
If a local_unnamed_addr attribute is attached to a global, the address
is known to be insignificant within the module. It is distinct from the
existing unnamed_addr attribute in that it only describes a local property
of the module rather than a global property of the symbol.

This attribute is intended to be used by the code generator and LTO to allow
the linker to decide whether the global needs to be in the symbol table. It is
possible to exclude a global from the symbol table if three things are true:
- This attribute is present on every instance of the global (which means that
  the normal rule that the global must have a unique address can be broken without
  being observable by the program by performing comparisons against the global's
  address)
- The global has linkonce_odr linkage (which means that each linkage unit must have
  its own copy of the global if it requires one, and the copy in each linkage unit
  must be the same)
- It is a constant or a function (which means that the program cannot observe that
  the unique-address rule has been broken by writing to the global)

Although this attribute could in principle be computed from the module
contents, LTO clients (i.e. linkers) will normally need to be able to compute
this property as part of symbol resolution, and it would be inefficient to
materialize every module just to compute it.

See:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160509/356401.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160516/356738.html
for earlier discussion.

Part of the fix for PR27553.

Differential Revision: http://reviews.llvm.org/D20348

llvm-svn: 272709
2016-06-14 21:01:22 +00:00
..
CMakeLists.txt [Orc] Merge some common code for creating CompileCallbackManagers and 2016-05-26 17:20:35 +00:00
ExecutionUtils.cpp [Orc] Add support classes for inspecting and running C++ static ctor/dtors, and 2015-04-02 04:34:45 +00:00
IndirectionUtils.cpp IR: Introduce local_unnamed_addr attribute. 2016-06-14 21:01:22 +00:00
LLVMBuild.txt Orc/LLVMBuild.txt: Prune redundant "Target" in libdeps. 2015-01-25 11:41:41 +00:00
NullResolver.cpp Fix line endings (NFC) 2015-06-22 21:37:34 +00:00
OrcABISupport.cpp [Orc] Rename OrcArchitectureSupport to OrcABISupport and add Win32 ABI support. 2016-05-07 03:36:38 +00:00
OrcCBindings.cpp [Orc] Merge some common code for creating CompileCallbackManagers and 2016-05-26 17:20:35 +00:00
OrcCBindingsStack.h [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol. 2016-05-31 23:14:26 +00:00
OrcError.cpp Add FIXMEs to all derived classes of std::error_category. 2016-05-24 20:13:46 +00:00
OrcMCJITReplacement.cpp [ExecutionEngine] ArrayRefize argument passing. 2015-06-13 19:50:29 +00:00
OrcMCJITReplacement.h [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol. 2016-05-31 23:14:26 +00:00
OrcRemoteTargetRPCAPI.cpp [Orc] Re-commit r266581 with fixes for MSVC, and format cleanups. 2016-04-18 19:55:43 +00:00