isl_union_map.c: gen_bin_op: unify callbacks
commitcedb8cc7427212ac083c68e694b95413f0919f9a
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Thu, 11 May 2017 09:51:56 +0000 (11 11:51 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Mon, 12 Jun 2017 13:48:50 +0000 (12 15:48 +0200)
tree2cdd41f4ca83f1cfd53025fc6ff7723a8749b950
parent3635128e1296919e703e754ff17a1f4a41aa8854
isl_union_map.c: gen_bin_op: unify callbacks

Aside from the actual isl_map function that gets applied
to combine the maps from the two inputs, the callers of gen_bin_op
only differ in how they determine which map in the second input
corresponds to a given map in the first input and in how they
react when this second map is missing.  In particular, in case
of "subtract" operations, the map from the first input is copied
to the output, while in the other operations, the map is ignored.

Replace these callbacks by a single callback that performs
these operations based on input set by the caller of gen_bin_op,
in particular, whether the operation is a "subtract" operation,
a function to derive the space of the matching map in the second union map
and the function that should be applied to the matching maps
to produce a map in the output.

This removes some code duplication and makes it easier
to add additional binary operations on union maps.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_union_map.c