aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-30 21:22:59 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-30 21:22:59 +0000
commit383da6ba555a3c2be360d9bdc75a74f315f2354e (patch)
tree3b19569a43c3abb77ad270b7e6e654b3ee5bda4e /lib
parent9a6dd0226194c46b839e10ee2f48730ea963eb22 (diff)
downloadexternal_llvm-383da6ba555a3c2be360d9bdc75a74f315f2354e.zip
external_llvm-383da6ba555a3c2be360d9bdc75a74f315f2354e.tar.gz
external_llvm-383da6ba555a3c2be360d9bdc75a74f315f2354e.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/Attributes.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 1a97110..938a34a 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -767,33 +767,15 @@ AttrBuilder::AttrBuilder(AttributeSet AS, unsigned Idx)
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() {