aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2010-12-21 17:07:24 +0000
committerStuart Hastings <stuart@apple.com>2010-12-21 17:07:24 +0000
commit2965e69e040d86002128b91a439eb9bfc6b83df1 (patch)
tree5dee656b84ba53c99f30c8c1b421486953ac2566 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent4d75d80d62f52ce440e6af7821d785ab49f30ea7 (diff)
downloadexternal_llvm-2965e69e040d86002128b91a439eb9bfc6b83df1.zip
external_llvm-2965e69e040d86002128b91a439eb9bfc6b83df1.tar.gz
external_llvm-2965e69e040d86002128b91a439eb9bfc6b83df1.tar.bz2
Missing logic for nested CALLSEQ_START/END.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 661a7ad..a60b871 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -255,8 +255,11 @@ void SelectionDAGLegalize::LegalizeDAG() {
static SDNode *FindCallEndFromCallStart(SDNode *Node, int depth = 0) {
if (Node->getOpcode() == ISD::CALLSEQ_START)
depth++;
- if ((Node->getOpcode() == ISD::CALLSEQ_END) && (depth == 1))
- return Node;
+ else if (Node->getOpcode() == ISD::CALLSEQ_END) {
+ depth--;
+ if (depth == 0)
+ return Node;
+ }
if (Node->use_empty())
return 0; // No CallSeqEnd