diff options
author | Eric Christopher <echristo@gmail.com> | 2013-08-08 08:09:43 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-08-08 08:09:43 +0000 |
commit | 056b647d1f229ef4cd6c739bbede52e4c7a87cf7 (patch) | |
tree | 65024d9c2e84ab6b3227c3181011a973da672d9c /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 9a39b07a605ce33b5af1bae9bd3de60ecdbe8ee6 (diff) | |
download | bcm5719-llvm-056b647d1f229ef4cd6c739bbede52e4c7a87cf7.tar.gz bcm5719-llvm-056b647d1f229ef4cd6c739bbede52e4c7a87cf7.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; |