mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
llvm-symbolizer: don't always run demangler on global object names
llvm-svn: 192781
This commit is contained in:
parent
b373627ae3
commit
ce694a322e
@ -196,7 +196,7 @@ std::string LLVMSymbolizer::symbolizeData(const std::string &ModuleName,
|
|||||||
if (Opts.UseSymbolTable) {
|
if (Opts.UseSymbolTable) {
|
||||||
if (ModuleInfo *Info = getOrCreateModuleInfo(ModuleName)) {
|
if (ModuleInfo *Info = getOrCreateModuleInfo(ModuleName)) {
|
||||||
if (Info->symbolizeData(ModuleOffset, Name, Start, Size) && Opts.Demangle)
|
if (Info->symbolizeData(ModuleOffset, Name, Start, Size) && Opts.Demangle)
|
||||||
Name = DemangleName(Name);
|
Name = DemangleGlobalName(Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
@ -436,5 +436,11 @@ std::string LLVMSymbolizer::DemangleName(const std::string &Name) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string LLVMSymbolizer::DemangleGlobalName(const std::string &Name) {
|
||||||
|
// We can spoil names of globals with C linkage, so use an heuristic
|
||||||
|
// approach to check if the name should be demangled.
|
||||||
|
return (Name.substr(0, 2) == "_Z") ? DemangleName(Name) : Name;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace symbolize
|
} // namespace symbolize
|
||||||
} // namespace llvm
|
} // namespace llvm
|
||||||
|
@ -71,6 +71,7 @@ private:
|
|||||||
ObjectFile *getObjectFileFromBinary(Binary *Bin, const std::string &ArchName);
|
ObjectFile *getObjectFileFromBinary(Binary *Bin, const std::string &ArchName);
|
||||||
|
|
||||||
std::string printDILineInfo(DILineInfo LineInfo) const;
|
std::string printDILineInfo(DILineInfo LineInfo) const;
|
||||||
|
static std::string DemangleGlobalName(const std::string &Name);
|
||||||
|
|
||||||
// Owns all the parsed binaries and object files.
|
// Owns all the parsed binaries and object files.
|
||||||
SmallVector<Binary*, 4> ParsedBinariesAndObjects;
|
SmallVector<Binary*, 4> ParsedBinariesAndObjects;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user