aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 0d4e0981d0..d5284f803c 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1965,9 +1965,12 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old,
}
// Add any parameter attributes.
- llvm::Attribute pAttrs = oldAttrs.getParamAttributes(argNo + 1);
- if (pAttrs.hasAttributes())
- newAttrs.push_back(llvm::AttributeWithIndex::get(argNo + 1, pAttrs));
+ if (oldAttrs.hasAttributes(argNo + 1))
+ newAttrs.
+ push_back(llvm::AttributeWithIndex::
+ get(newFn->getContext(),
+ argNo + 1,
+ oldAttrs.getParamAttributes(argNo + 1)));
}
if (dontTransform)
continue;