This also reorders the enum, because when two tags collide (they have
the same `from` and `to` points, they are sorted based on the enum
values.
The new order ensures that the values we are more likely to choose
to preserve are closer to the bottom. Since each token can only have one
type associated with it, we choose the lowest one by default.
I found that it leads to better looking code when the check of whether
the range in question even has enough elements to skip is inside
the helper.
As such a separate type of skip entry point was introduced: one that
allows to iterate over the container pairwise
Now, instead of asserting, the loop just does nothing in cases like
```cpp
for (const auto &Element : zip_pairs(make_empty_range())
do_stuff();
```
Drops the comment about an attempt to switch to the absolute targets
and sets `setPrintBranchImmAsAddress` to `false` no matter what
immediate style is selected.
Remove the logic for computing a manager's workdir using the
REVNG_PROJECT_ID environment variable, as it was unused. The
REVNG_DATA_DIR remains to allow persistence across restarts.
Rework how the cache folder for debug information is handled. This
commit introduces an additional environment variable, `REVNG_CACHE_DIR`
that allows overriding where semi-disposable files will be stored.
`IsDynamicallyCalledFrom` is removed in favour of `IsCalledFrom`.
Looking at just how similar the actual uses of both are, there's not
much reason to keep them separate.
We used to ignore CFEPs that matched the starting address of a basic
block of a previously detect function.
We now also exclude such CFEPs even if the candidate is *part* of an
existing block.
This is done mainly so that downstream passes do not need to run
`CollectCFG` to store information that has already been computed but not
serialized.
This come at the cost of computing the CFG also of functions we don't
want to analyze in `DetectABI`.
Implements transforms when the results of sub or add with a constant
operand are compared against constant:
1) x + a == b --> x == b - a
2) x + a != b --> x != b - a
3) x + a <= b --> x <= b - a
4) x + a < b --> x < b - a
5) x + a >= b --> x >= b - a
6) x + a > b --> x > b - a
After the transformation, the right hand side is also enqued for
analysis to detect opporunities to use unary minus if a-b is a negative
constant.
This commit adds the '.h' suffix to the headers used for testing
model-to-header. This enables clang to understand that they are C
headers and suppresses a set of bogus warnings that were otherwise
triggered as -Wunused-command-line-argument.
Namely, the unused arguments it complained about were:
* 'linker'
* '-c'
* '-ferror-limit=0'
* '-I'