aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-31 21:07:58 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-31 21:07:58 +0000
commit3923e95280210ef877153f0c3dbab12d6ed2ad43 (patch)
tree862a01fb001c9f5d6d4f5dd473f795877c0d145b /lib/CodeGen/CGCXX.cpp
parent6d0ffad181215fc4ec0fca37c55eae82df6e0531 (diff)
Support for complex types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 4b8e733f4d..9e20530711 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -295,9 +295,11 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
const Expr *Init = E->getConstructorArg(0);
- if (!hasAggregateLLVMType(AllocType)) {
+ if (!hasAggregateLLVMType(AllocType))
Builder.CreateStore(EmitScalarExpr(Init), NewPtr);
- } else {
+ else if (AllocType->isAnyComplexType())
+ EmitComplexExprIntoAddr(Init, NewPtr, AllocType.isVolatileQualified());
+ else {
ErrorUnsupported(E, "new expression");
return llvm::UndefValue::get(ConvertType(E->getType()));
}