[llvm-dev] Need help in creating clone functions

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 15 16:43:11 PDT 2020


Check the DISubprogram associated with the cloned function (in the
LLVM IR the Function definition would have an "!dbg !47" at the end,
and that !47 would refer to a !DISubprogram that describes th
efunction) - you'd probably need to create a new DISubprogram and set
that as the subprogram for the new llvm::Function so it doesn't share
the same description/name/etc as the original.

On Mon, Jun 15, 2020 at 4:37 PM SANGEETA CHOWDHARY via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> Hello,
>
> I am working on creating a llvm pass which clones a certain function with a different name using CloneFunctionInto. I create a call instruction to call a new cloned function from the old function. In llvm IR and in .s file everything looks as expected, but when I call this program with gdb and set a breakpoint on this new function, gdb shows the name of the original function. I know it has to do something with debug options but I am not sure how should I set the debug options of this new function so that I can see it in gdb.
> Can someone please help me with this?
>
> Regards,
> Sangeeta
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list