After this patch, in the following snippet:
template <typename T> Foo {}; template <template <typename T> class CT = Foo> Bar {}; Bar<> b;
The debug-info entry for the CT template parameter will have
a DW_AT_default_value (true) attached to it.
Paths
| Differential D139989
[clang][DebugInfo] Add DW_AT_default_value support for template template parameters ClosedPublic Authored by Michael137 on Dec 13 2022, 5:53 PM.
Details Summary After this patch, in the following snippet: template <typename T> Foo {}; template <template <typename T> class CT = Foo> Bar {}; Bar<> b; The debug-info entry for the CT template parameter will have
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 13 2022, 5:53 PM This revision is now accepted and ready to land.Dec 14 2022, 9:24 AM
Comment Actions Looks good to me - we'd usually split the LLVM part from the Clang part, but I don't think we have fine grained unit tests for DIBuilder (could you check - if we do, then the LLVM part should go separately, with unit test coverage, then the Clang part can go in that uses it) & /maybe/ it's worth having a default value for the IsDefault argument, so any existing callers aren't broken, but I don't feel strongly about it if it all works, the number of external callers is probably quite small/not a big deal. (if you do split up the clang/llvm parts into separate commits, no need to send them as separate reviews - you can commit them directly) This revision was landed with ongoing or failed builds.Dec 16 2022, 3:39 AM Closed by commit rG2dff41c320fc: [llvm][DebugInfo] Add IsDefault parameter to DIBuilder… (authored by Michael137). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 482680 clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-template-parameter.cpp
llvm/include/llvm/IR/DIBuilder.h
llvm/lib/IR/DIBuilder.cpp
|
Could we pull this snipped out and do it before the switch - so we don't have to repeat it for each different kind of template parameter type?