[llvm-dev] is_stmt and column numbers

Robinson, Paul via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 17 07:35:38 PST 2019



> -----Original Message-----
> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Roger Pack
> via llvm-dev
> Sent: Tuesday, December 17, 2019 8:31 AM
> To: llvm-dev <llvm-dev at lists.llvm.org>
> Subject: [llvm-dev] is_stmt and column numbers
> 
> It appears to me that from this:
> 
> https://iis-git.ee.ethz.ch/H2020-
> Compiler/llvm/commit/1d68fc5021ca8c704e21f171d98bb18eb396a7fa
> 
> That LLVM basically emits DWARF expressions where is_stmt is true only
> "once per line".  Is that still true?  Is there an option to emit more
> than one per line?
> 
> 
> Thanks all.
> 
> -Roger Pack-
> 
> refs:
> https://github.com/crystal-lang/crystal/pull/8499
> https://github.com/crystal-lang/crystal/issues/8319

is_stmt is based fairly strictly on "the line number changed" (while
ignoring line 0).  This works reasonably well at -O0 and gets clunkier as
optimization level increases.  I've never been happy about it, but have
never found the time to come up with something better.  The optimizer has
been getting better at not introducing gratuitous line-number changes, if
that helps.

There is no option to make it work differently.  We can (usually do) emit
column numbers, which gets you more line-table entries, although they are
not flagged with is_stmt.  I know at least one debugger that gave up on
is_stmt "because it's not reliable."
--paulr



More information about the llvm-dev mailing list