diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index eae384a..00eb325 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -205,31 +205,8 @@
 
     uint64_t getAlignment() const;
 
-    void addAddressSafetyAttr();
-    void addAlwaysInlineAttr();
-    void addByValAttr();
-    void addInlineHintAttr();
-    void addInRegAttr();
-    void addNakedAttr();
-    void addNestAttr();
-    void addNoAliasAttr();
-    void addNoCaptureAttr();
-    void addNoImplicitFloatAttr();
-    void addNoInlineAttr();
-    void addNonLazyBindAttr();
-    void addNoRedZoneAttr();
-    void addNoReturnAttr();
-    void addNoUnwindAttr();
-    void addOptimizeForSizeAttr();
-    void addReadNoneAttr();
-    void addReadOnlyAttr();
-    void addReturnsTwiceAttr();
-    void addSExtAttr();
-    void addStackProtectAttr();
-    void addStackProtectReqAttr();
-    void addStructRetAttr();
-    void addUWTableAttr();
-    void addZExtAttr();
+    void addAttribute(Attributes::AttrVal Val);
+    void removeAttribute(Attributes::AttrVal Val);
 
     void addAlignmentAttr(unsigned Align);
     void addStackAlignmentAttr(unsigned Align);
@@ -276,13 +253,16 @@
     return hasAttribute(Attributes::StructRet);
   }
 
-  // Attribute query methods.
-  // FIXME: StackAlignment & Alignment attributes have no predicate methods.
+  /// @brief Return true if the attribute is present.
+  bool hasAttribute(AttrVal Val) const;
+
+  /// @brief Return true if attributes exist
   bool hasAttributes() const {
     return Attrs.hasAttributes();
   }
+
+  /// @brief Return true if the attributes are a non-null intersection.
   bool hasAttributes(const Attributes &A) const;
-  bool hasAttribute(AttrVal Val) const;
 
   /// This returns the alignment field of an attribute as a byte alignment
   /// value.
diff --git a/include/llvm/AttributesImpl.h b/include/llvm/AttributesImpl.h
index 4f68cb4..eea11a7 100644
--- a/include/llvm/AttributesImpl.h
+++ b/include/llvm/AttributesImpl.h
@@ -25,7 +25,6 @@
   friend class Attributes;
   uint64_t Bits;                // FIXME: We will be expanding this.
 
-  uint64_t getAttrMask(uint64_t Val) const;
 public:
   AttributesImpl(uint64_t bits) : Bits(bits) {}
 
@@ -39,6 +38,8 @@
 
   bool isEmptyOrSingleton() const;
 
+  static uint64_t getAttrMask(uint64_t Val);
+
   void Profile(FoldingSetNodeID &ID) const {
     Profile(ID, Bits);
   }
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index d813d67..76ac0f7 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -927,32 +927,32 @@
     switch (Token) {
     default:  // End of attributes.
       return HaveError;
-    case lltok::kw_zeroext:         B.addZExtAttr(); break;
-    case lltok::kw_signext:         B.addSExtAttr(); break;
-    case lltok::kw_inreg:           B.addInRegAttr(); break;
-    case lltok::kw_sret:            B.addStructRetAttr(); break;
-    case lltok::kw_noalias:         B.addNoAliasAttr(); break;
-    case lltok::kw_nocapture:       B.addNoCaptureAttr(); break;
-    case lltok::kw_byval:           B.addByValAttr(); break;
-    case lltok::kw_nest:            B.addNestAttr(); break;
+    case lltok::kw_zeroext:         B.addAttribute(Attributes::ZExt); break;
+    case lltok::kw_signext:         B.addAttribute(Attributes::SExt); break;
+    case lltok::kw_inreg:           B.addAttribute(Attributes::InReg); break;
+    case lltok::kw_sret:            B.addAttribute(Attributes::StructRet); break;
+    case lltok::kw_noalias:         B.addAttribute(Attributes::NoAlias); break;
+    case lltok::kw_nocapture:       B.addAttribute(Attributes::NoCapture); break;
+    case lltok::kw_byval:           B.addAttribute(Attributes::ByVal); break;
+    case lltok::kw_nest:            B.addAttribute(Attributes::Nest); break;
 
-    case lltok::kw_noreturn:        B.addNoReturnAttr(); break;
-    case lltok::kw_nounwind:        B.addNoUnwindAttr(); break;
-    case lltok::kw_uwtable:         B.addUWTableAttr(); break;
-    case lltok::kw_returns_twice:   B.addReturnsTwiceAttr(); break;
-    case lltok::kw_noinline:        B.addNoInlineAttr(); break;
-    case lltok::kw_readnone:        B.addReadNoneAttr(); break;
-    case lltok::kw_readonly:        B.addReadOnlyAttr(); break;
-    case lltok::kw_inlinehint:      B.addInlineHintAttr(); break;
-    case lltok::kw_alwaysinline:    B.addAlwaysInlineAttr(); break;
-    case lltok::kw_optsize:         B.addOptimizeForSizeAttr(); break;
-    case lltok::kw_ssp:             B.addStackProtectAttr(); break;
-    case lltok::kw_sspreq:          B.addStackProtectReqAttr(); break;
-    case lltok::kw_noredzone:       B.addNoRedZoneAttr(); break;
-    case lltok::kw_noimplicitfloat: B.addNoImplicitFloatAttr(); break;
-    case lltok::kw_naked:           B.addNakedAttr(); break;
-    case lltok::kw_nonlazybind:     B.addNonLazyBindAttr(); break;
-    case lltok::kw_address_safety:  B.addAddressSafetyAttr(); break;
+    case lltok::kw_noreturn:        B.addAttribute(Attributes::NoReturn); break;
+    case lltok::kw_nounwind:        B.addAttribute(Attributes::NoUnwind); break;
+    case lltok::kw_uwtable:         B.addAttribute(Attributes::UWTable); break;
+    case lltok::kw_returns_twice:   B.addAttribute(Attributes::ReturnsTwice); break;
+    case lltok::kw_noinline:        B.addAttribute(Attributes::NoInline); break;
+    case lltok::kw_readnone:        B.addAttribute(Attributes::ReadNone); break;
+    case lltok::kw_readonly:        B.addAttribute(Attributes::ReadOnly); break;
+    case lltok::kw_inlinehint:      B.addAttribute(Attributes::InlineHint); break;
+    case lltok::kw_alwaysinline:    B.addAttribute(Attributes::AlwaysInline); break;
+    case lltok::kw_optsize:         B.addAttribute(Attributes::OptimizeForSize); break;
+    case lltok::kw_ssp:             B.addAttribute(Attributes::StackProtect); break;
+    case lltok::kw_sspreq:          B.addAttribute(Attributes::StackProtectReq); break;
+    case lltok::kw_noredzone:       B.addAttribute(Attributes::NoRedZone); break;
+    case lltok::kw_noimplicitfloat: B.addAttribute(Attributes::NoImplicitFloat); break;
+    case lltok::kw_naked:           B.addAttribute(Attributes::Naked); break;
+    case lltok::kw_nonlazybind:     B.addAttribute(Attributes::NonLazyBind); break;
+    case lltok::kw_address_safety:  B.addAttribute(Attributes::AddressSafety); break;
 
     case lltok::kw_alignstack: {
       unsigned Alignment;
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index 8ebf6ee..3e598ab 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -140,9 +140,9 @@
       Attributes::Builder NewAttributes;
 
       if (!SCCMightUnwind)
-        NewAttributes.addNoUnwindAttr();
+        NewAttributes.addAttribute(Attributes::NoUnwind);
       if (!SCCMightReturn)
-        NewAttributes.addNoReturnAttr();
+        NewAttributes.addAttribute(Attributes::NoReturn);
 
       Function *F = (*I)->getFunction();
       const AttrListPtr &PAL = F->getAttributes();
diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index 4c71fe3..66d8570 100644
--- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -683,7 +683,7 @@
   F->setUnnamedAddr(true);
   F->setLinkage(GlobalValue::InternalLinkage);
   Attributes::Builder B;
-  B.addNoInlineAttr();
+  B.addAttribute(Attributes::NoInline);
   F->addFnAttr(Attributes::get(B));
 
   BB = BasicBlock::Create(*Ctx, "entry", F);
@@ -704,7 +704,7 @@
   Fn->setUnnamedAddr(true);
   Fn->setLinkage(GlobalValue::InternalLinkage);
   Attributes::Builder B;
-  B.addNoInlineAttr();
+  B.addAttribute(Attributes::NoInline);
   Fn->addFnAttr(Attributes::get(B));
 
   Type *Int32Ty = Type::getInt32Ty(*Ctx);
diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp
index dca6a72..629f9d2 100644
--- a/lib/Transforms/Scalar/ObjCARC.cpp
+++ b/lib/Transforms/Scalar/ObjCARC.cpp
@@ -1789,7 +1789,7 @@
     Type *Params[] = { I8X };
     FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     RetainRVCallee =
       M->getOrInsertFunction("objc_retainAutoreleasedReturnValue", FTy,
@@ -1805,7 +1805,7 @@
     Type *Params[] = { I8X };
     FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     AutoreleaseRVCallee =
       M->getOrInsertFunction("objc_autoreleaseReturnValue", FTy,
@@ -1819,7 +1819,7 @@
     LLVMContext &C = M->getContext();
     Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     ReleaseCallee =
       M->getOrInsertFunction(
@@ -1835,7 +1835,7 @@
     LLVMContext &C = M->getContext();
     Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     RetainCallee =
       M->getOrInsertFunction(
@@ -1866,7 +1866,7 @@
     LLVMContext &C = M->getContext();
     Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     AutoreleaseCallee =
       M->getOrInsertFunction(
@@ -3841,9 +3841,9 @@
     Type *Params[] = { I8XX, I8X };
 
     Attributes::Builder BNoUnwind;
-    BNoUnwind.addNoUnwindAttr();
+    BNoUnwind.addAttribute(Attributes::NoUnwind);
     Attributes::Builder BNoCapture;
-    BNoCapture.addNoCaptureAttr();
+    BNoCapture.addAttribute(Attributes::NoCapture);
     AttrListPtr Attributes = AttrListPtr()
       .addAttr(~0u, Attributes::get(BNoUnwind))
       .addAttr(1, Attributes::get(BNoCapture));
@@ -3864,7 +3864,7 @@
     Type *Params[] = { I8X };
     FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     RetainAutoreleaseCallee =
       M->getOrInsertFunction("objc_retainAutorelease", FTy, Attributes);
@@ -3879,7 +3879,7 @@
     Type *Params[] = { I8X };
     FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
     Attributes::Builder B;
-    B.addNoUnwindAttr();
+    B.addAttribute(Attributes::NoUnwind);
     AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
     RetainAutoreleaseRVCallee =
       M->getOrInsertFunction("objc_retainAutoreleaseReturnValue", FTy,
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index 4024410..6e68973 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -65,14 +65,14 @@
   return Attributes(PA);
 }
 
-bool Attributes::hasAttributes(const Attributes &A) const {
-  return Attrs.hasAttributes(A);
-}
-
 bool Attributes::hasAttribute(AttrVal Val) const {
   return Attrs.hasAttribute(Val);
 }
 
+bool Attributes::hasAttributes(const Attributes &A) const {
+  return Attrs.hasAttributes(A);
+}
+
 /// This returns the alignment field of an attribute as a byte alignment value.
 unsigned Attributes::getAlignment() const {
   if (!hasAttribute(Attributes::Alignment))
@@ -122,17 +122,17 @@
   
   if (!Ty->isIntegerTy()) {
     // Attributes that only apply to integers.
-    Incompatible.addSExtAttr();
-    Incompatible.addZExtAttr();
+    Incompatible.addAttribute(Attributes::SExt);
+    Incompatible.addAttribute(Attributes::ZExt);
   }
   
   if (!Ty->isPointerTy()) {
     // Attributes that only apply to pointers.
-    Incompatible.addByValAttr();
-    Incompatible.addNestAttr();
-    Incompatible.addNoAliasAttr();
-    Incompatible.addNoCaptureAttr();
-    Incompatible.addStructRetAttr();
+    Incompatible.addAttribute(Attributes::ByVal);
+    Incompatible.addAttribute(Attributes::Nest);
+    Incompatible.addAttribute(Attributes::NoAlias);
+    Incompatible.addAttribute(Attributes::NoCapture);
+    Incompatible.addAttribute(Attributes::StructRet);
   }
   
   return Attributes(Incompatible.Bits); // FIXME: Use Attributes::get().
@@ -210,80 +210,8 @@
 // Attributes::Builder Implementation
 //===----------------------------------------------------------------------===//
 
-void Attributes::Builder::addAddressSafetyAttr() {
-  Bits |= Attribute::AddressSafety_i;
-}
-void Attributes::Builder::addAlwaysInlineAttr() {
-  Bits |= Attribute::AlwaysInline_i;
-}
-void Attributes::Builder::addByValAttr() {
-  Bits |= Attribute::ByVal_i;
-}
-void Attributes::Builder::addInlineHintAttr() {
-  Bits |= Attribute::InlineHint_i;
-}
-void Attributes::Builder::addInRegAttr() {
-  Bits |= Attribute::InReg_i;
-}
-void Attributes::Builder::addNakedAttr() {
-  Bits |= Attribute::Naked_i;
-}
-void Attributes::Builder::addNestAttr() {
-  Bits |= Attribute::Nest_i;
-}
-void Attributes::Builder::addNoAliasAttr() {
-  Bits |= Attribute::NoAlias_i;
-}
-void Attributes::Builder::addNoCaptureAttr() {
-  Bits |= Attribute::NoCapture_i;
-}
-void Attributes::Builder::addNoImplicitFloatAttr() {
-  Bits |= Attribute::NoImplicitFloat_i;
-}
-void Attributes::Builder::addNoInlineAttr() {
-  Bits |= Attribute::NoInline_i;
-}
-void Attributes::Builder::addNonLazyBindAttr() {
-  Bits |= Attribute::NonLazyBind_i;
-}
-void Attributes::Builder::addNoRedZoneAttr() {
-  Bits |= Attribute::NoRedZone_i;
-}
-void Attributes::Builder::addNoReturnAttr() {
-  Bits |= Attribute::NoReturn_i;
-}
-void Attributes::Builder::addNoUnwindAttr() {
-  Bits |= Attribute::NoUnwind_i;
-}
-void Attributes::Builder::addOptimizeForSizeAttr() {
-  Bits |= Attribute::OptimizeForSize_i;
-}
-void Attributes::Builder::addReadNoneAttr() {
-  Bits |= Attribute::ReadNone_i;
-}
-void Attributes::Builder::addReadOnlyAttr() {
-  Bits |= Attribute::ReadOnly_i;
-}
-void Attributes::Builder::addReturnsTwiceAttr() {
-  Bits |= Attribute::ReturnsTwice_i;
-}
-void Attributes::Builder::addSExtAttr() {
-  Bits |= Attribute::SExt_i;
-}
-void Attributes::Builder::addStackProtectAttr() {
-  Bits |= Attribute::StackProtect_i;
-}
-void Attributes::Builder::addStackProtectReqAttr() {
-  Bits |= Attribute::StackProtectReq_i;
-}
-void Attributes::Builder::addStructRetAttr() {
-  Bits |= Attribute::StructRet_i;
-}
-void Attributes::Builder::addUWTableAttr() {
-  Bits |= Attribute::UWTable_i;
-}
-void Attributes::Builder::addZExtAttr() {
-  Bits |= Attribute::ZExt_i;
+void Attributes::Builder::addAttribute(Attributes::AttrVal Val) {
+  Bits |= AttributesImpl::getAttrMask(Val);
 }
 
 void Attributes::Builder::addAlignmentAttr(unsigned Align) {
@@ -300,6 +228,10 @@
   Bits |= (Log2_32(Align) + 1) << 26;
 }
 
+void Attributes::Builder::removeAttribute(Attributes::AttrVal Val) {
+  Bits &= ~AttributesImpl::getAttrMask(Val);
+}
+
 void Attributes::Builder::removeAttributes(const Attributes &A) {
   Bits &= ~A.Raw();
 }
@@ -407,7 +339,7 @@
 // AttributeImpl Definition
 //===----------------------------------------------------------------------===//
 
-uint64_t AttributesImpl::getAttrMask(uint64_t Val) const {
+uint64_t AttributesImpl::getAttrMask(uint64_t Val) {
   switch (Val) {
   case Attributes::None:            return 0;
   case Attributes::ZExt:            return 1 << 0;
