[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Apr 1 19:22:56 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.66 -> 1.67
---
Log message:

Fix a bug when inserting a libcall into a function with no other calls.


---
Diffs of the changes:  (+4 -2)

 LegalizeDAG.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.66 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.67
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.66	Fri Apr  1 18:41:14 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri Apr  1 21:22:40 2005
@@ -1428,7 +1428,8 @@
 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 @@
   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) {






More information about the llvm-commits mailing list