mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-07-18 21:24:39 -04:00
[Bitcode] Refactor attribute group writing to avoid getSlotAttributes
Summary: That API creates a temporary AttributeList to carry an index and a single AttributeSet. We need to carry the index in addition to the set, because that is how attribute groups are currently encoded. NFC Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32262 llvm-svn: 301245
This commit is contained in:
@@ -891,19 +891,19 @@ void ValueEnumerator::EnumerateAttributes(AttributeList PAL) {
|
||||
if (PAL.isEmpty()) return; // null is always 0.
|
||||
|
||||
// Do a lookup.
|
||||
unsigned &Entry = AttributeMap[PAL];
|
||||
unsigned &Entry = AttributeListMap[PAL];
|
||||
if (Entry == 0) {
|
||||
// Never saw this before, add it.
|
||||
Attribute.push_back(PAL);
|
||||
Entry = Attribute.size();
|
||||
AttributeLists.push_back(PAL);
|
||||
Entry = AttributeLists.size();
|
||||
}
|
||||
|
||||
// Do lookups for all attribute groups.
|
||||
for (unsigned i = 0, e = PAL.getNumSlots(); i != e; ++i) {
|
||||
AttributeList AS = PAL.getSlotAttributes(i);
|
||||
unsigned &Entry = AttributeGroupMap[AS];
|
||||
IndexAndAttrSet Pair = {PAL.getSlotIndex(i), PAL.getSlotSet(i)};
|
||||
unsigned &Entry = AttributeGroupMap[Pair];
|
||||
if (Entry == 0) {
|
||||
AttributeGroups.push_back(AS);
|
||||
AttributeGroups.push_back(Pair);
|
||||
Entry = AttributeGroups.size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user