LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 34522 - [DWARF] Line 0 should not have is_stmt set
Summary: [DWARF] Line 0 should not have is_stmt set
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords: beginner
Depends on:
Blocks:
 
Reported: 2017-09-07 16:11 PDT by Paul Robinson
Modified: 2017-09-08 08:19 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Robinson 2017-09-07 16:11:41 PDT
I think it does not make sense for a line-0 record to have is_stmt set.
I made a point of turning it off for implicit line-0 records generated
by DwarfDebug, and in real code I don't think we would ever see it.

However, adding an assertion to this effect broke 40 LLVM tests.
In most cases, the problem is merely that the test-input IR does
not specify everything that normal IR input has.  In particular, at
some point DISubprogram started making a distinction between Line and 
scopeLine, i.e. line of declaration versus where-the-code-starts.
If the scopeLine argument is missing from textual IR, it defaults to
zero, and that gets propagated to the entry point of the subprogram,
which is a stopping point and therefore has is_stmt=1.

Defaulting scopeLine to Line fixed 33 of the tests, and eyeballing
the other 7 suggests that most of them don't set Line either.  This
is (IMO) a matter of flawed tests and it should be no sweat to fix.

There is one test related to prologue-end that seems to be testing
that it's okay for prologue-end to be line 0, and I ran out of time
to investigate any further.