aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-02 17:38:50 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-02 17:38:50 +0000
commiteede61a83e90f3cb03ef8665b67d648dccd6ce42 (patch)
treeed9ccac40efa390b2804d956a8758c48f6613dfb
parentc5ade2e3644a5822df63e442788d68c591ccdc97 (diff)
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
-rw-r--r--lib/CodeGen/CGExprCXX.cpp5
-rw-r--r--lib/CodeGen/ItaniumCXXABI.cpp9
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index e0c8280e6b..79e3b220ef 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -1018,9 +1018,8 @@ void CodeGenFunction::EmitCXXDeleteExpr(const CXXDeleteExpr *E) {
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 85b52c6322..eefc530ccf 100644
--- a/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/lib/CodeGen/ItaniumCXXABI.cpp
@@ -305,13 +305,8 @@ llvm::Value *ItaniumCXXABI::EmitMemberDataPointerAddress(CodeGenFunction &CGF,
// 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);
}