mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-28 23:43:50 +00:00
Fix OProfileJITEventListener after r84054 renamed CompileUnit to Scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
48dc29ef91
commit
c367e0c0fc
@ -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<MDNode*, char*> 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<void*>(Result.vma) << " to "
|
||||
<< Result.filename << ":" << Result.lineno << "\n");
|
||||
return Result;
|
||||
|
Loading…
Reference in New Issue
Block a user