diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-04-02 03:22:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-04-02 03:22:40 +0000 |
| commit | 07f97d5f558681f1b6d6e3f0eef07b6ec4cc2fdd (patch) | |
| tree | 67d59c8ebda92ad77ee8d6e7719c7b7869bb6edd /llvm/lib/CodeGen | |
| parent | 07e3f7e1ff631edc4077b2fa550eda4e03bb23f8 (diff) | |
| download | bcm5719-llvm-07f97d5f558681f1b6d6e3f0eef07b6ec4cc2fdd.tar.gz bcm5719-llvm-07f97d5f558681f1b6d6e3f0eef07b6ec4cc2fdd.zip | |
Fix a bug when inserting a libcall into a function with no other calls.
llvm-svn: 20999
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index f75d5f8a6a9..d1aae309d2f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1428,7 +1428,8 @@ static void FindEarliestAdjCallStackUp(SDNode *Node, SDNode *&Found) { static SDNode *FindAdjCallStackUp(SDNode *Node) { if (Node->getOpcode() == ISD::ADJCALLSTACKUP) return Node; - assert(!Node->use_empty() && "Could not find ADJCALLSTACKUP!"); + if (Node->use_empty()) + return 0; // No adjcallstackup if (Node->hasOneUse()) // Simple case, only has one user to check. return FindAdjCallStackUp(*Node->use_begin()); @@ -1484,7 +1485,8 @@ SDOperand SelectionDAGLegalize::ExpandLibCall(const char *Name, SDNode *Node, SDNode *OutChain; SDOperand InChain = FindInputOutputChains(Node, OutChain, DAG.getEntryNode()); - // TODO. Link in chains. + if (InChain.Val == 0) + InChain = DAG.getEntryNode(); TargetLowering::ArgListTy Args; for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) { |

