X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTarget%2FWebAssembly%2FWebAssemblyISelLowering.cpp;fp=lib%2FTarget%2FWebAssembly%2FWebAssemblyISelLowering.cpp;h=76df63b54074bce38f86734ebaf2e1ca12c3f08d;hp=4ef0846d311a2a0f31e2984747b5ddc460d9a155;hb=4f331ff0d30a81ae5c41ad5a35964398996930a1;hpb=23c0f3b5a2197452c6a25a74fe2fc624763547a1 diff --git a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 4ef0846d311..76df63b5407 100644 --- a/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -359,8 +359,11 @@ WebAssemblyTargetLowering::LowerCall(CallLoweringInfo &CLI, unsigned NumBytes = CCInfo.getAlignedCallFrameSize(); - auto NB = DAG.getConstant(NumBytes, DL, PtrVT, true); - Chain = DAG.getCALLSEQ_START(Chain, NB, DL); + SDValue NB; + if (NumBytes) { + NB = DAG.getConstant(NumBytes, DL, PtrVT, true); + Chain = DAG.getCALLSEQ_START(Chain, NB, DL); + } if (IsVarArg) { // For non-fixed arguments, next emit stores to store the argument values @@ -420,8 +423,10 @@ WebAssemblyTargetLowering::LowerCall(CallLoweringInfo &CLI, Chain = Res.getValue(1); } - SDValue Unused = DAG.getUNDEF(PtrVT); - Chain = DAG.getCALLSEQ_END(Chain, NB, Unused, SDValue(), DL); + if (NumBytes) { + SDValue Unused = DAG.getUNDEF(PtrVT); + Chain = DAG.getCALLSEQ_END(Chain, NB, Unused, SDValue(), DL); + } return Chain; }