From 056b647d1f229ef4cd6c739bbede52e4c7a87cf7 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 8 Aug 2013 08:09:43 +0000 Subject: For DW_TAG_template_type_parameter the actual passed in type could be void and therefore not have a type entry. Only add the type if it is non-void and provide a testcase. llvm-svn: 187966 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 113f8293ad8..803a35d9e4c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1123,7 +1123,9 @@ CompileUnit::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP) { return ParamDIE; ParamDIE = new DIE(dwarf::DW_TAG_template_type_parameter); - addType(ParamDIE, TP.getType()); + // Add the type if it exists, it could be void and therefore no type. + if (TP.getType()) + addType(ParamDIE, TP.getType()); if (!TP.getName().empty()) addString(ParamDIE, dwarf::DW_AT_name, TP.getName()); return ParamDIE; -- cgit v1.2.3