summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-21 21:57:40 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-21 21:57:40 +0000
commit304f6f0a5900c1ce06c2b26416dae56143f20147 (patch)
tree9062d761cca71e6733874b06d73157897f2724a3 /clang/lib/CodeGen/CodeGenModule.cpp
parentbd4ea16bf39033271255dfbcc8ffb636a7de26bb (diff)
downloadbcm5719-llvm-304f6f0a5900c1ce06c2b26416dae56143f20147.tar.gz
bcm5719-llvm-304f6f0a5900c1ce06c2b26416dae56143f20147.zip
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. llvm-svn: 173095
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 28f59742cee..5e09e47d540 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud