Make sure to print opaque types names if they are available.
authorChris Lattner <sabre@nondot.org>
Thu, 30 Oct 2003 00:12:51 +0000 (00:12 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 30 Oct 2003 00:12:51 +0000 (00:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9597 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 7fde12203593f1ee432917b57d55da8e240289d4..2cdca502dc64a3822958b27d7858accc4eb06aad 100644 (file)
@@ -203,12 +203,16 @@ static std::ostream &printTypeInt(std::ostream &Out, const Type *Ty,
   // Primitive types always print out their description, regardless of whether
   // they have been named or not.
   //
-  if (Ty->isPrimitiveType()) return Out << Ty->getDescription();
+  if (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty))
+    return Out << Ty->getDescription();
 
   // Check to see if the type is named.
   std::map<const Type *, std::string>::iterator I = TypeNames.find(Ty);
   if (I != TypeNames.end()) return Out << I->second;
 
+  if (isa<OpaqueType>(Ty))
+    return Out << "opaque";
+
   // Otherwise we have a type that has not been named but is a derived type.
   // Carefully recurse the type hierarchy to print out any contained symbolic
   // names.