<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 14, 2019 at 3:21 AM Gaier, Bjoern via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_3997524881775611987WordSection1">
<p class="MsoNormal"><span lang="DE">Hello LLVM-World,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="DE"><u></u> <u></u></span></p>
<p class="MsoNormal">currently I play around with a „llvm::Module” and an external function defined there “puts”. Normally this function gets resolved in the JIT-Process but I wonder about two things:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="gmail-m_3997524881775611987MsoListParagraph" style="margin-left:0cm">Can I resolve the function already in this step? I used “replaceAllUsesWith” and passed a “llvm::ConstantInt” to the function. But this didn’t worked.</li></ol></div></div></blockquote><div><br></div><div>I'm not sure if I followed correctly, but you can't replace a function declaration with a constant int. The value for the function will be used (mostly) as an argument to the call instruction, which won't really be able to operate on an int. It isn't clear to me what you're trying to do exactly, replace the call to puts with an indirect call to the pointer value that correspond to puts in your current process? You would need to at least cast this pointer value to the right type, and use an indirect call.</div><div><br></div><div>Best,</div><div><br></div><div>-- </div><div>Mehdi</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_3997524881775611987WordSection1"><ol style="margin-top:0cm" start="1" type="1"><li class="gmail-m_3997524881775611987MsoListParagraph" style="margin-left:0cm"><u></u><u></u></li><li class="gmail-m_3997524881775611987MsoListParagraph" style="margin-left:0cm">What might happen if I have two modules and use “replaceAllUsesWith” on a function of Module A, passing a function of Module B.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you for the help in advance!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Kind greetings<u></u><u></u></p>
<p class="MsoNormal">Björn<u></u><u></u></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
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>