<div dir="ltr"><div>Make sure that `getOrInsertFunction` does indeed return a function
and not say a constexpr bitcast (which could happen if type of the
function is different from what was used for the initial insert)</div><div><br></div><div>S.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 29 Nov 2021 at 13:13, Julien Schmitt 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:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-1331351806876469488divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Dear community</p>
<p>I'm working on a compiler for a in-house DSP developped with LLVM 8.0. <br>
Now I'm trying to migrate the LLVM base to the latest one (LLVM-13), but I proceed by steps and first I migrate to LLVM-9.0<br>
</p>
<p><br>
</p>
<p>In my code, I use the "getOrInsertFunction" method which crashes on LLVM9.0:</p>
<p>- first call ('insert') -> ok</p>
<p>- second call on an existing funcion ('get') -> the function exists but it seems that the Context environment is lost for the FunctionType variable (getContext is empty)<br>
</p>
<p><br>
</p>
<p>I checked that after the first call of '<span>getOrInsertFunction</span>', the context is correct.
<br>
</p>
<p><br>
</p>
<p>Has anyone faced this issue ? Is it resolved in a higher version of LLVM ? <br>
</p>
<p>Thank for your help !</p>
<p><br>
</p>
<p>-------------------<br>
</p>
<p>Julien Schmitt<br>
</p>
<div id="gmail-m_-1331351806876469488Signature">
<div id="gmail-m_-1331351806876469488divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper">
<div name="divtagdefaultwrapper">
<table style="border-collapse:collapse;border:1px solid rgb(198,198,198);table-layout:fixed" cellspacing="0">
<tbody>
<tr style="border-collapse:collapse;border:1px solid rgb(198,198,198)">
<td style="border-collapse:collapse;border:1px solid rgb(198,198,198);width:92px" align="center">
<br>
</td>
<td colspan="1" style="border-collapse:collapse;border:1px solid rgb(198,198,198);width:73px" align="center">
<br>
</td>
<td style="border-collapse:collapse;border:1px solid rgb(198,198,198);width:254.167px">
<br>
</td>
</tr>
<tr style="border-collapse:collapse;border:1px solid rgb(198,198,198)">
<td rowspan="1" colspan="2" style="border-collapse:collapse;border:1px solid rgb(198,198,198)" align="center">
<br>
</td>
<td rowspan="1" style="border-collapse:collapse;border:1px solid rgb(198,198,198)">
<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
</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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>