mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
Remove redundant code.
It was creating a new AttrBuilder when we could just fill in the AttrBuilder we're building. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a6dd02261
commit
383da6ba55
@ -767,33 +767,15 @@ AttrBuilder::AttrBuilder(AttributeSet AS, unsigned Idx)
|
|||||||
AttributeSetImpl *pImpl = AS.pImpl;
|
AttributeSetImpl *pImpl = AS.pImpl;
|
||||||
if (!pImpl) return;
|
if (!pImpl) return;
|
||||||
|
|
||||||
AttrBuilder B;
|
|
||||||
|
|
||||||
for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I) {
|
for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I) {
|
||||||
if (pImpl->getSlotIndex(I) != Idx) continue;
|
if (pImpl->getSlotIndex(I) != Idx) continue;
|
||||||
|
|
||||||
for (AttributeSetNode::const_iterator II = pImpl->begin(I),
|
for (AttributeSetImpl::const_iterator II = pImpl->begin(I),
|
||||||
IE = pImpl->end(I); II != IE; ++II)
|
IE = pImpl->end(I); II != IE; ++II)
|
||||||
B.addAttributes(*II);
|
addAttributes(*II);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!B.hasAttributes()) return;
|
|
||||||
|
|
||||||
uint64_t Mask = B.Raw();
|
|
||||||
|
|
||||||
for (Attribute::AttrKind I = Attribute::None; I != Attribute::EndAttrKinds;
|
|
||||||
I = Attribute::AttrKind(I + 1)) {
|
|
||||||
if (uint64_t A = (Mask & AttributeImpl::getAttrMask(I))) {
|
|
||||||
Attrs.insert(I);
|
|
||||||
|
|
||||||
if (I == Attribute::Alignment)
|
|
||||||
Alignment = 1ULL << ((A >> 16) - 1);
|
|
||||||
else if (I == Attribute::StackAlignment)
|
|
||||||
StackAlignment = 1ULL << ((A >> 26)-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttrBuilder::clear() {
|
void AttrBuilder::clear() {
|
||||||
|
Loading…
Reference in New Issue
Block a user