llvm-project/llvm/tools
Peter Collingbourne 21521891a2 IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals.
This change is motivated by an upcoming change to the metadata representation
used for CFI. The indirect function call checker needs type information for
external function declarations in order to correctly generate jump table
entries for such declarations. We currently associate such type information
with declarations using a global metadata node, but I plan [1] to move all
such metadata to global object attachments.

In bitcode, metadata attachments for function declarations appear in the
global metadata block. This seems reasonable to me because I expect metadata
attachments on declarations to be uncommon. In the long term I'd also expect
this to be the case for CFI, because we'd want to use some specialized bitcode
format for this metadata that could be read as part of the ThinLTO thin-link
phase, which would mean that it would not appear in the global metadata block.

To solve the lazy loaded metadata issue I was seeing with D20147, I use the
same bitcode representation for metadata attachments for global variables as I
do for function declarations. Since there's a use case for metadata attachments
in the global metadata block, we might as well use that representation for
global variables as well, at least until we have a mechanism for lazy loading
global variables.

In the assembly format, the metadata attachments appear after the "declare"
keyword in order to avoid a parsing ambiguity.

[1] http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

llvm-svn: 273336
2016-06-21 23:42:48 +00:00
..
bugpoint [Bugpoint] Erase comdat annotations after removing a global's initializer. 2016-06-15 23:20:12 +00:00
bugpoint-passes Remove autoconf support 2016-01-26 21:29:08 +00:00
dsymutil Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
gold Don't use the new x86 relax relocations on the gold plugin. 2016-06-17 17:53:57 +00:00
llc [llc] Do not create the pass config several times for run-pass. 2016-06-10 01:12:06 +00:00
lli Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-ar llvm-ar: correct typo 2016-06-21 17:19:28 +00:00
llvm-as Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-as-fuzzer Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
llvm-bcanalyzer Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-c-test Add support for callsite in the new C API for attributes 2016-06-15 05:14:29 +00:00
llvm-config [build] Make sure to link main executable with pthreads 2016-06-21 19:34:40 +00:00
llvm-cov Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-cxxdump Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-diff [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
llvm-dis IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals. 2016-06-21 23:42:48 +00:00
llvm-dwarfdump Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-dwp llvm-dwp: Ensure uncompressed sections are not relocated during processing of later inputs 2016-05-25 23:37:06 +00:00
llvm-extract Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-go Remove autoconf support 2016-01-26 21:29:08 +00:00
llvm-jitlistener Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-link Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-lto Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-mc Change the default of -relax-relocations. 2016-06-17 17:04:56 +00:00
llvm-mc-fuzzer [llvm-mc-fuzzer] Use LLVMFuzzerInitialize() instead of a custom main() and FuzzerDriver() 2016-05-13 10:23:04 +00:00
llvm-mcmarkup Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-nm Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-objdump Update llvm-obdump(1) to print FAT_MAGIC_64 for Darwin’s 64-bit universal files 2016-06-21 21:55:01 +00:00
llvm-pdbdump [pdb] Don't error on missing FPO streams 2016-06-17 20:38:01 +00:00
llvm-profdata Apply another batch of fixes from clang-tidy's performance-unnecessary-value-param. 2016-06-17 20:41:14 +00:00
llvm-readobj Delete some dead code. 2016-06-21 19:48:12 +00:00
llvm-rtdyld Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-shlib Revert "[CMake] LINK_LIBS need to be public for Darwin dylib targets" 2016-05-26 04:35:35 +00:00
llvm-size Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-split Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
llvm-stress [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
llvm-symbolizer Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
lto Delete Reloc::Default. 2016-05-18 22:04:49 +00:00
msbuild MSBuild integration: fix the loop in install.bat 2014-09-30 22:30:06 +00:00
obj2yaml Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
opt Use FPasses in opt exactly when it is initialized. 2016-06-15 10:32:00 +00:00
sancov Apply another batch of fixes from clang-tidy's performance-unnecessary-value-param. 2016-06-17 20:41:14 +00:00
sanstats [Symbolize] Check if the PE file has a PDB and emit an error if we can't load it 2016-06-03 20:25:09 +00:00
verify-uselistorder Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
xcode-toolchain [CMake] Cleanup uses of USES_TERMINAL 2016-06-08 22:19:25 +00:00
yaml2obj Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
CMakeLists.txt Fixup r271533, or check-clang didn't find llvm-lto as the target. 2016-06-02 20:39:24 +00:00
LLVMBuild.txt llvm-dwp: Initial layout 2015-12-01 00:48:34 +00:00