[cfe-commits] r55299 - in /cfe/trunk/lib: AST/Expr.cpp CodeGen/CGExprConstant.cpp
Chris Lattner
clattner at apple.com
Mon Aug 25 10:10:49 PDT 2008
On Aug 24, 2008, at 8:27 PM, Anders Carlsson wrote:
> Author: andersca
> Date: Sun Aug 24 22:27:15 2008
> New Revision: 55299
>
> URL: http://llvm.org/viewvc/llvm-project?rev=55299&view=rev
> Log:
> Handle emitting __builtin_huge_valf as a constant expr.
I don't think that this is the right place to put this. For example,
it doesn't handle this (crazy) case:
switch (...) {
case (int) __builtin_huge_valf():
...
I think it would be better to have AST/ExprConstant.cpp handle
constant folding of builtins, and have CGExprConstant.cpp just call
into the constant folding routines when it gets a scalar or complex
element to initialize. This would reduce CGExprConstant.cpp to
handling the aggregate case, which is what makes the most sense for it
to do anyway.
What do you think?
-Chris
More information about the cfe-commits
mailing list