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/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);
}