mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 19:15:30 +00:00
Revert "[WebAssembly] Update use of Attributes after r299875"
This reverts commit 2a0eb61dcccb15058d5b2a572bb3da0cf47fd550, r300015 I raced with rnk on the commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300016 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2a0eb61dcc
commit
e9dc13a183
@ -435,23 +435,26 @@ Value *WebAssemblyLowerEmscriptenEHSjLj::wrapInvoke(CallOrInvoke *CI) {
|
|||||||
|
|
||||||
// Because we added the pointer to the callee as first argument, all
|
// Because we added the pointer to the callee as first argument, all
|
||||||
// argument attribute indices have to be incremented by one.
|
// argument attribute indices have to be incremented by one.
|
||||||
SmallVector<AttributeSetNode *, 8> AttributesVec;
|
SmallVector<AttributeList, 8> AttributesVec;
|
||||||
const AttributeList &InvokeAL = CI->getAttributes();
|
const AttributeList &InvokePAL = CI->getAttributes();
|
||||||
|
CallSite::arg_iterator AI = CI->arg_begin();
|
||||||
// Add any return attributes.
|
unsigned i = 1; // Argument attribute index starts from 1
|
||||||
AttributesVec.push_back(InvokeAL.getRetAttributes());
|
for (unsigned e = CI->getNumArgOperands(); i <= e; ++AI, ++i) {
|
||||||
// No attributes for the callee pointer.
|
if (InvokePAL.hasAttributes(i)) {
|
||||||
AttributesVec.push_back(nullptr);
|
AttrBuilder B(InvokePAL, i);
|
||||||
// Copy the argument attributes from the original
|
AttributesVec.push_back(AttributeList::get(C, i + 1, B));
|
||||||
for (unsigned i = 1, e = CI->getNumArgOperands(); i <= e; ++i) {
|
}
|
||||||
AttributesVec.push_back(InvokeAL.getParamAttributes(i));
|
|
||||||
}
|
}
|
||||||
|
// Add any return attributes.
|
||||||
|
if (InvokePAL.hasAttributes(AttributeList::ReturnIndex))
|
||||||
|
AttributesVec.push_back(
|
||||||
|
AttributeList::get(C, InvokePAL.getRetAttributes()));
|
||||||
// Add any function attributes.
|
// Add any function attributes.
|
||||||
AttributesVec.push_back(InvokeAL.getFnAttributes());
|
if (InvokePAL.hasAttributes(AttributeList::FunctionIndex))
|
||||||
|
AttributesVec.push_back(AttributeList::get(C, InvokePAL.getFnAttributes()));
|
||||||
// Reconstruct the AttributesList based on the vector we constructed.
|
// Reconstruct the AttributesList based on the vector we constructed.
|
||||||
AttributeList NewCallAL = AttributeList::get(C, AttributesVec);
|
AttributeList NewCallPAL = AttributeList::get(C, AttributesVec);
|
||||||
NewCall->setAttributes(NewCallAL);
|
NewCall->setAttributes(NewCallPAL);
|
||||||
|
|
||||||
CI->replaceAllUsesWith(NewCall);
|
CI->replaceAllUsesWith(NewCall);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user