Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 7 May 2009 00:16:31 +0000 (00:16 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 7 May 2009 00:16:31 +0000 (00:16 +0000)
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71132 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/DwarfWriter.h
lib/CodeGen/AsmPrinter/DwarfWriter.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

index 8e680e3e113078eab15e06d7637b7566dd6b0475..facd5f6e6a5fff34d90c85ae36f52a40017c7b71 100644 (file)
@@ -106,11 +106,11 @@ public:
   bool ShouldEmitDwarfDebug() const;
 
   //// RecordInlinedFnStart - Indicate the start of a inlined function.
-  void RecordInlinedFnStart(Instruction *I, DISubprogram &SP, unsigned LabelID,
-                            DICompileUnit CU, unsigned Line, unsigned Col);
+  unsigned RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU,
+                                unsigned Line, unsigned Col);
 
   /// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
-  unsigned RecordInlinedFnEnd(DISubprogram &SP);
+  unsigned RecordInlinedFnEnd(DISubprogram SP);
 
   /// RecordVariableScope - Record scope for the variable declared by
   /// DeclareMI. DeclareMI must describe TargetInstrInfo::DECLARE.
index f12bcd38cb3c3e2e4e74d27bf778a0f61e338057..cb53168b415f4a2f5556bae9763dbb0c064949c7 100644 (file)
@@ -3487,10 +3487,12 @@ public:
   }
 
   //// RecordInlinedFnStart - Indicate the start of inlined subroutine.
-  void RecordInlinedFnStart(Instruction *FSI, DISubprogram &SP, unsigned LabelID,
-                            DICompileUnit CU, unsigned Line, unsigned Col) {
+  unsigned RecordInlinedFnStart(DISubprogram &SP, DICompileUnit CU,
+                                unsigned Line, unsigned Col) {
+    unsigned LabelID = MMI->NextLabelID();
+
     if (!TAI->doesDwarfUsesInlineInfoSection())
-      return;
+      return LabelID;
 
     if (TimePassesIsEnabled)
       DebugTimer->startTimer();
@@ -3520,6 +3522,8 @@ public:
 
     if (TimePassesIsEnabled)
       DebugTimer->stopTimer();
+
+    return LabelID;
   }
 
   /// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
@@ -4749,14 +4753,13 @@ bool DwarfWriter::ShouldEmitDwarfDebug() const {
 
 //// RecordInlinedFnStart - Global variable GV is inlined at the location marked
 //// by LabelID label.
-void DwarfWriter::RecordInlinedFnStart(Instruction *I, DISubprogram &SP, 
-                                       unsigned LabelID, DICompileUnit CU,
-                                       unsigned Line, unsigned Col) {
-  DD->RecordInlinedFnStart(I, SP, LabelID, CU, Line, Col);
+unsigned DwarfWriter::RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU,
+                                           unsigned Line, unsigned Col) {
+  return DD->RecordInlinedFnStart(SP, CU, Line, Col);
 }
 
 /// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
-unsigned DwarfWriter::RecordInlinedFnEnd(DISubprogram &SP) {
+unsigned DwarfWriter::RecordInlinedFnEnd(DISubprogram SP) {
   return DD->RecordInlinedFnEnd(SP);
 }
 
index f7100515b2840cf7246fbeaaf546db9c146dffa1..22051867a001ba81d81debb9ab78e63acb53d1b9 100644 (file)
@@ -397,14 +397,13 @@ bool FastISel::SelectCall(User *I) {
                                               CompileUnit.getGV(), Line, 0)));
 
       if (DW && DW->ShouldEmitDwarfDebug()) {
-        unsigned LabelID = MMI->NextLabelID();
+        DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
+        unsigned LabelID = DW->RecordInlinedFnStart(Subprogram,
+                                          DICompileUnit(PrevLocTpl.CompileUnit),
+                                          PrevLocTpl.Line,
+                                          PrevLocTpl.Col);
         const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
         BuildMI(MBB, DL, II).addImm(LabelID);
-        DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
-        DW->RecordInlinedFnStart(FSI, Subprogram, LabelID,
-                                 DICompileUnit(PrevLocTpl.CompileUnit),
-                                 PrevLocTpl.Line,
-                                 PrevLocTpl.Col);
       }
     } else {
       // Record the source line.
index a91dd8e7156bc2d93ddd4864465ba763914a8cbe..fd89108392cebaa3182a1cf573a2ead2d02d3b22 100644 (file)
@@ -3981,14 +3981,13 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
                      MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0)));
 
         if (DW && DW->ShouldEmitDwarfDebug()) {
-          unsigned LabelID = DAG.getMachineModuleInfo()->NextLabelID();
+          DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
+          unsigned LabelID = DW->RecordInlinedFnStart(Subprogram,
+                                          DICompileUnit(PrevLocTpl.CompileUnit),
+                                          PrevLocTpl.Line,
+                                          PrevLocTpl.Col);
           DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
                                    getRoot(), LabelID));
-          DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
-          DW->RecordInlinedFnStart(&FSI, Subprogram, LabelID,
-                                   DICompileUnit(PrevLocTpl.CompileUnit),
-                                   PrevLocTpl.Line,
-                                   PrevLocTpl.Col);
         }
       } else {
         // Record the source line.