aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-03 02:01:50 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-03 02:01:50 +0000
commite5ab1bee8c1b4ae58bc108c28194af56379e55ac (patch)
tree28d11d3a199bbe0cc197cb2a98bf9ecfd8d27db4
parent43f3928c79c7c41ebd616cf42285853da6159e80 (diff)
Revert everything to r171366 to try to fix the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171450 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/IR/AttributeImpl.h4
-rw-r--r--lib/IR/Attributes.cpp25
2 files changed, 5 insertions, 24 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index 2633608926..ecdb9280ce 100644
--- a/lib/IR/AttributeImpl.h
+++ b/lib/IR/AttributeImpl.h
@@ -45,7 +45,7 @@ public:
bool contains(Attribute::AttrKind Kind) const;
bool contains(StringRef Kind) const;
- bool hasAttribute(Attribute::AttrKind A) const;
+ bool hasAttribute(uint64_t A) const;
bool hasAttributes() const;
bool hasAttributes(const Attribute &A) const;
@@ -69,7 +69,7 @@ public:
uint64_t getBitMask() const; // FIXME: Remove.
- static uint64_t getAttrMask(Attribute::AttrKind Val);
+ static uint64_t getAttrMask(uint64_t Val);
void Profile(FoldingSetNodeID &ID) const {
Profile(ID, Data, Vals);
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index b847d768f3..427134b00f 100644
--- a/lib/IR/Attributes.cpp
+++ b/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<ConstantInt>(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;
}