This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen/AccelTable] Don't emit zero-CU name indexes
ClosedPublic

Authored by labath on Apr 9 2018, 4:42 AM.

Details

Summary

If an input DICompileUnit is completely empty (e.g., the result of
running "clang -g" on an empty file), we don't bother emitting an empty
DWARF CU. When we do that, we must make sure we don't also emit a DWARF v5
name index, as DWARF specifies that each index must reference at least
one compilation unit.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Apr 9 2018, 4:42 AM
JDevlieghere accepted this revision.Apr 9 2018, 6:25 AM

Other than the inline comment this LGTM

lib/CodeGen/AsmPrinter/AccelTable.cpp
370 ↗(On Diff #141616)

Why not put this at the top like a pre-condition? Maybe also add a message?

This revision is now accepted and ready to land.Apr 9 2018, 6:25 AM
This revision was automatically updated to reflect the committed changes.
labath added inline comments.Apr 9 2018, 7:42 AM
lib/CodeGen/AsmPrinter/AccelTable.cpp
370 ↗(On Diff #141616)

No particular reason. I agree it looks better at the top.