math: store all constant EXPR_BINOP results
commit56de2ac7cd9530735548ed5a1f3378a986c8edf5
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Oct 2020 08:48:39 +0000 (23 11:48 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Oct 2020 08:48:39 +0000 (23 11:48 +0300)
treeaecae64768bb03d733096171f16068430a168802
parentf7961e241707b69c546360f93ab74777c2ccaafe
math: store all constant EXPR_BINOP results

Smatch was caching the results when the whole big expression was constant
but that didn't work for huge expressions where only half of it was
known.

The fix for this is that there is actually unused space in the expression
struct where we can store any constant results.  In practice the hugest
expressions are always BINOPs so this is a good speed up.  Probably I can
remove the cache entirely now.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
expression.h
smatch.h
smatch_math.c