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

Andres Freund via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 21:16:16 PDT 2018


anarazel created this revision.
anarazel added a reviewer: lhames.
Herald added a subscriber: llvm-commits.

The lack of name mangling causes 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.


Repository:
  rL LLVM

https://reviews.llvm.org/D47308

Files:
  lib/ExecutionEngine/Orc/OrcCBindingsStack.h


Index: lib/ExecutionEngine/Orc/OrcCBindingsStack.h
===================================================================
--- lib/ExecutionEngine/Orc/OrcCBindingsStack.h
+++ lib/ExecutionEngine/Orc/OrcCBindingsStack.h
@@ -381,7 +381,7 @@
   JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
                          bool ExportedSymbolsOnly) {
     assert(KeyLayers.count(K) && "looking up symbol in unknown module");
-    return KeyLayers[K]->findSymbolIn(K, Name, ExportedSymbolsOnly);
+    return KeyLayers[K]->findSymbolIn(K, mangle(Name), ExportedSymbolsOnly);
   }
 
   LLVMOrcErrorCode findSymbolAddress(JITTargetAddress &RetAddr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47308.148333.patch
Type: text/x-patch
Size: 653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180524/5951df0a/attachment.bin>


More information about the llvm-commits mailing list