Update processDebugLoc() to handle requests to process debug info, before and after...
authorDevang Patel <dpatel@apple.com>
Tue, 6 Oct 2009 03:04:58 +0000 (03:04 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 6 Oct 2009 03:04:58 +0000 (03:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83364 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index 85483564eb5c36cfe5ae793918fff4bea2dd5faa..e8314a1d86606a2f4265b730603db2cb5975a185 100644 (file)
@@ -597,7 +597,7 @@ namespace {
     /// MachineRelocations that reference external functions by name.
     const StringMap<void*> &getExternalFnStubs() const { return ExtFnStubs; }
     
-    virtual void processDebugLoc(DebugLoc DL);
+    virtual void processDebugLoc(DebugLoc DL, bool BeforePrintingInsn);
 
     virtual void emitLabel(uint64_t LabelID) {
       if (LabelLocations.size() <= LabelID)
@@ -708,18 +708,20 @@ void JITEmitter::AddStubToCurrentFunction(void *StubAddr) {
   FnRefs.insert(CurFn);
 }
 
-void JITEmitter::processDebugLoc(DebugLoc DL) {
+void JITEmitter::processDebugLoc(DebugLoc DL, bool BeforePrintingInsn) {
   if (!DL.isUnknown()) {
     DebugLocTuple CurDLT = EmissionDetails.MF->getDebugLocTuple(DL);
 
-    if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT) {
-      JITEvent_EmittedFunctionDetails::LineStart NextLine;
-      NextLine.Address = getCurrentPCValue();
-      NextLine.Loc = DL;
-      EmissionDetails.LineStarts.push_back(NextLine);
+    if (BeforePrintingInsn) {
+      if (CurDLT.CompileUnit != 0 && PrevDLT != CurDLT) {
+        JITEvent_EmittedFunctionDetails::LineStart NextLine;
+        NextLine.Address = getCurrentPCValue();
+        NextLine.Loc = DL;
+        EmissionDetails.LineStarts.push_back(NextLine);
+      }
+  
+      PrevDLT = CurDLT;
     }
-
-    PrevDLT = CurDLT;
   }
 }