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/CGExpr.cpp | |
| parent | cfcd7fd0de701c5ce05e96de1ed2d0bf8c7035d9 (diff) | |
| download | clang-0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3.tar.gz clang-0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3.tar.bz2 clang-0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3.tar.xz | |
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/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 969b789d51..dde6899c29 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1158,19 +1158,11 @@ LValue CodeGenFunction::EmitConditionalOperator(const ConditionalOperator* E) { /// all the reasons that casts are permitted with aggregate result, including /// noop aggregate casts, and cast from scalar to union. LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { - if (E->getCastKind() == CastExpr::CK_UserDefinedConversion) { - if (const CXXFunctionalCastExpr *CXXFExpr = - dyn_cast<CXXFunctionalCastExpr>(E)) - return LValue::MakeAddr( - EmitCXXFunctionalCastExpr(CXXFExpr).getScalarVal(), 0); - assert(isa<CStyleCastExpr>(E) && - "EmitCastLValue - Expected CStyleCastExpr"); - return EmitLValue(E->getSubExpr()); - } - // If this is an aggregate-to-aggregate cast, just use the input's address as // the lvalue. - if (E->getCastKind() == CastExpr::CK_NoOp) + if (E->getCastKind() == CastExpr::CK_NoOp || + E->getCastKind() == CastExpr::CK_ConstructorConversion || + E->getCastKind() == CastExpr::CK_UserDefinedConversion) return EmitLValue(E->getSubExpr()); // If this is an lvalue cast, treat it as a no-op. |
