[llvm] r193095 - Fix up some old review feedback.

Eric Christopher echristo at gmail.com
Mon Oct 21 10:48:51 PDT 2013


Author: echristo
Date: Mon Oct 21 12:48:51 2013
New Revision: 193095

URL: http://llvm.org/viewvc/llvm-project?rev=193095&view=rev
Log:
Fix up some old review feedback.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=193095&r1=193094&r2=193095&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Mon Oct 21 12:48:51 2013
@@ -1300,7 +1300,7 @@ CompileUnit::getOrCreateTemplateValuePar
 
   // 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::getOrCreateSubprogramD
        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)));
 





More information about the llvm-commits mailing list