[llvm-dev] source line number for instruction

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Tue May 15 09:13:58 PDT 2018


Not sure what you tried/how it didn't work - could you explain more?

You could scan through all the llvm::Functions in an llvm::Module and look
at the debug info associated with them (getSubprogram) then check the
location of that debug info.

- Dave

On Tue, May 15, 2018 at 12:46 AM Ridwan Shariffdeen via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> I want to retrieve a function from a source line-number, is this something possible to achieve?
> I tried the following code snippet with LLVM-7 but it doesn't seem to workhttp://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend <http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend:>
>
> Is there specific documentation I can refer to implement this?
>
> Thanks
>
> --
>
>
> *Rtr. PP Ridwan Shariffdeen*
> Asst. District Rotaract Representative | Rotaract District 3220
> Past President | Rotaract Club of University of Moratuwa
>
> Member | Rotaract Club of Alumni of University of Moratuwa
> Graduate | University of Moratuwa
>
> m:+94 772562002 | e:rshariffdeen at gmail.com | w:http://bit.ly/ridwanNaruto
> | a: Mount Lavinia
> <http://facebook.com/ridwan.naruto>  <http://linkedin.com/in/rshariffdeen>
>   <http://twitter.com/rshariffdeen>
> <http://plus.google.com/u/0/117443860077215662076>
> <http://github.com/rshariffdeen>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://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/20180515/e5583903/attachment.html>


More information about the llvm-dev mailing list