summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
index e1b2f79c81c..6af7d107934 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
@@ -435,22 +435,20 @@ Value *WebAssemblyLowerEmscriptenEHSjLj::wrapInvoke(CallOrInvoke *CI) {
// Because we added the pointer to the callee as first argument, all
// argument attribute indices have to be incremented by one.
- SmallVector<AttributeSet, 8> AttributesVec;
+ SmallVector<AttributeSet, 8> ArgAttributes;
const AttributeList &InvokeAL = CI->getAttributes();
- // Add any return attributes.
- AttributesVec.push_back(InvokeAL.getRetAttributes());
// No attributes for the callee pointer.
- AttributesVec.push_back(AttributeSet());
+ ArgAttributes.push_back(AttributeSet());
// Copy the argument attributes from the original
for (unsigned i = 1, e = CI->getNumArgOperands(); i <= e; ++i) {
- AttributesVec.push_back(InvokeAL.getParamAttributes(i));
+ ArgAttributes.push_back(InvokeAL.getParamAttributes(i));
}
- // Add any function attributes.
- AttributesVec.push_back(InvokeAL.getFnAttributes());
// Reconstruct the AttributesList based on the vector we constructed.
- AttributeList NewCallAL = AttributeList::get(C, AttributesVec);
+ AttributeList NewCallAL =
+ AttributeList::get(C, InvokeAL.getFnAttributes(),
+ InvokeAL.getRetAttributes(), ArgAttributes);
NewCall->setAttributes(NewCallAL);
CI->replaceAllUsesWith(NewCall);
OpenPOWER on IntegriCloud