analyzer: avoid use of fold_build2
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 30 Jan 2020 20:23:40 +0000 (15:23 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Mon, 3 Feb 2020 19:31:15 +0000 (14:31 -0500)
commit833f1e66e3a8efdbb941a44ac9e74101d771e0d5
tree040579e351f6bb29bcfd37aa73ec740e94d52d34
parent8525d1f5f57b11fe04a97674cc2fc2b7727621d0
analyzer: avoid use of fold_build2

Various places in the analyzer use fold_build2, test the result, then
discard it.  It's more efficient to use fold_binary, which avoids
building and GC-ing a redundant tree for the cases where folding fails.

gcc/analyzer/ChangeLog:
* constraint-manager.cc (range::constrained_to_single_element):
Replace fold_build2 with fold_binary.  Remove unnecessary newline.
(constraint_manager::get_or_add_equiv_class): Replace fold_build2
with fold_binary in two places, and remove out-of-date comment.
(constraint_manager::eval_condition): Replace fold_build2 with
fold_binary.
* region-model.cc (constant_svalue::eval_condition): Likewise.
(region_model::on_assignment): Likewise.
gcc/analyzer/ChangeLog
gcc/analyzer/constraint-manager.cc
gcc/analyzer/region-model.cc