[cfe-commits] r88695 - /cfe/trunk/lib/CodeGen/CGCXXExpr.cpp
Fariborz Jahanian
fjahanian at apple.com
Fri Nov 13 13:20:14 PST 2009
Author: fjahanian
Date: Fri Nov 13 15:20:14 2009
New Revision: 88695
URL: http://llvm.org/viewvc/llvm-project?rev=88695&view=rev
Log:
Fixes a code gen. bug for array delete operator call
int 32bit abi (pr5472 related).
-This line, and those below, will be ignored--
M lib/CodeGen/CGCXXExpr.cpp
Modified:
cfe/trunk/lib/CodeGen/CGCXXExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXXExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXExpr.cpp?rev=88695&r1=88694&r2=88695&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXXExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXXExpr.cpp Fri Nov 13 15:20:14 2009
@@ -284,12 +284,15 @@
llvm::Value *NumElementsPtr =
Builder.CreateConstInBoundsGEP1_64(AllocatedObjectPtr,
CookieOffset);
+ NumElementsPtr = Builder.CreateBitCast(NumElementsPtr,
+ ConvertType(SizeTy)->getPointerTo());
- NumElementsPtr =
- Builder.CreateBitCast(NumElementsPtr,
- llvm::Type::getInt64Ty(VMContext)->getPointerTo());
llvm::Value *NumElements =
Builder.CreateLoad(NumElementsPtr);
+ NumElements =
+ Builder.CreateIntCast(NumElements,
+ llvm::Type::getInt64Ty(VMContext), false,
+ "count.tmp");
assert (!Dtor->isVirtual() && "delete [] with virtual dtors NYI");
EmitCXXAggrDestructorCall(Dtor, NumElements, Ptr);
Ptr = AllocatedObjectPtr;
More information about the cfe-commits
mailing list