From 8ed701da9aa388c078cc6aecac2fe355974c90d2 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 31 Jan 2013 01:51:27 +0000 Subject: [PATCH] Make the AttrBuilder creation method of Attribute private so that people won't use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174023 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Attributes.h | 3 ++- lib/IR/Verifier.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 29eaec1d0df..e854da7313e 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -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. diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 5da74481e4f..babc295126e 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -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. -- 2.34.1