Fix up some old review feedback.
authorEric Christopher <echristo@gmail.com>
Mon, 21 Oct 2013 17:48:51 +0000 (17:48 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 21 Oct 2013 17:48:51 +0000 (17:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193095 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

index 57eb1d24109334b6f0b0f45d85c5a299cda13433..290d80ceffddbff638f3628710050aaa5d67c653 100644 (file)
@@ -1300,7 +1300,7 @@ CompileUnit::getOrCreateTemplateValueParameterDIE(DITemplateValueParameter VP,
 
   // Add the type if there is one, template template and template parameter
   // packs will not have a type.
-  if (VP.getType())
+  if (VP.getTag() == dwarf::DW_TAG_template_value_parameter)
     addType(ParamDIE, resolve(VP.getType()));
   if (!VP.getName().empty())
     addString(ParamDIE, dwarf::DW_AT_name, VP.getName());
@@ -1411,12 +1411,13 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
        Language == dwarf::DW_LANG_ObjC))
     addFlag(SPDie, dwarf::DW_AT_prototyped);
 
-  // Add Return Type. A void return type will not have a type.
   DICompositeType SPTy = SP.getType();
   assert(SPTy.getTag() == dwarf::DW_TAG_subroutine_type &&
          "the type of a subprogram should be a subroutine");
 
   DIArray Args = SPTy.getTypeArray();
+  // Add a return type. If this is a type like a C/C++ void type we don't add a
+  // return type.
   if (Args.getElement(0))
     addType(SPDie, DIType(Args.getElement(0)));