[llvm-dev] get debug info after optimization

Mohammad Norouzi via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 3 10:18:38 PST 2016


So I guess I can get it with:

getDebugLoc().getLine();

Right?

Best,
Mohammad

On Thu, Mar 3, 2016 at 6:30 PM, Robinson, Paul <
Paul_Robinson at playstation.sony.com> wrote:

> > > On Mar 3, 2016, at 8:40 AM, Mohammad Norouzi via llvm-dev <llvm-
> > dev at lists.llvm.org> wrote:
> > >
> > > Is it possible to get debug information after optimization? for
> example,
> > source code line numbers of instructions in an ir that is optimized by
> O2?
> >
> > Absolutely. In textual IR, have a look at the !dbg annotations on the
> > instructions. Let me know if you have any more specific questions.
> >
> > -- adrian
>
> And if you find cases where debug info doesn't survive optimization very
> well, but you think it could do better, it's definitely worth reporting
> those cases.  We can't necessarily make it better, but it's always worth
> a look.
> --paulr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160303/8a4f84c7/attachment.html>


More information about the llvm-dev mailing list