[Lldb-commits] [PATCH] D145803: [clang][DebugInfo] Emit DW_AT_type of preferred name if available

2023-04-04 Thread Wolfgang Pieb via Phabricator via lldb-commits
wolfgangp added a comment.

> @probinson Sounds like Sony's solution also changes the `DW_AT_type` to a 
> non-canonical form. Do you still have concerns with the direction of this 
> patch? Would it cause any problems for you downstream?

Sorry for the late reply. Looking at the patch I don't think it will cause us 
any trouble. The 2 solutions should be able to live happily side by side.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145803/new/

https://reviews.llvm.org/D145803

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D145803: [clang][DebugInfo] Emit DW_AT_type of preferred name if available

2023-03-24 Thread Wolfgang Pieb via Phabricator via lldb-commits
wolfgangp added a comment.

In D145803#4219894 , @probinson wrote:

> This is pretty different from the "always desugar to the canonical type" 
> habit that has always been in place. Sony has done some downstream things to 
> try to work around that in the past. @wolfgangp will remember it better than 
> I do, but I think we make some effort to preserve the type-as-written. This 
> goes in completely the other direction.

The Sony solution does not rely on a user-specified attribute, but uniformly 
preserves all typedefs, though only in template argument types. Similar to this 
solution, it adds a second type to keep track of the preferred type, though it 
does so in the TemplateArgument structure as a separate QualType. A client can 
then either print the preferred type or the canonical type, depending on a 
printing policy, which is controlled by an option. This leads to a similar 
result in the resulting DWARF, i.e. the DW_AT_type node gets the preferred type 
string. The preferred type can also be used for diagnostic messages.




Comment at: clang/lib/CodeGen/CGDebugInfo.h:289
+  /// PreferredNameAttr attribute on \ref RD refers to. If no such
+  /// attribute exists, returns nullptr.
+  llvm::DIType *GetPreferredNameType(const CXXRecordDecl *RD,

This comment seems a bit garbled. Also, this is just a helper function, no?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145803/new/

https://reviews.llvm.org/D145803

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits