diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-02-26 09:29:13 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-02-26 09:29:13 +0000 |
commit | e28d7195aad595154130ac8d03cc6c6513ece1bf (patch) | |
tree | a0aa8e0dc9facebaa102c59a504efe42f94a0864 /lib/AST/ExprConstant.cpp | |
parent | 2488261836ba56feaa221153336ab7a9a14d88dc (diff) |
Rewrite of isIntegerConstantExpr to be centered around Evaluate. This
is a rather big change, but I think this is the direction we want to go;
the code is significantly shorter now, and it doesn't duplicate Evaluate
code. There shouldn't be any visible changes as far as I know.
There has been some movement towards putting ICE handling into
Evaluate (for example, VerifyIntegerConstantExpression uses Evaluate
instead of isICE). This patch is sort of the opposite of the approach,
making ICE handling work without Evaluate being aware of it. I think
this approach is better because it separates the code that does the
constant evaluation from code that's calculating a rather
arbitrary predicate.
The one thing I don't really like about this patch is that
the handling of commas in C99 complicates it signficantly. (Seriously,
what was the standards committee thinking when they wrote that
part?) I think I've come up with a decent approach, but it doesn't feel
ideal. I might add some way to check for evaluated commas from Evaluate
in a subsequent patch; that said, it might not be worth bothering.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
0 files changed, 0 insertions, 0 deletions