[ORC] Perform name mangling in findSymbolIn(), as done in findSymbol().

The lack of name mangling caused a unittest failure after r333147 (in
TestEagerIRCompilation), as OSX prefixes symbol names with '_'. The
lack of name mangling therefore leads to a NULL pointer being returned
and then called, hence the failure.

While it may look like it, this isn't an actual behavioral change, as
findSymbolIn() previously was not exposed externally, and essentially
dead code. Which explains why nobody noticed the issue previously.

Reviewers: lhames

Reviewed By: lhames

Subscribers: chandlerc, llvm-commits

Differential Revision: https://reviews.llvm.org/D47308

llvm-svn: 333206
This commit is contained in:
Andres Freund 2018-05-24 17:03:06 +00:00
parent 512ccd7e6f
commit ac15cabd89
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ public:
JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name, JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
bool ExportedSymbolsOnly) { bool ExportedSymbolsOnly) {
return KeyLayers[K]->findSymbolIn(K, Name, ExportedSymbolsOnly); return KeyLayers[K]->findSymbolIn(K, mangle(Name), ExportedSymbolsOnly);
} }
LLVMOrcErrorCode findSymbolAddress(JITTargetAddress &RetAddr, LLVMOrcErrorCode findSymbolAddress(JITTargetAddress &RetAddr,