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

Andres Freund via llvm-commits llvm-commits at lists.llvm.org
Thu May 24 10:03:06 PDT 2018


Author: anarazel
Date: Thu May 24 10:03:06 2018
New Revision: 333206

URL: http://llvm.org/viewvc/llvm-project?rev=333206&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h

Modified: llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h?rev=333206&r1=333205&r2=333206&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h Thu May 24 10:03:06 2018
@@ -380,7 +380,7 @@ public:
 
   JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
                          bool ExportedSymbolsOnly) {
-    return KeyLayers[K]->findSymbolIn(K, Name, ExportedSymbolsOnly);
+    return KeyLayers[K]->findSymbolIn(K, mangle(Name), ExportedSymbolsOnly);
   }
 
   LLVMOrcErrorCode findSymbolAddress(JITTargetAddress &RetAddr,




More information about the llvm-commits mailing list