diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-09 21:33:21 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-09 21:33:21 +0000 |
commit | 0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3 (patch) | |
tree | 244e1626acebcedf768fd386036799602daa598c /lib/CodeGen/CGExprAgg.cpp | |
parent | cfcd7fd0de701c5ce05e96de1ed2d0bf8c7035d9 (diff) |
If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 8bda0f3e36..2e7e868616 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -184,19 +184,12 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) { LValue::MakeAddr(CastPtr, 0)); return; } - if (E->getCastKind() == CastExpr::CK_UserDefinedConversion) { - if (const CXXFunctionalCastExpr *CXXFExpr = - dyn_cast<CXXFunctionalCastExpr>(E)) - CGF.EmitCXXFunctionalCastExpr(CXXFExpr); - else - if (isa<CStyleCastExpr>(E)) - Visit(E->getSubExpr()); - return; - } // FIXME: Remove the CK_Unknown check here. assert((E->getCastKind() == CastExpr::CK_NoOp || - E->getCastKind() == CastExpr::CK_Unknown) && + E->getCastKind() == CastExpr::CK_Unknown || + E->getCastKind() == CastExpr::CK_UserDefinedConversion || + E->getCastKind() == CastExpr::CK_ConstructorConversion) && "Only no-op casts allowed!"); assert(CGF.getContext().hasSameUnqualifiedType(E->getSubExpr()->getType(), E->getType()) && |