[cfe-commits] r112838 - in /cfe/trunk/lib/CodeGen: CGExprCXX.cpp ItaniumCXXABI.cpp

Douglas Gregor dgregor at apple.com
Thu Sep 2 10:38:50 PDT 2010


Author: dgregor
Date: Thu Sep  2 12:38:50 2010
New Revision: 112838

URL: http://llvm.org/viewvc/llvm-project?rev=112838&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/CodeGen/CGExprCXX.cpp
    cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=112838&r1=112837&r2=112838&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Thu Sep  2 12:38:50 2010
@@ -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);

Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=112838&r1=112837&r2=112838&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Thu Sep  2 12:38:50 2010
@@ -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);
 }
 





More information about the cfe-commits mailing list