From: Chris Lattner Date: Sun, 26 Aug 2007 07:29:23 +0000 (+0000) Subject: implement a fixme, add a couple more :) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d31beb195eb578881c2489cb464ea4051e5243ef;p=clang implement a fixme, add a couple more :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41441 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp index 223228817c..bbfad651cc 100644 --- a/CodeGen/CGDecl.cpp +++ b/CodeGen/CGDecl.cpp @@ -85,11 +85,15 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) { // If this local has an initializer, emit it now. if (const Expr *Init = D.getInit()) { - if (Init->getType()->isComplexType()) { + if (!hasAggregateLLVMType(Init->getType())) { + llvm::Value *V = EmitScalarExpr(Init); + // FIXME: Handle volatile. + Builder.CreateStore(V, DeclPtr); + } else if (Init->getType()->isComplexType()) { EmitComplexExprIntoAddr(Init, DeclPtr); } else { - // FIXME: This could be much better for aggregates. - EmitStoreThroughLValue(EmitAnyExpr(Init), LValue::MakeAddr(DeclPtr), Ty); + // FIXME: Handle volatile. + EmitAggExpr(Init, DeclPtr, false); } } }