Fix a bug found exposed by: Regression/Other/2004-08-20-PackedControlFlow.ll
authorReid Spencer <rspencer@reidspencer.com>
Fri, 20 Aug 2004 15:37:30 +0000 (15:37 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 20 Aug 2004 15:37:30 +0000 (15:37 +0000)
Packed types need to be allowed in type statements too.

Patch provided by Brad Jones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15953 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 9fc772ecba56d4a59cceaf9bf0fd7c5439f77b7e..b109cb006eb6cfc9453b4d251a42514d9b0a3a10 100644 (file)
@@ -727,7 +727,11 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) {
   } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
     Out << '[' << ATy->getNumElements() << " x ";
     printType(ATy->getElementType()) << ']';
-  } else if (const OpaqueType *OTy = dyn_cast<OpaqueType>(Ty)) {
+  } else if (const PackedType *PTy = dyn_cast<PackedType>(Ty)) {
+    Out << '<' << PTy->getNumElements() << " x ";
+    printType(PTy->getElementType()) << '>';
+  }
+  else if (const OpaqueType *OTy = dyn_cast<OpaqueType>(Ty)) {
     Out << "opaque";
   } else {
     if (!Ty->isPrimitiveType())