[llvm-commits] [llvm] r83364 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp

Devang Patel dpatel at apple.com
Mon Oct 5 20:04:59 PDT 2009


Author: dpatel
Date: Mon Oct  5 22:04:58 2009
New Revision: 83364

URL: http://llvm.org/viewvc/llvm-project?rev=83364&view=rev
Log:
Update processDebugLoc() to handle requests to process debug info, before and after emitting instructions.

Modified:
    llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp

Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=83364&r1=83363&r2=83364&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Oct  5 22:04:58 2009
@@ -597,7 +597,7 @@
     /// 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 @@
   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;
   }
 }
 





More information about the llvm-commits mailing list