[llvm-commits] [llvm] r100461 - /llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp

Jeffrey Yasskin jyasskin at google.com
Mon Apr 5 14:09:12 PDT 2010


Author: jyasskin
Date: Mon Apr  5 16:09:12 2010
New Revision: 100461

URL: http://llvm.org/viewvc/llvm-project?rev=100461&view=rev
Log:
Fix OProfileJITEventListener build for new DebugLoc.

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

Modified: llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp?rev=100461&r1=100460&r2=100461&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp Mon Apr  5 16:09:12 2010
@@ -19,6 +19,7 @@
 #define DEBUG_TYPE "oprofile-jit-event-listener"
 #include "llvm/Function.h"
 #include "llvm/Metadata.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/Analysis/DebugInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/ExecutionEngine/JITEventListener.h"
@@ -77,10 +78,10 @@
   DenseMap<AssertingVH<MDNode>, std::string> Filenames;
 
  public:
-  const char *getFilename(DIScope Scope) {
-    std::string &Filename = Filenames[Scope.getNode()];
+  const char *getFilename(MDNode *Scope) {
+    std::string &Filename = Filenames[Scope];
     if (Filename.empty()) {
-      Filename = Scope.getFilename();
+      Filename = DIScope(Scope).getFilename();
     }
     return Filename.c_str();
   }
@@ -91,9 +92,9 @@
     uintptr_t Address, DebugLoc Loc) {
   debug_line_info Result;
   Result.vma = Address;
-  DILocation DILoc = MF.getDILocation(Loc);
-  Result.lineno = DILoc.getLineNumber();
-  Result.filename = Filenames.getFilename(DILoc.getScope());
+  Result.lineno = Loc.getLine();
+  Result.filename = Filenames.getFilename(
+    Loc.getScope(MF.getFunction()->getContext()));
   DEBUG(dbgs() << "Mapping " << reinterpret_cast<void*>(Result.vma) << " to "
                << Result.filename << ":" << Result.lineno << "\n");
   return Result;





More information about the llvm-commits mailing list