Commit Graph

20 Commits

Author SHA1 Message Date
Alessandro Di Federico cfb47157b9 clang-tidy: readability-identifier-naming
This commit fixes all the non-compliance with our preliminary clang-tidy
configuration, which will be merged soon.
2022-01-07 09:18:05 +01:00
Alessandro Di Federico 6d10581163 Whitespace and other minor changes 2021-07-15 13:30:25 +02:00
Pietro Fezzardi 50681284c0 Conceptify revng
Use concepts across revng wherever possible, to keep the code concise
and easier to understand.
2021-05-05 17:10:12 +02:00
Pietro Fezzardi 9869f057b9 Use #pragma once for header include guards 2020-11-13 14:12:18 +01:00
Pietro Fezzardi cd9bc34d9d Enforce new include conventions 2020-11-13 10:00:24 +01:00
Alessandro Di Federico 8deab9c7ea Whitespace and other minor changes
* Drop unused argument names from function prototypes
* Make `static` some methods
* Disable some copy constructors
* Fix casing of Doxygen `\file` directives
* Add some casts to make the compiler happy
* Initialize `hasRelocationAddend` for AArch64
* Use references in range-for where possible
* Drop default for `switch` statements covering all the entries of an `enum`
* Make some global variables `static`
* Drop dead functions
2020-05-14 11:58:18 +02:00
Alessandro Di Federico 467d25693e MonotoneFramework: support user-provided BB list
Let the user provide the list of the basic blocks to visit, in a
specific order. This is useful when the same graph has to be visited
multiple times to avoid having `MonotoneFramework` recompute the reverse
post order each time.
2019-05-22 18:42:32 +02:00
Alessandro Di Federico 7476eb5cbf MonotoneFramework: allow successors in final BBs
This will be necessary to correctly handle infinite loops.
2019-03-06 10:31:23 +01:00
Pietro Fezzardi 33a8aeb64c MonotoneFramework: drop greaterThan from Lattices
All the definitions of `greaterThan` were `!lowerThanOrEqual`, and all
the uses were implicitly assuming this semantic.
However, this was confusing because in a Lattice the ordering is not
total, hence `!lowerThanOrEqual` is not equivalent to `greaterThan`.

This commit drops the `greaterThan` method altogether to avoid
confusion.
2019-03-06 09:04:58 +01:00
Pietro Fezzardi db2e4b5bdb Improve interface types for MonotoneSet 2019-03-06 09:04:58 +01:00
Alessandro Di Federico 773b33e5f5 Add InterruptCreator in MonotoneFramework
This commit introduces the helper templated struct InterruptCreator,
that is used to provide defaults for the methods
MonotoneFramework::createSummaryInterrupt() and
MonotoneFramework::createNoReturnInterrupt() whenever the Interrupt
template parameter for Monotoneframework is of type
DefaultInterrupt<LatticeElement>.
This frees the implementor of a new MonotoneFramework from the need
to implement those methods in the most common cases.

Whenever Interrupt is DefaultInterrupt<LatticeElement>,
MonotoneFramework::createSummaryInterrupt() aborts, since a summary
should never be generated for those kind of analyses.
Instead, MonotoneFramework::createNoReturnInterrupt() generates a
default Interrupt, since it will never be used.
2019-03-06 09:04:58 +01:00
Alessandro Di Federico 8c49f47f26 Use DefaultInterrupt<LatticeElement> as default
In most cases, a user of MonotoneFramework does not need a
interprocedural analysis, nor an analysis whose results on
terminal labels have to be aggregated in a FinalResults.
DefaultInterrupt<LatticeElement> is designed exactly for those
cases, and is hence used as default template parameter for
MonotoneFramework.
2019-03-06 09:04:58 +01:00
Pietro Fezzardi d16e02a4c4 Add DefaultInterrupt template class
This class provides the simplest possible implementation for an Interrupt
for a Monotone Framework.

In particular this interrupt is suitable for MonotoneFrameworks that are NOT
interprocedural, and that DO NOT need to combine all the results on the
terminal labels at the end of the analysis in a single FinalResult.

With these assumption, the resulting Interrupt is pretty simple and it just
forwards the results of the transfer function.
2019-03-06 09:04:58 +01:00
Pietro Fezzardi 186b2d9a07 Rename isReturn method to isPartOfFinalResults 2019-03-06 09:04:58 +01:00
Pietro Fezzardi 08d0722bef MonotoneFramework: remove public typedef LabelRange 2019-03-06 09:04:58 +01:00
Pietro Fezzardi 4996a06517 MonotoneFramework: remove method extremalLabels
This method was unused.
2019-03-06 09:04:58 +01:00
Pietro Fezzardi a0cd9664ee Add IntersectionMonotoneSet and UnionMonotoneSet
The MonotoneFrameworkSet class had two sets of methods, one for handling
set operations on it, the other handling lattice ordering.
It also silently assumed that the lattice combine operation was the set
union, which is not true in general.

This commit decouples the set operations from the lattice operations.
This allows to provide two separate implementations of
IntersectionMonotoneSet (for which the compbine operation is the set
intersection) and UnionMonotoneSet (for which the combine operation is
the set union).
2019-03-06 09:04:58 +01:00
Alessandro Di Federico b6ee8480da Extend MonotoneFrameworkSet
This commit simply adds a couple of handy methods to
`MonotoneFrameworkSet` such as `begin`, `end`, `erase`, `erase_if`,
`contains` and `size`.
2018-10-16 16:55:12 +02:00
Alessandro Di Federico f305541d5e Introduce MonotoneFramework::handleEdge
In a `MonotoneFramework` it is sometimes necessary to change the
information propagated on a branch w.r.t. another branch.

This commit introduces the `handleEdge` function that allows
`MonotoneFramework` implementors to modify the `LatticeElement` produced
by `transfer`.
2018-10-16 16:52:24 +02:00
Alessandro Di Federico e80b05a48e Move MonotoneFramework.h to libSupport
`MonotoneFramework.h` has been moved into `include/revng/Support` so
that it can be employed by components outside `libStackAnalysis`.
2018-10-16 16:25:29 +02:00