From 3498bdb9e9cb300de74c7b51c92608e2902b2348 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 29 Jan 2009 17:44:32 +0000 Subject: Introduce a new expression node, ImplicitValueInitExpr, that represents an implicit value-initialization of a subobject of a particular type. This replaces the (ab)use of CXXZeroValueInitExpr within initializer lists for the "holes" that occur due to the use of C99 designated initializers. The new test case is currently XFAIL'd, because CodeGen's ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be taught to value-initialize when it sees ImplicitValueInitExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprAgg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CGExprAgg.cpp') diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index b487bacc71..f985763b5c 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -339,10 +339,10 @@ void AggExprEmitter::EmitNonConstInit(InitListExpr *E) { void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) { // FIXME: Are initializers affected by volatile? - if (E->getType()->isComplexType()) { - CGF.EmitComplexExprIntoAddr(E, LV.getAddress(), false); - } else if (isa(E)) { + if (isa(E)) { EmitNullInitializationToLValue(LV, E->getType()); + } else if (E->getType()->isComplexType()) { + CGF.EmitComplexExprIntoAddr(E, LV.getAddress(), false); } else if (CGF.hasAggregateLLVMType(E->getType())) { CGF.EmitAnyExpr(E, LV.getAddress(), false); } else { -- cgit v1.2.3