From b263bdf2954953cc7cca5d667eb01319ea0f72ec Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sun, 27 Jan 2013 02:46:53 +0000 Subject: Use the AttributeSet instead of AttributeWithIndex. In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173605 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 225ff8b350..da419dde03 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1875,15 +1875,14 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, continue; // Get the call site's attribute list. - SmallVector newAttrs; + SmallVector newAttrs; llvm::AttributeSet oldAttrs = callSite.getAttributes(); // Collect any return attributes from the call. if (oldAttrs.hasAttributes(llvm::AttributeSet::ReturnIndex)) newAttrs.push_back( - llvm::AttributeWithIndex::get(newFn->getContext(), - llvm::AttributeSet::ReturnIndex, - oldAttrs.getRetAttributes())); + llvm::AttributeSet::get(newFn->getContext(), + oldAttrs.getRetAttributes())); // If the function was passed too few arguments, don't transform. unsigned newNumArgs = newFn->arg_size(); @@ -1903,19 +1902,16 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, // Add any parameter attributes. if (oldAttrs.hasAttributes(argNo + 1)) newAttrs. - push_back(llvm::AttributeWithIndex:: - get(newFn->getContext(), - argNo + 1, - oldAttrs.getParamAttributes(argNo + 1))); + push_back(llvm:: + AttributeSet::get(newFn->getContext(), + oldAttrs.getParamAttributes(argNo + 1))); } if (dontTransform) continue; if (oldAttrs.hasAttributes(llvm::AttributeSet::FunctionIndex)) - newAttrs.push_back(llvm:: - AttributeWithIndex::get(newFn->getContext(), - llvm::AttributeSet::FunctionIndex, - oldAttrs.getFnAttributes())); + newAttrs.push_back(llvm::AttributeSet::get(newFn->getContext(), + oldAttrs.getFnAttributes())); // Okay, we can transform this. Create the new call instruction and copy // over the required information. -- cgit v1.2.3-18-g5258