llvm/llvm-project

[DWARF] Line 0 should not have is_stmt set

Open

#33.870 aberto em 7 de set. de 2017

Ver no GitHub
 (6 comments) (0 reactions) (0 assignees)C++ (10.782 forks)batch import
bugzilladebuginfogood first issuellvm:codegen

Métricas do repositório

Stars
 (26.378 stars)
Métricas de merge de PR
 (Mesclagem média 1d 2h) (1.000 fundiu PRs em 30d)

Description

Bugzilla Link 34522
Version trunk
OS Windows NT
CC @adrian-prantl,@dwblaikie

Extended Description

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.

Guia do colaborador