mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-06 03:08:43 +00:00
Fix OProfile support after r80406 changed the DebugInfo interface from
GlobalVariables to MDNodes. llvm-svn: 80411
This commit is contained in:
parent
db0cb257be
commit
93ed558d9f
@ -71,12 +71,12 @@ OProfileJITEventListener::~OProfileJITEventListener() {
|
|||||||
class FilenameCache {
|
class FilenameCache {
|
||||||
// Holds the filename of each CompileUnit, so that we can pass the
|
// Holds the filename of each CompileUnit, so that we can pass the
|
||||||
// pointer into oprofile. These char*s are freed in the destructor.
|
// pointer into oprofile. These char*s are freed in the destructor.
|
||||||
DenseMap<GlobalVariable*, char*> Filenames;
|
DenseMap<MDNode*, char*> Filenames;
|
||||||
// Used as the scratch space in DICompileUnit::getFilename().
|
// Used as the scratch space in DICompileUnit::getFilename().
|
||||||
std::string TempFilename;
|
std::string TempFilename;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const char* getFilename(GlobalVariable *CompileUnit) {
|
const char* getFilename(MDNode *CompileUnit) {
|
||||||
char *&Filename = Filenames[CompileUnit];
|
char *&Filename = Filenames[CompileUnit];
|
||||||
if (Filename == NULL) {
|
if (Filename == NULL) {
|
||||||
DICompileUnit CU(CompileUnit);
|
DICompileUnit CU(CompileUnit);
|
||||||
@ -85,7 +85,7 @@ class FilenameCache {
|
|||||||
return Filename;
|
return Filename;
|
||||||
}
|
}
|
||||||
~FilenameCache() {
|
~FilenameCache() {
|
||||||
for (DenseMap<GlobalVariable*, char*>::iterator
|
for (DenseMap<MDNode*, char*>::iterator
|
||||||
I = Filenames.begin(), E = Filenames.end(); I != E;++I) {
|
I = Filenames.begin(), E = Filenames.end(); I != E;++I) {
|
||||||
free(I->second);
|
free(I->second);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user