[llvm-commits] [llvm] r58814 - in /llvm/trunk: lib/CodeGen/SelectionDAG/FastISel.cpp test/DebugInfo/2008-11-05-InlinedFuncStart.ll

Devang Patel dpatel at apple.com
Thu Nov 6 13:28:21 PST 2008


Author: dpatel
Date: Thu Nov  6 15:28:20 2008
New Revision: 58814

URL: http://llvm.org/viewvc/llvm-project?rev=58814&view=rev
Log:
Emit label for llvm.dbg.func.start of the inlined function.


Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
    llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Nov  6 15:28:20 2008
@@ -349,9 +349,14 @@
       SubprogramDesc *Subprogram = cast<SubprogramDesc>(DD);
       const CompileUnitDesc *CompileUnit = Subprogram->getFile();
       unsigned SrcFile = MMI->RecordSource(CompileUnit);
-      // Record the source line but does create a label. It will be emitted
-      // at asm emission time.
-      MMI->RecordSourceLine(Subprogram->getLine(), 0, SrcFile);
+      // 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) {
+        const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
+        BuildMI(MBB, II).addImm(LabelID);
+      }
     }
     return true;
   }

Modified: llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll?rev=58814&r1=58813&r2=58814&view=diff

==============================================================================
--- llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll (original)
+++ llvm/trunk/test/DebugInfo/2008-11-05-InlinedFuncStart.ll Thu Nov  6 15:28:20 2008
@@ -1,4 +1,5 @@
 ; RUN: llvm-as < %s | llc
+; RUN: llvm-as < %s | llc -fast
 	%llvm.dbg.anchor.type = type { i32, i32 }
 	%llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
 	%llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }





More information about the llvm-commits mailing list