aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer/ValueEnumerator.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-10 23:06:02 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-10 23:06:02 +0000
commit8c2e77f895301967bf37d04e905fb1f069ec91b2 (patch)
tree2d0ed3b3b0cd0777bf17cf4817479c70b3246722 /lib/Bitcode/Writer/ValueEnumerator.cpp
parenta311c526ed1da64c450bb8842630f6f80c691eca (diff)
downloadexternal_llvm-8c2e77f895301967bf37d04e905fb1f069ec91b2.zip
external_llvm-8c2e77f895301967bf37d04e905fb1f069ec91b2.tar.gz
external_llvm-8c2e77f895301967bf37d04e905fb1f069ec91b2.tar.bz2
Add support for attribute groups in the value enumerator.
Attribute groups are essentially all AttributeSets which are used by the program. Enumerate them here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp
index b2f7875..9f7e17b 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -427,6 +427,16 @@ void ValueEnumerator::EnumerateAttributes(const AttributeSet &PAL) {
Attribute.push_back(PAL);
Entry = Attribute.size();
}
+
+ // Do lookups for all attribute groups.
+ for (unsigned i = 0, e = PAL.getNumSlots(); i != e; ++i) {
+ AttributeSet AS = PAL.getSlotAttributes(i);
+ unsigned &Entry = AttributeSetMap[AS];
+ if (Entry == 0) {
+ AttributeSets.push_back(AS);
+ Entry = AttributeSets.size();
+ }
+ }
}
void ValueEnumerator::incorporateFunction(const Function &F) {