[llvm-commits] [llvm] r62127 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/X86/

Devang Patel dpatel at apple.com
Mon Jan 12 16:35:13 PST 2009


Author: dpatel
Date: Mon Jan 12 18:35:13 2009
New Revision: 62127

URL: http://llvm.org/viewvc/llvm-project?rev=62127&view=rev
Log:

Use DebugInfo interface to lower dbg_* intrinsics.


Modified:
    llvm/trunk/include/llvm/CodeGen/FastISel.h
    llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
    llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
    llvm/trunk/include/llvm/Target/TargetLowering.h
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
    llvm/trunk/lib/Target/X86/X86FastISel.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.h

Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/FastISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/FastISel.h Mon Jan 12 18:35:13 2009
@@ -28,6 +28,7 @@
 class MachineFunction;
 class MachineFrameInfo;
 class MachineModuleInfo;
+class DwarfWriter;
 class MachineRegisterInfo;
 class TargetData;
 class TargetInstrInfo;
@@ -50,6 +51,7 @@
 #endif
   MachineFunction &MF;
   MachineModuleInfo *MMI;
+  DwarfWriter *DW;
   MachineRegisterInfo &MRI;
   MachineFrameInfo &MFI;
   MachineConstantPool &MCP;
@@ -115,6 +117,7 @@
 protected:
   FastISel(MachineFunction &mf,
            MachineModuleInfo *mmi,
+           DwarfWriter *dw,
            DenseMap<const Value *, unsigned> &vm,
            DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
            DenseMap<const AllocaInst *, int> &am

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Jan 12 18:35:13 2009
@@ -136,6 +136,7 @@
   TargetLowering &getTargetLoweringInfo() const { return TLI; }
   FunctionLoweringInfo &getFunctionLoweringInfo() const { return FLI; }
   MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
+  DwarfWriter *getDwarfWriter() const { return DW; }
 
   /// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
   ///
@@ -312,7 +313,7 @@
   SDValue getValueType(MVT);
   SDValue getRegister(unsigned Reg, MVT VT);
   SDValue getDbgStopPoint(SDValue Root, unsigned Line, unsigned Col,
-                            const CompileUnitDesc *CU);
+                          Value *CU);
   SDValue getLabel(unsigned Opcode, SDValue Root, unsigned LabelID);
 
   SDValue getCopyToReg(SDValue Chain, unsigned Reg, SDValue N) {

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Jan 12 18:35:13 2009
@@ -29,6 +29,7 @@
   class MachineFunction;
   class MachineInstr;
   class MachineModuleInfo;
+  class DwarfWriter;
   class TargetLowering;
   class TargetInstrInfo;
   class FunctionLoweringInfo;
@@ -110,6 +111,7 @@
 private:
   void SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
                             MachineModuleInfo *MMI,
+                            DwarfWriter *DW,
                             const TargetInstrInfo &TII);
   void FinishBasicBlock();
 

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 12 18:35:13 2009
@@ -39,7 +39,7 @@
 class MachineBasicBlock;
 class MachineConstantPoolValue;
 class SDNode;
-class CompileUnitDesc;
+class Value;
 template <typename T> struct DenseMapInfo;
 template <typename T> struct simplify_type;
 template <typename T> struct ilist_traits;
@@ -586,7 +586,7 @@
 
     // DBG_STOPPOINT - This node is used to represent a source location for
     // debug info.  It takes token chain as input, and carries a line number,
-    // column number, and a pointer to a CompileUnitDesc object identifying
+    // column number, and a pointer to a CompileUnit object identifying
     // the containing compilation unit.  It produces a token chain as output.
     DBG_STOPPOINT,
     
@@ -1981,12 +1981,12 @@
   SDUse Chain;
   unsigned Line;
   unsigned Column;
-  const CompileUnitDesc *CU;
+  Value *CU;
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
   DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c,
-                     const CompileUnitDesc *cu)
+                     Value *cu)
     : SDNode(ISD::DBG_STOPPOINT, getSDVTList(MVT::Other)),
       Line(l), Column(c), CU(cu) {
     Chain = ch;
@@ -1995,7 +1995,7 @@
 public:
   unsigned getLine() const { return Line; }
   unsigned getColumn() const { return Column; }
-  const CompileUnitDesc *getCompileUnit() const { return CU; }
+  Value *getCompileUnit() const { return CU; }
 
   static bool classof(const DbgStopPointSDNode *) { return true; }
   static bool classof(const SDNode *N) {

Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Jan 12 18:35:13 2009
@@ -43,6 +43,7 @@
   class MachineFrameInfo;
   class MachineInstr;
   class MachineModuleInfo;
+  class DwarfWriter;
   class SDNode;
   class SDValue;
   class SelectionDAG;
@@ -1199,7 +1200,7 @@
   /// or null if the target does not support "fast" ISel.
   virtual FastISel *
   createFastISel(MachineFunction &,
-                 MachineModuleInfo *,
+                 MachineModuleInfo *, DwarfWriter *,
                  DenseMap<const Value *, unsigned> &,
                  DenseMap<const BasicBlock *, MachineBasicBlock *> &,
                  DenseMap<const AllocaInst *, int> &

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jan 12 18:35:13 2009
@@ -47,6 +47,8 @@
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/DwarfWriter.h"
+#include "llvm/Analysis/DebugInfo.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetLowering.h"
@@ -315,14 +317,13 @@
   default: break;
   case Intrinsic::dbg_stoppoint: {
     DbgStopPointInst *SPI = cast<DbgStopPointInst>(I);
-    if (MMI && SPI->getContext() && MMI->Verify(SPI->getContext())) {
-      DebugInfoDesc *DD = MMI->getDescFor(SPI->getContext());
-      assert(DD && "Not a debug information descriptor");
-      const CompileUnitDesc *CompileUnit = cast<CompileUnitDesc>(DD);
-      unsigned SrcFile = MMI->RecordSource(CompileUnit);
+    if (DW && SPI->getContext()) {
+      DICompileUnit CU(cast<GlobalVariable>(SPI->getContext()));
+      unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
+                                          CU.getFilename());
       unsigned Line = SPI->getLine();
       unsigned Col = SPI->getColumn();
-      unsigned ID = MMI->RecordSourceLine(Line, Col, SrcFile);
+      unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile);
       const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
       BuildMI(MBB, II).addImm(ID);
     }
@@ -330,8 +331,9 @@
   }
   case Intrinsic::dbg_region_start: {
     DbgRegionStartInst *RSI = cast<DbgRegionStartInst>(I);
-    if (MMI && RSI->getContext() && MMI->Verify(RSI->getContext())) {
-      unsigned ID = MMI->RecordRegionStart(RSI->getContext());
+    if (DW && RSI->getContext()) {
+      unsigned ID = 
+        DW->RecordRegionStart(cast<GlobalVariable>(RSI->getContext()));
       const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
       BuildMI(MBB, II).addImm(ID);
     }
@@ -339,30 +341,31 @@
   }
   case Intrinsic::dbg_region_end: {
     DbgRegionEndInst *REI = cast<DbgRegionEndInst>(I);
-    if (MMI && REI->getContext() && MMI->Verify(REI->getContext())) {
-      unsigned ID = MMI->RecordRegionEnd(REI->getContext());
+    if (DW && REI->getContext()) {
+      unsigned ID = 
+        DW->RecordRegionEnd(cast<GlobalVariable>(REI->getContext()));
       const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
       BuildMI(MBB, II).addImm(ID);
     }
     return true;
   }
   case Intrinsic::dbg_func_start: {
-    if (!MMI) return true;
+    if (!DW) return true;
     DbgFuncStartInst *FSI = cast<DbgFuncStartInst>(I);
     Value *SP = FSI->getSubprogram();
-    if (SP && MMI->Verify(SP)) {
+    if (SP) {
       // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is
       // what (most?) gdb expects.
-      DebugInfoDesc *DD = MMI->getDescFor(SP);
-      assert(DD && "Not a debug information descriptor");
-      SubprogramDesc *Subprogram = cast<SubprogramDesc>(DD);
-      const CompileUnitDesc *CompileUnit = Subprogram->getFile();
-      unsigned SrcFile = MMI->RecordSource(CompileUnit);
+      DISubprogram Subprogram(cast<GlobalVariable>(SP));
+      DICompileUnit CompileUnit = Subprogram.getCompileUnit();
+      unsigned SrcFile = DW->RecordSource(CompileUnit.getDirectory(),
+                                          CompileUnit.getFilename());
       // Record the source line but does not create a label for the normal
       // function start. It will be emitted at asm emission time. However,
       // create a label if this is a beginning of inlined function.
-      unsigned LabelID = MMI->RecordSourceLine(Subprogram->getLine(), 0, SrcFile);
-      if (MMI->getSourceLines().size() != 1) {
+      unsigned LabelID = 
+        DW->RecordSourceLine(Subprogram.getLineNumber(), 0, SrcFile);
+      if (DW->getRecordSourceLineCount() != 1) {
         const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
         BuildMI(MBB, II).addImm(LabelID);
       }
@@ -372,7 +375,7 @@
   case Intrinsic::dbg_declare: {
     DbgDeclareInst *DI = cast<DbgDeclareInst>(I);
     Value *Variable = DI->getVariable();
-    if (MMI && Variable && MMI->Verify(Variable)) {
+    if (DW && Variable) {
       // Determine the address of the declared object.
       Value *Address = DI->getAddress();
       if (BitCastInst *BCI = dyn_cast<BitCastInst>(Address))
@@ -682,6 +685,7 @@
 
 FastISel::FastISel(MachineFunction &mf,
                    MachineModuleInfo *mmi,
+                   DwarfWriter *dw,
                    DenseMap<const Value *, unsigned> &vm,
                    DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
                    DenseMap<const AllocaInst *, int> &am
@@ -698,6 +702,7 @@
 #endif
     MF(mf),
     MMI(mmi),
+    DW(dw),
     MRI(MF.getRegInfo()),
     MFI(*MF.getFrameInfo()),
     MCP(*MF.getConstantPool()),

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jan 12 18:35:13 2009
@@ -16,6 +16,8 @@
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineJumpTableInfo.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/DwarfWriter.h"
+#include "llvm/Analysis/DebugInfo.h"
 #include "llvm/CodeGen/PseudoSourceValue.h"
 #include "llvm/Target/TargetFrameInfo.h"
 #include "llvm/Target/TargetLowering.h"
@@ -26,6 +28,7 @@
 #include "llvm/CallingConv.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
+#include "llvm/GlobalVariable.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
@@ -1258,15 +1261,17 @@
     case TargetLowering::Promote:
     default: assert(0 && "This action is not supported yet!");
     case TargetLowering::Expand: {
-      MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+      DwarfWriter *DW = DAG.getDwarfWriter();
       bool useDEBUG_LOC = TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other);
       bool useLABEL = TLI.isOperationLegal(ISD::DBG_LABEL, MVT::Other);
       
       const DbgStopPointSDNode *DSP = cast<DbgStopPointSDNode>(Node);
-      if (MMI && (useDEBUG_LOC || useLABEL)) {
-        const CompileUnitDesc *CompileUnit = DSP->getCompileUnit();
-        unsigned SrcFile = MMI->RecordSource(CompileUnit);
-
+      GlobalVariable *CU_GV = cast<GlobalVariable>(DSP->getCompileUnit());
+      if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) {
+        DICompileUnit CU(cast<GlobalVariable>(DSP->getCompileUnit()));
+        unsigned SrcFile = DW->RecordSource(CU.getDirectory(),
+                                            CU.getFilename());
+        
         unsigned Line = DSP->getLine();
         unsigned Col = DSP->getColumn();
         
@@ -1276,7 +1281,7 @@
                               DAG.getConstant(SrcFile, MVT::i32) };
           Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops, 4);
         } else {
-          unsigned ID = MMI->RecordSourceLine(Line, Col, SrcFile);
+          unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile);
           Result = DAG.getLabel(ISD::DBG_LABEL, Tmp1, ID);
         }
       } else {

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jan 12 18:35:13 2009
@@ -1137,8 +1137,8 @@
 }
 
 SDValue SelectionDAG::getDbgStopPoint(SDValue Root,
-                                        unsigned Line, unsigned Col,
-                                        const CompileUnitDesc *CU) {
+                                      unsigned Line, unsigned Col,
+                                      Value *CU) {
   SDNode *N = NodeAllocator.Allocate<DbgStopPointSDNode>();
   new (N) DbgStopPointSDNode(Root, Line, Col, CU);
   AllNodes.push_back(N);

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Jan 12 18:35:13 2009
@@ -37,6 +37,8 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/PseudoSourceValue.h"
 #include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/CodeGen/DwarfWriter.h"
+#include "llvm/Analysis/DebugInfo.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetFrameInfo.h"
@@ -3742,67 +3744,65 @@
     return 0;
   }
   case Intrinsic::dbg_stoppoint: {
-    MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+    DwarfWriter *DW = DAG.getDwarfWriter();
     DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
-    if (MMI && SPI.getContext() && MMI->Verify(SPI.getContext())) {
-      DebugInfoDesc *DD = MMI->getDescFor(SPI.getContext());
-      assert(DD && "Not a debug information descriptor");
+    if (DW && SPI.getContext())
       DAG.setRoot(DAG.getDbgStopPoint(getRoot(),
                                       SPI.getLine(),
                                       SPI.getColumn(),
-                                      cast<CompileUnitDesc>(DD)));
-    }
-
+                                      SPI.getContext()));
     return 0;
   }
   case Intrinsic::dbg_region_start: {
-    MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+    DwarfWriter *DW = DAG.getDwarfWriter();
     DbgRegionStartInst &RSI = cast<DbgRegionStartInst>(I);
-    if (MMI && RSI.getContext() && MMI->Verify(RSI.getContext())) {
-      unsigned LabelID = MMI->RecordRegionStart(RSI.getContext());
+    if (DW && RSI.getContext()) {
+      unsigned LabelID = 
+        DW->RecordRegionStart(cast<GlobalVariable>(RSI.getContext()));
       DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID));
     }
 
     return 0;
   }
   case Intrinsic::dbg_region_end: {
-    MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+    DwarfWriter *DW = DAG.getDwarfWriter();
     DbgRegionEndInst &REI = cast<DbgRegionEndInst>(I);
-    if (MMI && REI.getContext() && MMI->Verify(REI.getContext())) {
-      unsigned LabelID = MMI->RecordRegionEnd(REI.getContext());
+    if (DW && REI.getContext()) {
+      unsigned LabelID = 
+        DW->RecordRegionEnd(cast<GlobalVariable>(REI.getContext()));
       DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID));
     }
 
     return 0;
   }
   case Intrinsic::dbg_func_start: {
-    MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
-    if (!MMI) return 0;
+    DwarfWriter *DW = DAG.getDwarfWriter();
+    if (!DW) return 0;
     DbgFuncStartInst &FSI = cast<DbgFuncStartInst>(I);
     Value *SP = FSI.getSubprogram();
-    if (SP && MMI->Verify(SP)) {
+    if (SP) {
       // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is
       // what (most?) gdb expects.
-      DebugInfoDesc *DD = MMI->getDescFor(SP);
-      assert(DD && "Not a debug information descriptor");
-      SubprogramDesc *Subprogram = cast<SubprogramDesc>(DD);
-      const CompileUnitDesc *CompileUnit = Subprogram->getFile();
-      unsigned SrcFile = MMI->RecordSource(CompileUnit);
+      DISubprogram Subprogram(cast<GlobalVariable>(SP));
+      DICompileUnit CompileUnit = Subprogram.getCompileUnit();
+      unsigned SrcFile = DW->RecordSource(CompileUnit.getDirectory(),
+                                          CompileUnit.getFilename());
       // Record the source line but does not create a label for the normal
       // function start. It will be emitted at asm emission time. However,
       // create a label if this is a beginning of inlined function.
-      unsigned LabelID = MMI->RecordSourceLine(Subprogram->getLine(), 0, SrcFile);
-      if (MMI->getSourceLines().size() != 1)
+      unsigned LabelID = 
+        DW->RecordSourceLine(Subprogram.getLineNumber(), 0, SrcFile);
+      if (DW->getRecordSourceLineCount() != 1)
         DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID));
     }
 
     return 0;
   }
   case Intrinsic::dbg_declare: {
-    MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+    DwarfWriter *DW = DAG.getDwarfWriter();
     DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
     Value *Variable = DI.getVariable();
-    if (MMI && Variable && MMI->Verify(Variable))
+    if (DW && Variable)
       DAG.setRoot(DAG.getNode(ISD::DECLARE, MVT::Other, getRoot(),
                               getValue(DI.getAddress()), getValue(Variable)));
     return 0;

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 12 18:35:13 2009
@@ -327,7 +327,7 @@
       // Mark landing pad.
       FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
 
-  SelectAllBasicBlocks(Fn, MF, MMI, TII);
+  SelectAllBasicBlocks(Fn, MF, MMI, DW, TII);
 
   // If the first basic block in the function has live ins that need to be
   // copied into vregs, emit the copies into the top of the block before
@@ -696,11 +696,12 @@
 
 void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
                                             MachineModuleInfo *MMI,
+                                            DwarfWriter *DW,
                                             const TargetInstrInfo &TII) {
   // Initialize the Fast-ISel state, if needed.
   FastISel *FastIS = 0;
   if (EnableFastISel)
-    FastIS = TLI.createFastISel(*FuncInfo->MF, MMI,
+    FastIS = TLI.createFastISel(*FuncInfo->MF, MMI, DW,
                                 FuncInfo->ValueMap,
                                 FuncInfo->MBBMap,
                                 FuncInfo->StaticAllocaMap

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Mon Jan 12 18:35:13 2009
@@ -20,6 +20,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/Analysis/DebugInfo.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/Debug.h"
@@ -177,7 +178,8 @@
       Op += " #" + utostr(R->getReg());
     }
   } else if (const DbgStopPointSDNode *D = dyn_cast<DbgStopPointSDNode>(Node)) {
-    Op += ": " + D->getCompileUnit()->getFileName();
+    DICompileUnit CU(cast<GlobalVariable>(D->getCompileUnit()));
+    Op += ": " + CU.getFilename();
     Op += ":" + utostr(D->getLine());
     if (D->getColumn() != 0)
       Op += ":" + utostr(D->getColumn());

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Jan 12 18:35:13 2009
@@ -51,6 +51,7 @@
 public:
   explicit X86FastISel(MachineFunction &mf,
                        MachineModuleInfo *mmi,
+                       DwarfWriter *dw,
                        DenseMap<const Value *, unsigned> &vm,
                        DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
                        DenseMap<const AllocaInst *, int> &am
@@ -58,7 +59,7 @@
                        , SmallSet<Instruction*, 8> &cil
 #endif
                        )
-    : FastISel(mf, mmi, vm, bm, am
+    : FastISel(mf, mmi, dw, vm, bm, am
 #ifndef NDEBUG
                , cil
 #endif
@@ -1512,6 +1513,7 @@
 namespace llvm {
   llvm::FastISel *X86::createFastISel(MachineFunction &mf,
                         MachineModuleInfo *mmi,
+                        DwarfWriter *dw,
                         DenseMap<const Value *, unsigned> &vm,
                         DenseMap<const BasicBlock *, MachineBasicBlock *> &bm,
                         DenseMap<const AllocaInst *, int> &am
@@ -1519,7 +1521,7 @@
                         , SmallSet<Instruction*, 8> &cil
 #endif
                         ) {
-    return new X86FastISel(mf, mmi, vm, bm, am
+    return new X86FastISel(mf, mmi, dw, vm, bm, am
 #ifndef NDEBUG
                            , cil
 #endif

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jan 12 18:35:13 2009
@@ -1923,6 +1923,7 @@
 FastISel *
 X86TargetLowering::createFastISel(MachineFunction &mf,
                                   MachineModuleInfo *mmo,
+                                  DwarfWriter *dw,
                                   DenseMap<const Value *, unsigned> &vm,
                                   DenseMap<const BasicBlock *,
                                            MachineBasicBlock *> &bm,
@@ -1931,7 +1932,7 @@
                                   , SmallSet<Instruction*, 8> &cil
 #endif
                                   ) {
-  return X86::createFastISel(mf, mmo, vm, bm, am
+  return X86::createFastISel(mf, mmo, dw, vm, bm, am
 #ifndef NDEBUG
                              , cil
 #endif

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=62127&r1=62126&r2=62127&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Jan 12 18:35:13 2009
@@ -505,7 +505,7 @@
     /// or null if the target does not support "fast" ISel.
     virtual FastISel *
     createFastISel(MachineFunction &mf,
-                   MachineModuleInfo *mmi,
+                   MachineModuleInfo *mmi, DwarfWriter *dw,
                    DenseMap<const Value *, unsigned> &,
                    DenseMap<const BasicBlock *, MachineBasicBlock *> &,
                    DenseMap<const AllocaInst *, int> &
@@ -658,7 +658,7 @@
 
   namespace X86 {
     FastISel *createFastISel(MachineFunction &mf,
-                           MachineModuleInfo *mmi,
+                           MachineModuleInfo *mmi, DwarfWriter *dw,
                            DenseMap<const Value *, unsigned> &,
                            DenseMap<const BasicBlock *, MachineBasicBlock *> &,
                            DenseMap<const AllocaInst *, int> &





More information about the llvm-commits mailing list