diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 330fe333a58cc..b7e603c58792b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1420,7 +1420,8 @@ bool DwarfUnit::applySubprogramDefinitionAttributes(const DISubprogram *SP, } // Add function template parameters. - addTemplateParams(SPDie, SP->getTemplateParams()); + if (!Minimal) + addTemplateParams(SPDie, SP->getTemplateParams()); // Add the linkage name if we have one and it isn't in the Decl. StringRef LinkageName = SP->getLinkageName(); diff --git a/llvm/test/DebugInfo/X86/fission-template.ll b/llvm/test/DebugInfo/X86/fission-template.ll index b45b650846d00..7faf7cc2fa973 100644 --- a/llvm/test/DebugInfo/X86/fission-template.ll +++ b/llvm/test/DebugInfo/X86/fission-template.ll @@ -20,9 +20,7 @@ ; CHECK: DW_TAG_subprogram ; CHECK-NEXT: DW_AT_linkage_name ("_Z2f2IiEvv") ; CHECK-NEXT: DW_AT_name ("f2") -; CHECK: DW_TAG_template_type_parameter -; CHECK-NEXT: DW_AT_type (0x{{.*}} "int") -; CHECK-NEXT: DW_AT_name ("T") +; CHECK-NOT: DW_TAG_template_type_parameter ; CHECK: .debug_info.dwo contents: ; CHECK: DW_TAG_compile_unit ; CHECK: DW_TAG_subprogram