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

Jim Laskey jlaskey at apple.com
Wed Jan 4 14:28:39 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.251 -> 1.252
SelectionDAGISel.cpp updated: 1.119 -> 1.120
---
Log message:

Applied some recommend changes from sabre.  The dominate one beginning "let the
pass manager do it's thing."  Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.


---
Diffs of the changes:  (+6 -5)

 LegalizeDAG.cpp      |    8 ++++----
 SelectionDAGISel.cpp |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.251 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.252
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.251	Wed Jan  4 09:04:11 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Wed Jan  4 16:28:25 2006
@@ -618,8 +618,8 @@
     case TargetLowering::Promote:
     default: assert(0 && "This action is not supported yet!");
     case TargetLowering::Expand: {
-      if (TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other)) {
-        MachineDebugInfo &DebugInfo = getMachineDebugInfo();
+      MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo();
+      if (TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other) && DebugInfo) {
         std::vector<SDOperand> Ops;
         Ops.push_back(Tmp1);  // chain
         Ops.push_back(Node->getOperand(1));  // line #
@@ -628,9 +628,9 @@
           cast<StringSDNode>(Node->getOperand(3))->getValue();
         const std::string &dirname = 
           cast<StringSDNode>(Node->getOperand(4))->getValue();
-        unsigned srcfile = DebugInfo.RecordSource(fname, dirname);
+        unsigned srcfile = DebugInfo->getUniqueSourceID(fname, dirname);
         Ops.push_back(DAG.getConstant(srcfile, MVT::i32));  // source file id
-        unsigned id = DebugInfo.NextUniqueID();
+        unsigned id = DebugInfo->getNextUniqueID();
         Ops.push_back(DAG.getConstant(id, MVT::i32));  // label id
         Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops);
       } else {


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.119 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.120
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.119	Wed Dec 21 13:36:36 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Wed Jan  4 16:28:25 2006
@@ -21,6 +21,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
 #include "llvm/CodeGen/IntrinsicLowering.h"
+#include "llvm/CodeGen/MachineDebugInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -1640,7 +1641,7 @@
 
 void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
                                         FunctionLoweringInfo &FuncInfo) {
-  SelectionDAG DAG(TLI, MF);
+  SelectionDAG DAG(TLI, MF, getAnalysisToUpdate<MachineDebugInfo>());
   CurDAG = &DAG;
   std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate;
 






More information about the llvm-commits mailing list