[llvm-commits] [llvm] r171450 - in /llvm/trunk/lib/IR: AttributeImpl.h Attributes.cpp

Bill Wendling isanbard at gmail.com
Wed Jan 2 18:01:50 PST 2013


Author: void
Date: Wed Jan  2 20:01:50 2013
New Revision: 171450

URL: http://llvm.org/viewvc/llvm-project?rev=171450&view=rev
Log:
Revert everything to r171366 to try to fix the build.

Modified:
    llvm/trunk/lib/IR/AttributeImpl.h
    llvm/trunk/lib/IR/Attributes.cpp

Modified: llvm/trunk/lib/IR/AttributeImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AttributeImpl.h?rev=171450&r1=171449&r2=171450&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AttributeImpl.h (original)
+++ llvm/trunk/lib/IR/AttributeImpl.h Wed Jan  2 20:01:50 2013
@@ -45,7 +45,7 @@
   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 @@
 
   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);

Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=171450&r1=171449&r2=171450&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Wed Jan  2 20:01:50 2013
@@ -233,15 +233,8 @@
 // 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 @@
   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 @@
   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 @@
   llvm_unreachable("Unsupported attribute type");
 }
 
-bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const {
+bool AttributeImpl::hasAttribute(uint64_t A) const {
   return (getBitMask() & getAttrMask(A)) != 0;
 }
 





More information about the llvm-commits mailing list