<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><font face="Courier New, Courier, monospace">Hi Bjoern,</font></p>
<p><font face="Courier New, Courier, monospace">Could you please
give me a minimal code sample to produce this behavior?</font><br>
</p>
<div class="moz-cite-prefix">On 07/05/19 5:17 PM, Gaier, Bjoern via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:OSAPR01MB3171F58A67505264CFD91648E2310@OSAPR01MB3171.jpnprd01.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="DE">Dear LLVM-Mailing-List,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal">I’m using the llvm::EngineBuilder to create
an instance of the llvm::ExecutionEngine, I then JIT my code,
take the addresses I need and delete the
llvm::ExecutionEngine. But now I started to wonder, if I could
reuse that instance for a new module again?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I first tried calling llvm::EngineBuilder
without setting a Module, I planned to add it later – but when
I do this the “create” function will crash.</p>
</div>
</blockquote>
What crash you get? By quickly looking through interface,
EngineBuilder uses nullptr if no module are provided. <br>
<blockquote type="cite"
cite="mid:OSAPR01MB3171F58A67505264CFD91648E2310@OSAPR01MB3171.jpnprd01.prod.outlook.com">
<div class="WordSection1">
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Another test I ran was calling
“removeModule” of the llvm::ExecutionEngine after the call to
finalizeObject. Then I added the same module again and ran
finalizeObject again. The result was weird, I suddenly became
error messages about the relocation – I take this came because
I applied a memory mapping in the first run.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So to make it short: Is the
llvm::ExecutionEngine designed for a reuse or is it better to
create a new instance again?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind greetings<o:p></o:p></p>
<p class="MsoNormal">Björn<o:p></o:p></p>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB
9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi
Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi
Nagano, Takeshi Fukushima. Junichi Tajika
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Have a great day!
PreeJackie</pre>
</body>
</html>