[llvm-commits] [llvm] r74677 - in /llvm/trunk/lib/CodeGen/SelectionDAG: FastISel.cpp SelectionDAGBuild.cpp

Devang Patel dpatel at apple.com
Wed Jul 1 17:28:04 PDT 2009


Author: dpatel
Date: Wed Jul  1 19:28:03 2009
New Revision: 74677

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

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul  1 19:28:03 2009
@@ -376,24 +376,24 @@
     if (!DIDescriptor::ValidDebugInfo(SP, CodeGenOpt::None))
       return true;
 
-    // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is what
-    // (most?) gdb expects.
-    DebugLoc PrevLoc = DL;
     DISubprogram Subprogram(cast<GlobalVariable>(SP));
     DICompileUnit CompileUnit = Subprogram.getCompileUnit();
+    unsigned Line = Subprogram.getLineNumber();
 
+    // If this subprogram does not describe current function then this is
+    // beginning of a inlined function.
     if (!Subprogram.describes(MF.getFunction())) {
       // This is a beginning of an inlined function.
 
       // If llvm.dbg.func.start is seen in a new block before any
       // llvm.dbg.stoppoint intrinsic then the location info is unknown.
       // FIXME : Why DebugLoc is reset at the beginning of each block ?
+      DebugLoc PrevLoc = DL;
       if (PrevLoc.isUnknown())
         return true;
       // Record the source line.
-      unsigned Line = Subprogram.getLineNumber();
-      setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
-                                              CompileUnit.getGV(), Line, 0)));
+      unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
+      setCurDebugLoc(DebugLoc::get(LocID));
 
       if (DW && DW->ShouldEmitDwarfDebug()) {
         DebugLocTuple PrevLocTpl = MF.getDebugLocTuple(PrevLoc);
@@ -404,17 +404,18 @@
         const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
         BuildMI(MBB, DL, II).addImm(LabelID);
       }
-    } else {
-      // Record the source line.
-      unsigned Line = Subprogram.getLineNumber();
-      MF.setDefaultDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
-                                              CompileUnit.getGV(), Line, 0)));
-      if (DW && DW->ShouldEmitDwarfDebug()) {
-        // llvm.dbg.func_start also defines beginning of function scope.
-        DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram()));
-      }
+      return true;
     }
-
+     
+    // This is a beginning of a new function.
+    // Record the source line.
+    unsigned LocID = MF.getOrCreateDebugLocID(CompileUnit.getGV(), Line, 0);
+    MF.setDefaultDebugLoc(DebugLoc::get(LocID));
+
+    if (DW && DW->ShouldEmitDwarfDebug())
+      // llvm.dbg.func_start also defines beginning of function scope.
+      DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram()));
+    
     return true;
   }
   case Intrinsic::dbg_declare: {

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Wed Jul  1 19:28:03 2009
@@ -3962,7 +3962,6 @@
     MachineFunction &MF = DAG.getMachineFunction();
     // If this subprogram does not describe current function then this is
     // beginning of a inlined function.
-
     bool isInlinedFnStart = !Subprogram.describes(MF.getFunction());
     if (isInlinedFnStart && OptLevel != CodeGenOpt::None)
       // FIXME: Debugging informaation for inlined function is only





More information about the llvm-commits mailing list