projects
/
profile
/
ivi
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec1949e
)
Fold constant expressions in if conditionals.
author
Eric Anholt
<eric@anholt.net>
Tue, 6 Apr 2010 17:07:20 +0000
(10:07 -0700)
committer
Eric Anholt
<eric@anholt.net>
Tue, 6 Apr 2010 18:42:34 +0000
(11:42 -0700)
Fixes up 3 more expressions in CorrectParse2.frag.
ir_constant_folding.cpp
patch
|
blob
|
history
diff --git
a/ir_constant_folding.cpp
b/ir_constant_folding.cpp
index
306f211
..
b9dee37
100644
(file)
--- a/
ir_constant_folding.cpp
+++ b/
ir_constant_folding.cpp
@@
-127,5
+127,9
@@
ir_constant_folding_visitor::visit(ir_return *ir)
void
ir_constant_folding_visitor::visit(ir_if *ir)
{
- (void) ir;
+ ir_constant *const_val = ir->condition->constant_expression_value();
+ if (const_val)
+ ir->condition = const_val;
+ else
+ ir->condition->accept(this);
}