Make the AttrBuilder creation method of Attribute private so that people won't use it.
authorBill Wendling <isanbard@gmail.com>
Thu, 31 Jan 2013 01:51:27 +0000 (01:51 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 31 Jan 2013 01:51:27 +0000 (01:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174023 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Attributes.h
lib/IR/Verifier.cpp

index 29eaec1d0df8d56fadeb9b70e84a12f4aa582340..e854da7313ee429ac0a70686a3beea7daba10637 100644 (file)
@@ -105,6 +105,8 @@ public:
 private:
   AttributeImpl *pImpl;
   Attribute(AttributeImpl *A) : pImpl(A) {}
+
+  static Attribute get(LLVMContext &Context, AttrBuilder &B);
 public:
   Attribute() : pImpl(0) {}
 
@@ -114,7 +116,6 @@ public:
 
   /// \brief Return a uniquified Attribute object.
   static Attribute get(LLVMContext &Context, AttrKind Kind);
-  static Attribute get(LLVMContext &Context, AttrBuilder &B);
 
   /// \brief Return a uniquified Attribute object that has the specific
   /// alignment set.
index 5da74481e4f8287be1558e8368828decd13494f5..babc295126e82315c8d686754474b5b06393426b 100644 (file)
@@ -745,7 +745,9 @@ void Verifier::VerifyFunctionAttrs(FunctionType *FT,
   AttrBuilder NotFn(Attrs, AttributeSet::FunctionIndex);
   NotFn.removeFunctionOnlyAttrs();
   Assert1(!NotFn.hasAttributes(), "Attribute '" +
-          Attribute::get(V->getContext(), NotFn).getAsString() +
+          AttributeSet::get(V->getContext(),
+                            AttributeSet::FunctionIndex,
+                            NotFn).getAsString(AttributeSet::FunctionIndex) +
           "' do not apply to the function!", V);
 
   // Check for mutually incompatible attributes.