summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-08-08 08:09:43 +0000
committerEric Christopher <echristo@gmail.com>2013-08-08 08:09:43 +0000
commit76ef79f410853a431c820cb5d0ee11cd66d4c90d (patch)
tree6c1060aff0e11b191b3c28fbad3bb09a33d04b26 /lib
parenteee2a11ee38307ea3b0bbd43c33e5fad182f0951 (diff)
downloadllvm-76ef79f410853a431c820cb5d0ee11cd66d4c90d.tar.gz
llvm-76ef79f410853a431c820cb5d0ee11cd66d4c90d.tar.bz2
llvm-76ef79f410853a431c820cb5d0ee11cd66d4c90d.tar.xz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 113f8293ad..803a35d9e4 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/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;