aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-02 23:24:14 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-02 23:24:14 +0000
commitcc09c022bebcabd5f222d410bb6695af0ea93257 (patch)
tree0f43042f0f1a7cf8d6e0c32a57db6687d9e7e429 /lib/CodeGen/CGExprCXX.cpp
parentd4b25cbde13fc973673234f26de48c940723e679 (diff)
Fix a few more ConvertTypes that should be ConvertTypeForMems, fixing
two regressions in Boost.Config. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--lib/CodeGen/CGExprCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 79e3b220ef..a5c1691307 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -754,7 +754,8 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
AllocType);
}
- const llvm::Type *ElementPtrTy = ConvertType(AllocType)->getPointerTo(AS);
+ const llvm::Type *ElementPtrTy
+ = ConvertTypeForMem(AllocType)->getPointerTo(AS);
NewPtr = Builder.CreateBitCast(NewPtr, ElementPtrTy);
if (E->isArray()) {
EmitNewInitializer(*this, E, NewPtr, NumElements, AllocSizeWithoutCookie);
@@ -762,7 +763,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
// NewPtr is a pointer to the base element type. If we're
// allocating an array of arrays, we'll need to cast back to the
// array pointer type.
- const llvm::Type *ResultTy = ConvertType(E->getType());
+ const llvm::Type *ResultTy = ConvertTypeForMem(E->getType());
if (NewPtr->getType() != ResultTy)
NewPtr = Builder.CreateBitCast(NewPtr, ResultTy);
} else {