r207781 - PR19623: Support typedefs (and alias templates) of void.

David Blaikie dblaikie at gmail.com
Thu May 1 11:25:19 PDT 2014


Author: dblaikie
Date: Thu May  1 13:25:19 2014
New Revision: 207781

URL: http://llvm.org/viewvc/llvm-project?rev=207781&view=rev
Log:
PR19623: Support typedefs (and alias templates) of void.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-alias.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=207781&r1=207780&r2=207781&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu May  1 13:25:19 2014
@@ -722,7 +722,6 @@ llvm::DIType CGDebugInfo::CreateType(con
 llvm::DIType CGDebugInfo::CreateType(const TemplateSpecializationType *Ty, llvm::DIFile Unit) {
   assert(Ty->isTypeAlias());
   llvm::DIType Src = getOrCreateType(Ty->getAliasedType(), Unit);
-  assert(Src);
 
   SmallString<128> NS;
   llvm::raw_svector_ostream OS(NS);
@@ -749,8 +748,6 @@ llvm::DIType CGDebugInfo::CreateType(con
   // Typedefs are derived from some other type.  If we have a typedef of a
   // typedef, make sure to emit the whole chain.
   llvm::DIType Src = getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit);
-  if (!Src)
-    return llvm::DIType();
   // We don't set size information, but do specify where the typedef was
   // declared.
   SourceLocation Loc = Ty->getDecl()->getLocation();

Modified: cfe/trunk/test/CodeGenCXX/debug-info-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-alias.cpp?rev=207781&r1=207780&r2=207781&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-alias.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-alias.cpp Thu May  1 13:25:19 2014
@@ -27,3 +27,11 @@ narf // CHECK: [[NARF]] = {{.*}} ; [ DW_
 = int;
 narf n;
 
+template <typename T>
+using tv = void;
+// CHECK: null} ; [ DW_TAG_typedef ] [tv<int>] {{.*}} [from ]
+tv<int> *tvp;
+
+using v = void;
+// CHECK: null} ; [ DW_TAG_typedef ] [v] {{.*}} [from ]
+v *vp;





More information about the cfe-commits mailing list