From c0df1129414aec481f632c1828b8adf0a6119ddd Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 3 Jan 2013 02:01:50 +0000 Subject: Revert everything to r171366 to try to fix the build. llvm-svn: 171450 --- llvm/lib/IR/Attributes.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'llvm/lib/IR/Attributes.cpp') diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index b847d768f3a..427134b00f6 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -233,15 +233,8 @@ std::string Attribute::getAsString() const { // AttrBuilder Implementation //===----------------------------------------------------------------------===// -void AttrBuilder::clear() { - AttrSet.clear(); - Alignment = StackAlignment = Bits = 0; -} - AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrKind Val){ Bits |= AttributeImpl::getAttrMask(Val); - - AttrSet.insert(Val); return *this; } @@ -255,31 +248,19 @@ AttrBuilder &AttrBuilder::addAlignmentAttr(unsigned Align) { assert(isPowerOf2_32(Align) && "Alignment must be a power of two."); assert(Align <= 0x40000000 && "Alignment too large."); Bits |= (Log2_32(Align) + 1) << 16; - - AttrSet.insert(Attribute::Alignment); - Alignment = Align; return *this; } -AttrBuilder &AttrBuilder::addStackAlignmentAttr(unsigned Align) { +AttrBuilder &AttrBuilder::addStackAlignmentAttr(unsigned Align){ // Default alignment, allow the target to define how to align it. if (Align == 0) return *this; assert(isPowerOf2_32(Align) && "Alignment must be a power of two."); assert(Align <= 0x100 && "Alignment too large."); Bits |= (Log2_32(Align) + 1) << 26; - - AttrSet.insert(Attribute::StackAlignment); - StackAlignment = Align; return *this; } AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) { Bits &= ~AttributeImpl::getAttrMask(Val); - - AttrSet.erase(Val); - if (Val == Attribute::Alignment) - Alignment = 0; - else if (Val == Attribute::StackAlignment) - StackAlignment = 0; return *this; } @@ -359,7 +340,7 @@ uint64_t AttributeImpl::getBitMask() const { return cast(Data)->getZExtValue(); } -uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) { +uint64_t AttributeImpl::getAttrMask(uint64_t Val) { switch (Val) { case Attribute::None: return 0; case Attribute::ZExt: return 1 << 0; @@ -395,7 +376,7 @@ uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) { llvm_unreachable("Unsupported attribute type"); } -bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { +bool AttributeImpl::hasAttribute(uint64_t A) const { return (getBitMask() & getAttrMask(A)) != 0; } -- cgit v1.2.3