[llvm] r173975 - Remove redundant code.
Bill Wendling
isanbard at gmail.com
Wed Jan 30 13:22:59 PST 2013
Author: void
Date: Wed Jan 30 15:22:59 2013
New Revision: 173975
URL: http://llvm.org/viewvc/llvm-project?rev=173975&view=rev
Log:
Remove redundant code.
It was creating a new AttrBuilder when we could just fill in the AttrBuilder
we're building.
Modified:
llvm/trunk/lib/IR/Attributes.cpp
Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=173975&r1=173974&r2=173975&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Wed Jan 30 15:22:59 2013
@@ -767,33 +767,15 @@ AttrBuilder::AttrBuilder(AttributeSet AS
AttributeSetImpl *pImpl = AS.pImpl;
if (!pImpl) return;
- AttrBuilder B;
-
for (unsigned I = 0, E = pImpl->getNumAttributes(); I != E; ++I) {
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)
- B.addAttributes(*II);
+ addAttributes(*II);
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() {
More information about the llvm-commits
mailing list