Don't forget to print address space qualifiers when printing out the type table!...
[oota-llvm.git] / lib / VMCore / AsmWriter.cpp
index e35b14fbc1a304d79768e090a9bd44df3d0c22f6..090276b7ffaae3d4d6d641e2a09b46deb20f68d6 100644 (file)
@@ -808,7 +808,10 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) {
     if (STy->isPacked())
       Out << '>';
   } else if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
-    printType(PTy->getElementType()) << '*';
+    printType(PTy->getElementType());
+    if (unsigned AddressSpace = PTy->getAddressSpace())
+      Out << " addrspace(" << AddressSpace << ")";
+    Out << '*';
   } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
     Out << '[' << ATy->getNumElements() << " x ";
     printType(ATy->getElementType()) << ']';