parent
3b8af41a3e
commit
83cce8e7ab
|
@ -253,13 +253,15 @@ void SelectionDAGLegalize::LegalizeDAG() {
|
||||||
/// FindCallEndFromCallStart - Given a chained node that is part of a call
|
/// FindCallEndFromCallStart - Given a chained node that is part of a call
|
||||||
/// sequence, find the CALLSEQ_END node that terminates the call sequence.
|
/// sequence, find the CALLSEQ_END node that terminates the call sequence.
|
||||||
static SDNode *FindCallEndFromCallStart(SDNode *Node, int depth = 0) {
|
static SDNode *FindCallEndFromCallStart(SDNode *Node, int depth = 0) {
|
||||||
|
// Nested CALLSEQ_START/END constructs aren't yet legal,
|
||||||
|
// but we can DTRT and handle them correctly here.
|
||||||
if (Node->getOpcode() == ISD::CALLSEQ_START)
|
if (Node->getOpcode() == ISD::CALLSEQ_START)
|
||||||
depth++;
|
depth++;
|
||||||
else if (Node->getOpcode() == ISD::CALLSEQ_END) {
|
else if (Node->getOpcode() == ISD::CALLSEQ_END) {
|
||||||
depth--;
|
depth--;
|
||||||
if (depth == 0)
|
if (depth == 0)
|
||||||
return Node;
|
return Node;
|
||||||
}
|
}
|
||||||
if (Node->use_empty())
|
if (Node->use_empty())
|
||||||
return 0; // No CallSeqEnd
|
return 0; // No CallSeqEnd
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue