[DebugInfo] Add an attribute to force type info to be emitted for types that are...
authorAmy Huang <akhuang@google.com>
Tue, 16 Feb 2021 21:13:52 +0000 (13:13 -0800)
committerAmy Huang <akhuang@google.com>
Fri, 12 Mar 2021 20:30:01 +0000 (12:30 -0800)
commitd7cd208f08afca450484be97604a55704a628e88
tree8edee69490f0547e9864da807bf4eeed21535f9e
parent579b8fc2e97c489308f97b01d13d894c03c0a16c
[DebugInfo] Add an attribute to force type info to be emitted for types that are required to be complete.

This was motivated by the fact that constructor type homing (debug info
optimization that we want to turn on by default) drops some libc++ types,
so an attribute would allow us to override constructor homing and emit
them anyway. I'm currently looking into the particular libc++ issue, but
even if we do fix that, this issue might come up elsewhere and it might be
nice to have this.

As I've implemented it now, the attribute isn't specific to the
constructor homing optimization and overrides all of the debug info
optimizations.

Open to discussion about naming, specifics on what the attribute should do, etc.

Differential Revision: https://reviews.llvm.org/D97411
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/standalone-debug-attribute.cpp [new file with mode: 0644]
clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/Sema/attr-standalonedebug.cpp [new file with mode: 0644]