From a37ce617af7300eee3ceab435021c342e62c5661 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 21 Jan 2013 21:57:40 +0000 Subject: [PATCH] Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute. This is more code to isolate the use of the Attribute class to that of just holding one attribute instead of a collection of attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173095 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 28f59742ce..5e09e47d54 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1938,10 +1938,10 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, llvm::AttributeSet oldAttrs = callSite.getAttributes(); // Collect any return attributes from the call. - llvm::Attribute returnAttrs = oldAttrs.getRetAttributes(); - if (returnAttrs.hasAttributes()) + if (oldAttrs.hasAttributes(llvm::AttributeSet::ReturnIndex)) newAttrs.push_back(llvm::AttributeWithIndex::get( - llvm::AttributeSet::ReturnIndex, returnAttrs)); + llvm::AttributeSet::ReturnIndex, + oldAttrs.getRetAttributes())); // If the function was passed too few arguments, don't transform. unsigned newNumArgs = newFn->arg_size(); @@ -1966,11 +1966,11 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, if (dontTransform) continue; - llvm::Attribute fnAttrs = oldAttrs.getFnAttributes(); if (oldAttrs.hasAttributes(llvm::AttributeSet::FunctionIndex)) newAttrs.push_back(llvm:: - AttributeWithIndex::get(llvm::AttributeSet::FunctionIndex, - fnAttrs)); + AttributeWithIndex::get(newFn->getContext(), + llvm::AttributeSet::FunctionIndex, + oldAttrs.getFnAttributes())); // Okay, we can transform this. Create the new call instruction and copy // over the required information. -- 2.40.0