diff --git a/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp b/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp index 69398be5080..00c4af7ac26 100644 --- a/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp +++ b/lib/ExecutionEngine/JIT/OProfileJITEventListener.cpp @@ -69,16 +69,16 @@ OProfileJITEventListener::~OProfileJITEventListener() { } class FilenameCache { - // Holds the filename of each CompileUnit, so that we can pass the + // Holds the filename of each Scope, so that we can pass the // pointer into oprofile. These char*s are freed in the destructor. DenseMap Filenames; public: - const char *getFilename(MDNode *CompileUnit) { - char *&Filename = Filenames[CompileUnit]; + const char *getFilename(MDNode *Scope) { + char *&Filename = Filenames[Scope]; if (Filename == NULL) { - DICompileUnit CU(CompileUnit); - Filename = strdup(CU.getFilename()); + DIScope S(Scope); + Filename = strdup(S.getFilename()); } return Filename; } @@ -97,7 +97,7 @@ static debug_line_info LineStartToOProfileFormat( Result.vma = Address; const DebugLocTuple &tuple = MF.getDebugLocTuple(Loc); Result.lineno = tuple.Line; - Result.filename = Filenames.getFilename(tuple.CompileUnit); + Result.filename = Filenames.getFilename(tuple.Scope); DEBUG(errs() << "Mapping " << reinterpret_cast(Result.vma) << " to " << Result.filename << ":" << Result.lineno << "\n"); return Result;