Don't forget to print address space qualifiers when printing out the type table!...
authorChristopher Lamb <christopher.lamb@gmail.com>
Tue, 18 Dec 2007 03:49:35 +0000 (03:49 +0000)
committerChristopher Lamb <christopher.lamb@gmail.com>
Tue, 18 Dec 2007 03:49:35 +0000 (03:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45147 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp
test/Bindings/Ocaml/vmcore.ml

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)) {
     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()) << ']';
   } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
     Out << '[' << ATy->getNumElements() << " x ";
     printType(ATy->getElementType()) << ']';
index 33a1980f2f458e68bb950d993c9f2fb7a318845c..65d8a316e9ca51ddca73e126e5137aea1f1f14f7 100644 (file)
@@ -114,7 +114,7 @@ let test_types () =
   end;
   
   begin group "qualified_pointer";
   end;
   
   begin group "qualified_pointer";
-    (* XXX: grep {QualPtrTy.*i8.*3.*\*} < %t.ll
+    (* RUN: grep {QualPtrTy.*i8.*3.*\*} < %t.ll
      *)
     let ty = qualified_pointer_type i8_type 3 in
     insist (define_type_name "QualPtrTy" ty m);
      *)
     let ty = qualified_pointer_type i8_type 3 in
     insist (define_type_name "QualPtrTy" ty m);