Revert my two IRgen fixes for "bool", then use a far simpler approach
based on ConvertTypeForMem. Thanks to John for pointing out the right
solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112838 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index e0c8280..79e3b22 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -1018,9 +1018,8 @@
     Ptr = Builder.CreateInBoundsGEP(Ptr, GEP.begin(), GEP.end(), "del.first");
   }
 
-  assert(DeleteTy->isBooleanType() || 
-         (ConvertType(DeleteTy) ==
-          cast<llvm::PointerType>(Ptr->getType())->getElementType()));
+  assert(ConvertTypeForMem(DeleteTy) ==
+         cast<llvm::PointerType>(Ptr->getType())->getElementType());
 
   if (E->isArrayForm()) {
     EmitArrayDelete(*this, E->getOperatorDelete(), Ptr, DeleteTy);
diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp
index 85b52c6..eefc530 100644
--- a/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/lib/CodeGen/ItaniumCXXABI.cpp
@@ -305,13 +305,8 @@
 
   // Cast the address to the appropriate pointer type, adopting the
   // address space of the base pointer.
-  // FIXME: We seem to be losing the "volatile" qualifier on the base pointer.
-  QualType PtrType = CGF.getContext().getPointerType(MPT->getPointeeType());
-  Qualifiers Qs = MPT->getPointeeType().getQualifiers();
-  if (AS)
-    Qs.addAddressSpace(AS);
-  PtrType = CGF.getContext().getQualifiedType(PtrType, Qs);
-  const llvm::Type *PType = CGF.ConvertType(PtrType);
+  const llvm::Type *PType
+    = CGF.ConvertTypeForMem(MPT->getPointeeType())->getPointerTo(AS);
   return Builder.CreateBitCast(Addr, PType);
 }