[cfe-dev] Constant expression checking rewrite
Ted Kremenek
kremenek at apple.com
Sat May 17 21:30:38 PDT 2008
On May 16, 2008, at 7:26 PM, Eli Friedman wrote:
> I'm not exactly sure why the DeadStores pass cares if the value is
> constant; maybe it should just be checking for zero and other common
> "dummy" initializations?
I found that defining the scope of dummy initializations is not really
tractable. Simply checking for a constant assignment was 99% accurate
in pruning out dead stores resulting from defensive programming.
Aside from the dead store checker, I can see other cases in the static
analyzer (and other clients such as refactoring) where knowing whether
or not an expression is a constant expression is very useful.
More information about the cfe-dev
mailing list