summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-12 08:01:22 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-12 08:01:22 +0000
commit7b5f4f3facd9df205123b6f1ca2428c3caa95eee (patch)
tree080d2410eea9dc042b552127cf868bff4e8178d1 /llvm/lib/Bitcode/Writer
parenteeffea416bb5b291f96b4222cc6ff6f222952334 (diff)
downloadbcm5719-llvm-7b5f4f3facd9df205123b6f1ca2428c3caa95eee.tar.gz
bcm5719-llvm-7b5f4f3facd9df205123b6f1ca2428c3caa95eee.zip
Use the AttributeSet as the 'key' to the map instead of the 'raw' pointer.
llvm-svn: 174950
Diffstat (limited to 'llvm/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.cpp5
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index 5822586e9fe..4f19dd00e63 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -418,10 +418,11 @@ void ValueEnumerator::EnumerateOperandType(const Value *V) {
EnumerateMetadata(V);
}
-void ValueEnumerator::EnumerateAttributes(const AttributeSet &PAL) {
+void ValueEnumerator::EnumerateAttributes(AttributeSet PAL) {
if (PAL.isEmpty()) return; // null is always 0.
+
// Do a lookup.
- unsigned &Entry = AttributeMap[PAL.getRawPointer()];
+ unsigned &Entry = AttributeMap[PAL];
if (Entry == 0) {
// Never saw this before, add it.
Attribute.push_back(PAL);
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.h b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
index 33db52388a8..0af6164c944 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
@@ -56,7 +56,7 @@ private:
AttributeGroupMapType AttributeGroupMap;
std::vector<AttributeSet> AttributeGroups;
- typedef DenseMap<void*, unsigned> AttributeMapType;
+ typedef DenseMap<AttributeSet, unsigned> AttributeMapType;
AttributeMapType AttributeMap;
std::vector<AttributeSet> Attribute;
@@ -104,7 +104,7 @@ public:
unsigned getAttributeID(AttributeSet PAL) const {
if (PAL.isEmpty()) return 0; // Null maps to zero.
- AttributeMapType::const_iterator I = AttributeMap.find(PAL.getRawPointer());
+ AttributeMapType::const_iterator I = AttributeMap.find(PAL);
assert(I != AttributeMap.end() && "Attribute not in ValueEnumerator!");
return I->second;
}
@@ -160,7 +160,7 @@ private:
void EnumerateValue(const Value *V);
void EnumerateType(Type *T);
void EnumerateOperandType(const Value *V);
- void EnumerateAttributes(const AttributeSet &PAL);
+ void EnumerateAttributes(AttributeSet PAL);
void EnumerateValueSymbolTable(const ValueSymbolTable &ST);
void EnumerateNamedMetadata(const Module *M);
OpenPOWER on IntegriCloud