From: Jeffrey Yasskin Date: Mon, 5 Apr 2010 21:09:12 +0000 (+0000) Subject: Fix OProfileJITEventListener build for new DebugLoc. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=376ac434addd3b3652bf195c350463992e1df262;p=oota-llvm.git Fix OProfileJITEventListener build for new DebugLoc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100461 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp b/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp index 2baf97911d5..9c01b7329a5 100644 --- a/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp +++ b/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp @@ -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 @@ class FilenameCache { DenseMap, 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 @@ static debug_line_info LineStartToOProfileFormat( 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(Result.vma) << " to " << Result.filename << ":" << Result.lineno << "\n"); return Result;