diff options
author | John McCall <rjmccall@apple.com> | 2010-11-14 08:17:51 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-14 08:17:51 +0000 |
commit | f3ea8cfe6b1c2ef0702efe130561e9e66708d799 (patch) | |
tree | e846d78ad848b43259d6f6a48698f41e4f29e399 /lib/AST/ExprConstant.cpp | |
parent | 81921cc4218e07363b5a0ea031fe775cba9b40c6 (diff) |
Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions; the last batch was specific to promotions.
I think this is the full set we need. I do think dividing the cast
kinds into floating and integral is probably a good idea.
Annotate a *lot* more C casts with useful cast kinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 172a811bee..8a6d4ba7c4 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -2073,7 +2073,14 @@ bool FloatExprEvaluator::VisitCastExpr(CastExpr *E) { Result, Info.Ctx); return true; } - // FIXME: Handle complex types + + if (E->getCastKind() == CK_FloatingComplexToReal) { + ComplexValue V; + if (!EvaluateComplex(SubExpr, V, Info)) + return false; + Result = V.getComplexFloatReal(); + return true; + } return false; } |