diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-16 00:08:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-16 00:08:22 +0000 |
commit | 04b72c821e616c017d5c198487621d8be281f2d4 (patch) | |
tree | b46aeb1bfd08782a7e137454f715f3e12ea8676e /lib/Target/CBackend/CBackend.cpp | |
parent | 83712992585065819e5494721e05d5ef72aa9be6 (diff) |
Fix bug: test/Regression/CBackend/2002-10-15-OpaqueTypeProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 4765f409e2..feaf135269 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -196,12 +196,12 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar, } // Check to see if the type is named. - if (!IgnoreName) { + if (!IgnoreName || isa<OpaqueType>(Ty)) { map<const Type *, string>::iterator I = TypeNames.find(Ty); if (I != TypeNames.end()) { return Out << I->second << " " << NameSoFar; } - } + } switch (Ty->getPrimitiveID()) { case Type::FunctionTyID: { @@ -257,6 +257,14 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar, return printType(ATy->getElementType(), NameSoFar + "[" + utostr(NumElements) + "]"); } + + case Type::OpaqueTyID: { + static int Count = 0; + string TyName = "struct opaque_" + itostr(Count++); + assert(TypeNames.find(Ty) == TypeNames.end()); + TypeNames[Ty] = TyName; + return Out << TyName << " " << NameSoFar; + } default: assert(0 && "Unhandled case in getTypeProps!"); abort(); |