llvm/unittests
Peter Collingbourne dba9146333 IR: New representation for CFI and virtual call optimization pass metadata.
The bitset metadata currently used in LLVM has a few problems:

1. It has the wrong name. The name "bitset" refers to an implementation
   detail of one use of the metadata (i.e. its original use case, CFI).
   This makes it harder to understand, as the name makes no sense in the
   context of virtual call optimization.

2. It is represented using a global named metadata node, rather than
   being directly associated with a global. This makes it harder to
   manipulate the metadata when rebuilding global variables, summarise it
   as part of ThinLTO and drop unused metadata when associated globals are
   dropped. For this reason, CFI does not currently work correctly when
   both CFI and vcall opt are enabled, as vcall opt needs to rebuild vtable
   globals, and fails to associate metadata with the rebuilt globals. As I
   understand it, the same problem could also affect ASan, which rebuilds
   globals with a red zone.

This patch solves both of those problems in the following way:

1. Rename the metadata to "type metadata". This new name reflects how
   the metadata is currently being used (i.e. to represent type information
   for CFI and vtable opt). The new name is reflected in the name for the
   associated intrinsic (llvm.type.test) and pass (LowerTypeTests).

2. Attach metadata directly to the globals that it pertains to, rather
   than using the "llvm.bitsets" global metadata node as we are doing now.
   This is done using the newly introduced capability to attach
   metadata to global variables (r271348 and r271358).

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 21:21:32 +00:00
..
ADT Add support for musl-libc on ARM Linux. 2016-06-24 21:14:33 +00:00
Analysis [PM] Run clang-format over various parts of the new pass manager code 2016-06-17 07:15:29 +00:00
AsmParser
Bitcode
CodeGen
DebugInfo DebugInfoPDBTests:MappedBlockStreamTest.TestWriteThenRead: Avoid assigning temporary object to ArrayRef. 2016-06-11 06:37:28 +00:00
ExecutionEngine [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol. 2016-05-31 23:14:26 +00:00
IR IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals. 2016-06-21 23:42:48 +00:00
LineEditor
Linker Remangle intrinsics names when types are renamed 2016-06-24 15:10:29 +00:00
MC
MI LiveIntervalAnalysis: findLastUseBefore() must ignore undef uses. 2016-06-11 00:31:28 +00:00
ObjectYAML
Option
ProfileData Remove specializations of ProfileSummary 2016-05-19 21:53:28 +00:00
Support Switch to using an API that handles non-ASCII paths appropriately on Windows. 2016-06-21 14:24:48 +00:00
Transforms IR: New representation for CFI and virtual call optimization pass metadata. 2016-06-24 21:21:32 +00:00
CMakeLists.txt