<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
<div class="">Relevant change:</div>
<div class=""><br class="">
</div>
<div class="">commit a81793582b3c47869680d354a97d59c55779c349<br class="">
Author: Lang Hames <<a href="mailto:lhames@gmail.com" class="">lhames@gmail.com</a>><br class="">
Date: Fri Jul 7 02:59:13 2017 +0000<br class="">
<br class="">
[ORC] Errorize the ORC APIs.<br class="">
<br class="">
This patch updates the ORC layers and utilities to return and propagate<br class="">
llvm::Errors where appropriate. This is necessary to allow ORC to safely handle<br class="">
error cases in cross-process and remote JITing.<br class="">
<br class="">
<br class="">
<br class="">
git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@307350" class="">
https://llvm.org/svn/llvm-project/llvm/trunk@307350</a> 91177308-0d34-0410-b5e6-96231b3b80d8<br class="">
<br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 27, 2017, at 8:38 AM, Christophe Duvernois via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">Hi everyone,<br class="">
<br class="">
</div>
In llvm 4.0 the MCJIT::getFunctionAddress function return 0 (a null address) when the symbol is not found :<br class="">
</div>
<br class="">
<i class="">uint64_t MCJIT::getSymbolAddress(const std::string &Name, bool CheckFunctionsOnly) {<br class="">
std::string MangledName;<br class="">
{<br class="">
raw_string_ostream MangledNameStream(MangledName);<br class="">
Mangler::getNameWithPrefix(MangledNameStream, Name, getDataLayout());<br class="">
}<br class="">
return findSymbol(MangledName, CheckFunctionsOnly).getAddress();<br class="">
}</i><br class="">
<br class="">
Now with the current implementation (llvm 5.0 rc1 tag) :<br class="">
<br class="">
<div class="">
<div class=""><i class=""><span style="font-family:arial,helvetica,sans-serif" class="">uint64_t MCJIT::getSymbolAddress(const std::string &Name, bool CheckFunctionsOnly) {<br class="">
std::string MangledName;<br class="">
{<br class="">
raw_string_ostream MangledNameStream(MangledName);<br class="">
Mangler::getNameWithPrefix(MangledNameStream, Name, getDataLayout());<br class="">
}<br class="">
if (auto Sym = findSymbol(MangledName, CheckFunctionsOnly)) {<br class="">
if (auto AddrOrErr = Sym.getAddress())<br class="">
return *AddrOrErr;<br class="">
else {<br class="">
report_fatal_error(AddrOrErr.takeError());<br class="">
}<br class="">
} else {<br class="">
report_fatal_error(Sym.takeError());<br class="">
}<br class="">
}</span><br class="">
<br class="">
</i></div>
<div class="">If the function <span style="font-family:arial,helvetica,sans-serif" class="">
findSymbol return</span><span style="font-family:arial,helvetica,sans-serif" class="">
</span><span style="font-family:arial,helvetica,sans-serif" class="">nullptr</span><span style="font-family:arial,helvetica,sans-serif" class="">, we are executing report_fatal_error and kill everything :(</span><span style="font-family:arial,helvetica,sans-serif" class=""></span><span style="font-family:arial,helvetica,sans-serif" class=""><br class="">
</span></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class=""><br class="">
What is the reason for this change?</span><span style="font-family:arial,helvetica,sans-serif" class="">
</span><span style="font-family:arial,helvetica,sans-serif" class="">Is this a bug?</span></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class=""><br class="">
If this is intended, how can we check from the ExecutionEngine that the symbol already exists?<br class="">
<br class="">
<br class="">
</span></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class="">Regards,<br class="">
</span></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class="">Christophe<br class="">
</span></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class=""><br class="">
<br class="">
<br class="">
</span></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
</div>
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class="">
</div>
</blockquote>
</div>
<br class="">
</body>
</html>