Address some of Anders comments

llvm-svn: 91670
This commit is contained in:
Douglas Gregor 2009-12-18 05:19:44 +00:00
parent e1314a64b8
commit 357b6fd3e5
1 changed files with 8 additions and 4 deletions

View File

@ -579,10 +579,14 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest,
const Expr *Arg = E->getArg(0);
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
if (isa<CXXBindTemporaryExpr>(ICE->getSubExpr()))
Arg = cast<CXXBindTemporaryExpr>(ICE->getSubExpr())->getSubExpr();
} else if (const CXXBindTemporaryExpr *BindExpr =
dyn_cast<CXXBindTemporaryExpr>(Arg))
assert((ICE->getCastKind() == CastExpr::CK_NoOp ||
ICE->getCastKind() == CastExpr::CK_ConstructorConversion) &&
"Unknown implicit cast kind in constructor elision");
Arg = ICE->getSubExpr();
}
if (const CXXBindTemporaryExpr *BindExpr =
dyn_cast<CXXBindTemporaryExpr>(Arg))
Arg = BindExpr->getSubExpr();
EmitAggExpr(Arg, Dest, false);