Make initialization of complex vars work.

llvm-svn: 41426
This commit is contained in:
Chris Lattner 2007-08-26 05:13:54 +00:00
parent a01d898ff5
commit 9de9527ad6
1 changed files with 6 additions and 2 deletions

View File

@ -85,8 +85,12 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) {
// If this local has an initializer, emit it now.
if (const Expr *Init = D.getInit()) {
// FIXME: This could be much better for aggregates / complex.
EmitStoreThroughLValue(EmitAnyExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
if (Init->getType()->isComplexType()) {
EmitComplexExprIntoAddr(Init, DeclPtr);
} else {
// FIXME: This could be much better for aggregates.
EmitStoreThroughLValue(EmitAnyExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
}
}
}