summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
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
commit040ad500c4c2bdf56f73f1d6ac9b287bc3b2828c (patch)
treec3dadb16cddc320100326b172674e01fe5a488ae /clang/lib/CodeGen
parentfc561bad880d56869ee75a2e36fa43358b73510f (diff)
downloadbcm5719-llvm-040ad500c4c2bdf56f73f1d6ac9b287bc3b2828c.tar.gz
bcm5719-llvm-040ad500c4c2bdf56f73f1d6ac9b287bc3b2828c.zip
Fix a few more ConvertTypes that should be ConvertTypeForMems, fixing
two regressions in Boost.Config. llvm-svn: 112908
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp
index 79e3b220ef9..a5c16913078 100644
--- a/clang/lib/CodeGen/CGExprCXX.cpp
+++ b/clang/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 {
OpenPOWER on IntegriCloud