diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-03 01:46:27 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-03 01:46:27 +0000 |
commit | 40785ae18f9cdd166e63a3fde7f72ba2f123541e (patch) | |
tree | 46761dc1bf50c8fda8db6749fcb28cb1aee5d460 /llvm/lib/IR/Attributes.cpp | |
parent | 9b726d242f0d56a7280cb381b5a61d0f0d415814 (diff) | |
download | bcm5719-llvm-40785ae18f9cdd166e63a3fde7f72ba2f123541e.tar.gz bcm5719-llvm-40785ae18f9cdd166e63a3fde7f72ba2f123541e.zip |
Revert patch. Something snuck in there that shouldn't be.
--- Reverse-merging r171441 into '.':
U include/llvm/IR/Attributes.h
U lib/IR/Attributes.cpp
llvm-svn: 171444
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index fb99c855343..e6a5327b5fa 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -233,8 +233,15 @@ 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; } @@ -248,19 +255,31 @@ 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; } |