[llvm-dev] getOrInsertFunction issue

Simonas Kazlauskas via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 29 05:15:56 PST 2021


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)

S.

On Mon, 29 Nov 2021 at 13:13, Julien Schmitt via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Dear community
>
> I'm working on a compiler for a in-house DSP developped with LLVM 8.0.
> 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
>
>
> In my code, I use the "getOrInsertFunction" method which crashes on
> LLVM9.0:
>
> - first call ('insert') -> ok
>
> - 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)
>
>
> I checked that after the first call of 'getOrInsertFunction', the context
> is correct.
>
>
> Has anyone faced this issue ? Is it resolved in a higher version of LLVM ?
>
> Thank for your help !
>
>
> -------------------
>
> Julien Schmitt
>
>
>
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211129/1fadaf8f/attachment.html>


More information about the llvm-dev mailing list