aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-30 00:12:51 +0000
committerChris Lattner <sabre@nondot.org>2003-10-30 00:12:51 +0000
commitdaf2a492a7eef1d4f68b1ed04b401ca6140c191f (patch)
tree09c6207373c88ae0dffd3499f445bc767bb94aeb
parent0faadf2e589b7bbeb740899429a659f576f29683 (diff)
Make sure to print opaque types names if they are available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9597 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/AsmWriter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 7fde122035..2cdca502dc 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -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.