diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-02-10 23:06:02 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-02-10 23:06:02 +0000 |
commit | 51f612eb69dddafe481e6237980b9159add598b5 (patch) | |
tree | f67f68288f7559967e01658bf987cb2a3e2a971a /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | |
parent | da2b868f1e4800555c94b3c912e06f9661047f38 (diff) | |
download | bcm5719-llvm-51f612eb69dddafe481e6237980b9159add598b5.tar.gz bcm5719-llvm-51f612eb69dddafe481e6237980b9159add598b5.zip |
Add support for attribute groups in the value enumerator.
Attribute groups are essentially all AttributeSets which are used by the
program. Enumerate them here.
llvm-svn: 174844
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index b2f7875111d..9f7e17b976b 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/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) { |