[LLVMdev] [cfe-dev] Meaning of LLVM optimization levels

Robinson, Paul Paul_Robinson at playstation.sony.com
Sat Jun 8 19:46:41 PDT 2013


On 7 June 2013 17:52, Dallman, John <john.dallman at siemens.com> wrote:
> Is it possible for the debug information to mark all the instructions that arise
> from a
> language statement as coming from that statement, even though the instructions may
> be widely scattered?

Yes.

> Instructions whose effects 
> are used in the logic from more than one statement would have to be included with
> all those statement.

Hmmm, that would be atypical.  You *can* produce legal DWARF to do that, but
it's a little unlikely that any debugger would understand what you meant.
Generally each instruction is associated with a single statement.

From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Renato Golin
> I'm not aware Dwarf supports statements, but it does support line and column 
> information, so if the sources are accurate, you can get "statements" but not as a
> compiler would recognize, just as a string.

DWARF actually doesn't support source *extents*, it assumes the compiler
will map each statement to a single (canonical) source location and associate
each instruction produced for that statement to the same source location.

DWARF "supports statements" in the sense that a compiler can flag an
instruction as an appropriate place to set a breakpoint for a given
statement, i.e. the statement whose canonical source location is
associated with that instruction.

--paulr






More information about the llvm-dev mailing list