diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-18 05:19:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-18 05:19:44 +0000 |
commit | 357b6fd3e5db431068f4922293de2b7fc346fcd4 (patch) | |
tree | 8c02ed266a122121e3bd00bdfee3ac88ec38a52e /clang/lib/CodeGen | |
parent | e1314a64b803bfffe98bd43f9131e512fd7191dd (diff) | |
download | bcm5719-llvm-357b6fd3e5db431068f4922293de2b7fc346fcd4.tar.gz bcm5719-llvm-357b6fd3e5db431068f4922293de2b7fc346fcd4.zip |
Address some of Anders comments
llvm-svn: 91670
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 21f3e00ac07..011257b7499 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -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); |