This is an archive of the discontinued LLVM Phabricator instance.

[DWARFv5] Allow ".loc 0" to refer to the root file
ClosedPublic

Authored by probinson on Jun 21 2018, 1:47 PM.

Details

Summary

DWARF v5 explicitly represents file #0 in the line table. Prior
versions did not, so ".loc 0" is still an error in those cases.

I think this is the next-to-last bit for v5 line tables. I still need to persuade MCDwarf to return file number 0 when looking up the root file (currently the root file ends up in the file table twice).

Diff Detail

Repository
rL LLVM

Event Timeline

probinson created this revision.Jun 21 2018, 1:47 PM
aprantl added inline comments.Jun 21 2018, 1:51 PM
llvm/test/MC/ELF/dwarf-loc0.s
4 ↗(On Diff #152371)

That's not true. The default DWARF version for Darwin is 4.

probinson added inline comments.Jun 21 2018, 2:19 PM
llvm/test/MC/ELF/dwarf-loc0.s
4 ↗(On Diff #152371)

Okay... Have things changed recently? I copied this comment from a test I added in March. At that time, it took me 3 tries to commit a previous file-0 related patch, and the first attempt did not have this comment in it but the last one did. I doubt I would have made such a statement without somebody telling me that was so.

I'm happy to take it out but I don't have a way to verify it will work on Darwin without actually committing it.

probinson added inline comments.Jun 21 2018, 2:25 PM
llvm/test/MC/ELF/dwarf-loc0.s
4 ↗(On Diff #152371)

Aha. On Darwin the *line table* is clamped at DWARF v2; see MCDwarf.cpp line ~467.

aprantl accepted this revision.Jun 21 2018, 2:47 PM
aprantl added inline comments.
llvm/test/MC/ELF/dwarf-loc0.s
4 ↗(On Diff #152371)

Ugh. Right. I forgot about that.

This revision is now accepted and ready to land.Jun 21 2018, 2:47 PM
This revision was automatically updated to reflect the committed changes.