mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Fix a latent bug in the call sequence handling stuff. Some targets (e.g. x86)
create these nodes with flag results. Remember that we legalized them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -729,7 +729,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remember that the CALLSEQ_START is legalized.
|
// Remember that the CALLSEQ_START is legalized.
|
||||||
AddLegalizedOperand(Op, Result);
|
AddLegalizedOperand(Op.getValue(0), Result);
|
||||||
|
if (Node->getNumValues() == 2) // If this has a flag result, remember it.
|
||||||
|
AddLegalizedOperand(Op.getValue(1), Result.getValue(1));
|
||||||
|
|
||||||
// Now that the callseq_start and all of the non-call nodes above this call
|
// Now that the callseq_start and all of the non-call nodes above this call
|
||||||
// sequence have been legalized, legalize the call itself. During this
|
// sequence have been legalized, legalize the call itself. During this
|
||||||
@@ -778,10 +780,15 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
Result = DAG.UpdateNodeOperands(Result, Ops);
|
Result = DAG.UpdateNodeOperands(Result, Ops);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(IsLegalizingCall && "imbalance between START/END?");
|
assert(IsLegalizingCall && "Call sequence imbalance between start/end?");
|
||||||
// This finishes up call legalization.
|
// This finishes up call legalization.
|
||||||
IsLegalizingCall = false;
|
IsLegalizingCall = false;
|
||||||
break;
|
|
||||||
|
// If the CALLSEQ_END node has a flag, remember that we legalized it.
|
||||||
|
AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
|
||||||
|
if (Node->getNumValues() == 2)
|
||||||
|
AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
|
||||||
|
return Result.getValue(Op.ResNo);
|
||||||
case ISD::DYNAMIC_STACKALLOC: {
|
case ISD::DYNAMIC_STACKALLOC: {
|
||||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||||
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
|
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the size.
|
||||||
|
Reference in New Issue
Block a user