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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2013-08-08 08:09:43 +00:00
parent eee2a11ee3
commit 76ef79f410
2 changed files with 57 additions and 1 deletions

View File

@@ -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;