forked from OSchip/llvm-project
Fix compile error as debug interface changed.
By the way, this code is buggy. You can't keep a map<MDNode *, something> because the MDNode may be destroyed and reused for something else. llvm-svn: 83141
This commit is contained in:
parent
2e722b915c
commit
6d59690c3e
|
@ -72,15 +72,13 @@ class FilenameCache {
|
|||
// Holds the filename of each CompileUnit, so that we can pass the
|
||||
// pointer into oprofile. These char*s are freed in the destructor.
|
||||
DenseMap<MDNode*, char*> Filenames;
|
||||
// Used as the scratch space in DICompileUnit::getFilename().
|
||||
std::string TempFilename;
|
||||
|
||||
public:
|
||||
const char *getFilename(MDNode *CompileUnit) {
|
||||
char *&Filename = Filenames[CompileUnit];
|
||||
if (Filename == NULL) {
|
||||
DICompileUnit CU(CompileUnit);
|
||||
Filename = strdup(CU.getFilename(TempFilename).c_str());
|
||||
Filename = strdup(CU.getFilename());
|
||||
}
|
||||
return Filename;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue