diff options
author | Devang Patel <dpatel@apple.com> | 2009-09-18 19:26:43 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-09-18 19:26:43 +0000 |
commit | e8e0213cc3daa2d0457c22e4c12e6973f21fc942 (patch) | |
tree | 011f5819548ed35e3c31b6abe45e271bf0eb1147 /lib/Bitcode/Writer/ValueEnumerator.h | |
parent | 88d9839d07a6b5a03484d664913de0f2b33d3bff (diff) |
Write and read metadata attachments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h index b5106f0809..da63dde2a2 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.h +++ b/lib/Bitcode/Writer/ValueEnumerator.h @@ -22,6 +22,7 @@ namespace llvm { class Type; class Value; +class Instruction; class BasicBlock; class Function; class Module; @@ -47,11 +48,15 @@ private: ValueList Values; ValueList MDValues; ValueMapType MDValueMap; - + typedef DenseMap<void*, unsigned> AttributeMapType; AttributeMapType AttributeMap; std::vector<AttrListPtr> Attributes; + typedef DenseMap<const Instruction*, unsigned> InstructionMapType; + InstructionMapType InstructionMap; + unsigned InstructionCount; + /// BasicBlocks - This contains all the basic blocks for the currently /// incorporated function. Their reverse mapping is stored in ValueMap. std::vector<const BasicBlock*> BasicBlocks; @@ -74,7 +79,10 @@ public: assert(I != TypeMap.end() && "Type not in ValueEnumerator!"); return I->second-1; } - + + unsigned getInstructionID(const Instruction *I) const; + void setInstructionID(const Instruction *I); + unsigned getAttributeID(const AttrListPtr &PAL) const { if (PAL.isEmpty()) return 0; // Null maps to zero. AttributeMapType::const_iterator I = AttributeMap.find(PAL.getRawPointer()); |