diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-06-27 18:19:56 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-06-27 18:19:56 +0000 |
commit | c8a1169c935ad9d3dfbdd4f72d80abf8f5acb03c (patch) | |
tree | ba02374e6ebac3aeaa3c234be27d92c6224cf34f /lib/Bitcode/Writer/ValueEnumerator.h | |
parent | 4a295dfbf9c5e8a71b8345484eff200058522b4e (diff) | |
download | llvm-c8a1169c935ad9d3dfbdd4f72d80abf8f5acb03c.tar.gz llvm-c8a1169c935ad9d3dfbdd4f72d80abf8f5acb03c.tar.bz2 llvm-c8a1169c935ad9d3dfbdd4f72d80abf8f5acb03c.tar.xz |
IR: Add COMDATs to the IR
This new IR facility allows us to represent the object-file semantic of
a COMDAT group.
COMDATs allow us to tie together sections and make the inclusion of one
dependent on another. This is required to implement features like MS
ABI VFTables and optimizing away certain kinds of initialization in C++.
This functionality is only representable in COFF and ELF, Mach-O has no
similar mechanism.
Differential Revision: http://reviews.llvm.org/D4178
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h index d1ca15f45d..1c9f38e07b 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.h +++ b/lib/Bitcode/Writer/ValueEnumerator.h @@ -16,6 +16,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/UniqueVector.h" #include "llvm/IR/Attributes.h" #include <vector> @@ -25,6 +26,7 @@ class Type; class Value; class Instruction; class BasicBlock; +class Comdat; class Function; class Module; class MDNode; @@ -48,6 +50,10 @@ private: typedef DenseMap<const Value*, unsigned> ValueMapType; ValueMapType ValueMap; ValueList Values; + + typedef UniqueVector<const Comdat *> ComdatSetType; + ComdatSetType Comdats; + ValueList MDValues; SmallVector<const MDNode *, 8> FunctionLocalMDs; ValueMapType MDValueMap; @@ -139,6 +145,9 @@ public: return AttributeGroups; } + const ComdatSetType &getComdats() const { return Comdats; } + unsigned getComdatID(const Comdat *C) const; + /// getGlobalBasicBlockID - This returns the function-specific ID for the /// specified basic block. This is relatively expensive information, so it /// should only be used by rare constructs such as address-of-label. |