This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Use SplitTemplateClosers (foo<bar<baz> >) in DWARF too
ClosedPublic

Authored by sammccall on May 26 2020, 6:44 AM.

Details

Summary

D76801 caused some regressions in debuginfo compatibility by changing how
certain functions were named.

For CodeView we try to mirror MSVC exactly: this was fixed in a549c0d00486
For DWARF the situation is murkier. Per David Blaikie:

In general DWARF doesn't specify this at all.
[...]
This isn't the only naming divergence between GCC and Clang

Nevertheless, including the space seems to provide better compatibility with
GCC and GDB. E.g. cpexprs.cc in the GDB testsuite requires this formatting.
And there was no particular desire to change the printing of names in debug
info in the first place (just in diagnostics and other more user-facing text).

Fixes PR46052

Diff Detail

Event Timeline

sammccall created this revision.May 26 2020, 6:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2020, 6:44 AM
dblaikie accepted this revision.May 26 2020, 10:59 AM

Looks good - thanks!

This revision is now accepted and ready to land.May 26 2020, 10:59 AM
amccarth added inline comments.
clang/lib/CodeGen/CGDebugInfo.cpp
242

So, in other words, we'll always set PP.SplitTemplateClosers to true, now.

sammccall marked an inline comment as done.May 26 2020, 12:32 PM
sammccall added inline comments.
clang/lib/CodeGen/CGDebugInfo.cpp
242

Yes. I thought it was clearest to write it separately in each branch, as it's basically a coincidence and I can give a separate comment.

Happy to fold it together if you think it's confusing.

amccarth marked an inline comment as done.May 27 2020, 12:53 PM
amccarth added inline comments.
clang/lib/CodeGen/CGDebugInfo.cpp
242

No change necessary. I agree with how you've done it. I was just amused that, after fixing the regression for CodeView, it ended up being undone for DWARF as well.

This revision was automatically updated to reflect the committed changes.