This revision was automatically updated to reflect the committed changes. Closed by commit rGd283fc4f9d07: [DebugInfo] Use SplitTemplateClosers (foo<bar<baz> >) in DWARF too (authored by sammccall).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80554/new/ https://reviews.llvm.org/D80554 Files: clang/lib/CodeGen/CGDebugInfo.cpp clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp clang/test/Modules/ExtDebugInfo.cpp clang/test/Modules/ModuleDebugInfo.cpp Index: clang/test/Modules/ModuleDebugInfo.cpp =================================================================== --- clang/test/Modules/ModuleDebugInfo.cpp +++ clang/test/Modules/ModuleDebugInfo.cpp @@ -65,7 +65,7 @@ // This type is anchored by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<int, DebugCXX::traits<int>>" +// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >" // CHECK-SAME: elements: // CHECK-SAME: templateParams: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") @@ -80,7 +80,7 @@ // CHECK-SAME: identifier: "_ZTSN8DebugCXX6traitsIfEE") // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<long, DebugCXX::traits<long>>" +// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >" // CHECK-SAME: elements: // CHECK-SAME: templateParams: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE") @@ -89,7 +89,7 @@ // no mangled name here yet. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<float, DebugCXX::traits<float>>" +// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >" // CHECK-SAME: flags: DIFlagFwdDecl // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE") Index: clang/test/Modules/ExtDebugInfo.cpp =================================================================== --- clang/test/Modules/ExtDebugInfo.cpp +++ clang/test/Modules/ExtDebugInfo.cpp @@ -85,14 +85,14 @@ // This type is not anchored in the module by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<long, DebugCXX::traits<long>>", +// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: elements: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE") // This type is anchored in the module by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<int, DebugCXX::traits<int>>", +// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: flags: DIFlagFwdDecl // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") @@ -103,7 +103,7 @@ // This one isn't. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<float, DebugCXX::traits<float>>", +// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: elements: // CHECK-SAME: templateParams: Index: clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp =================================================================== --- clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -110,7 +110,7 @@ }; j_wrap<j<int>> j_wrap_j; // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>" -// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int>>" +// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >" template <typename T> struct k { Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -236,6 +236,10 @@ if (CGM.getCodeGenOpts().EmitCodeView) { PP.MSVCFormatting = true; PP.SplitTemplateClosers = true; + } else { + // For DWARF, printing rules are underspecified. + // SplitTemplateClosers yields better interop with GCC and GDB (PR46052). + PP.SplitTemplateClosers = true; } // Apply -fdebug-prefix-map.
Index: clang/test/Modules/ModuleDebugInfo.cpp =================================================================== --- clang/test/Modules/ModuleDebugInfo.cpp +++ clang/test/Modules/ModuleDebugInfo.cpp @@ -65,7 +65,7 @@ // This type is anchored by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<int, DebugCXX::traits<int>>" +// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >" // CHECK-SAME: elements: // CHECK-SAME: templateParams: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") @@ -80,7 +80,7 @@ // CHECK-SAME: identifier: "_ZTSN8DebugCXX6traitsIfEE") // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<long, DebugCXX::traits<long>>" +// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >" // CHECK-SAME: elements: // CHECK-SAME: templateParams: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE") @@ -89,7 +89,7 @@ // no mangled name here yet. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<float, DebugCXX::traits<float>>" +// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >" // CHECK-SAME: flags: DIFlagFwdDecl // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE") Index: clang/test/Modules/ExtDebugInfo.cpp =================================================================== --- clang/test/Modules/ExtDebugInfo.cpp +++ clang/test/Modules/ExtDebugInfo.cpp @@ -85,14 +85,14 @@ // This type is not anchored in the module by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<long, DebugCXX::traits<long>>", +// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: elements: // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE") // This type is anchored in the module by an explicit template instantiation. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<int, DebugCXX::traits<int>>", +// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: flags: DIFlagFwdDecl // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") @@ -103,7 +103,7 @@ // This one isn't. // CHECK: !DICompositeType(tag: DW_TAG_class_type, -// CHECK-SAME: name: "Template<float, DebugCXX::traits<float>>", +// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >", // CHECK-SAME: scope: ![[NS]], // CHECK-SAME: elements: // CHECK-SAME: templateParams: Index: clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp =================================================================== --- clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp +++ clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -110,7 +110,7 @@ }; j_wrap<j<int>> j_wrap_j; // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>" -// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int>>" +// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >" template <typename T> struct k { Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -236,6 +236,10 @@ if (CGM.getCodeGenOpts().EmitCodeView) { PP.MSVCFormatting = true; PP.SplitTemplateClosers = true; + } else { + // For DWARF, printing rules are underspecified. + // SplitTemplateClosers yields better interop with GCC and GDB (PR46052). + PP.SplitTemplateClosers = true; } // Apply -fdebug-prefix-map.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits