get debug info after optimization

Hi,

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?

Best,

Mohammad

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

So I guess I can get it with:

getDebugLoc().getLine();

Right?

Best,

Mohammad