Commit Graph

234 Commits

Author SHA1 Message Date
Andrea Gussoni 71988af041 Fix MIT license 2025-04-30 16:10:54 +02:00
Giacomo Vercesi 9ff471409e Remove some asserts from YAMLTraits
More soft-fails instead.
2025-04-28 12:58:27 +02:00
Ivan Krysak 7d409ab4a7 KeyedObjectContainer: support llvm::StringRef 2025-04-17 11:19:17 +03:00
Ivan Krysak 6c6cf04d11 STLExtras: rename is_contained_if into any_of
This improves consistency with the names llvm uses.
2025-04-15 16:35:42 +03:00
Ivan Krysak 0bd174c07f STLExtras: fix an ambiguous find_if call 2025-04-15 16:35:42 +03:00
Lauri Vasama c472dd3cae Move ScopedExchange to revng/ADT/ 2025-03-19 12:57:19 +02:00
Giacomo Vercesi 72d9b46e4b Error.h: improve joinErrors
Change the `joinError` functions to have stronger guarantees when used:
* Change the template signature to `RangeOf` to ensure that the
  container has `llvm::Error`s.
* Check that the size of the passed container is actually positive
  before deferencing `.begin()`.
2025-03-13 15:07:25 +01:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak d4ab801ab7 Rename range_with_value_type into RangeOf
Original name was reminiscent of the STL, but there's no such concept
in there, as such it's probably better to use revng naming convention
instead.
2025-02-13 13:09:50 +02:00
Ivan Krysak f5314e45d8 SortedVector: allow constexpr construction 2025-02-13 13:09:50 +02:00
Ivan Krysak 3b354f2590 TrackingContainer: allow comparisons with wrapped 2025-02-13 13:09:50 +02:00
Ivan Krysak 929cb4b35b Minor improvements 2025-02-13 13:09:50 +02:00
Pietro Fezzardi f81bbcc754 Add new EagerMaterializationRangeIterator
Introduce the `EagerMaterializationRangeIterator`, which substitutes the
`GeneratorIterator`, and is used to materialize the successors of a
node in the `ScopeGraph`.

In addition, remove the `GeneratorIterator`.
2025-01-15 11:48:28 +01:00
Andrea Gussoni fa69bd24e5 ScopeGraph: introduce the ScopeGraph
Introduce the `ScopeCloser` and `GotoTarget` annotations in the IR, and
the relative necessary machinery, needed to handle scope closer and goto
edges for the new backend.

A specialization of the `llvm::GraphTraits`, called `ScopeGraph`, that
is able to handle both the above mentioned annotations is provided.

For the `llvm::GraphTraits` implementation, we introduce the
`GeneratorIterator` class, which uses a coroutine to store the status of
the iteration.

A debug logger pass is added, so that we are able to test the
functionality with `FileCheck`.
2024-12-05 15:43:57 +01:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak 1eb80ecd2d Introduce an error creation helper 2024-11-06 15:20:37 +02:00
Alessandro Di Federico ac31e804fe Import revng-c's STLExtras.h 2024-10-31 17:19:51 +01:00
Giacomo Vercesi 5b200df81a Implement ZstdStream
Implement the `zstdCompress` and `zstdDecompress` functions. Also
implement the `ZstdCompressedOstream` which is a `llvm::raw_ostream`
which compresses data on the fly.
2024-10-30 21:57:55 +01:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 2fd7f06843 ZipMapIterator: handle llvm::StringMap 2024-09-27 12:07:16 +02:00
Andrea Gussoni 70734496f3 GenericGraph: remove Undirected
Remove the `Undirected` `GraphTraits`
2024-09-20 16:08:50 +02:00
Andrea Gussoni eeca8f781c GenericGraph: introduce Undirected
Introduce the `Undirected` GraphTraits, which treats a `MutableEdgeNode`
`GenericGraph` as an undirected graph.

The trait uses the newly introduced `UndirectedChildIterator`, which is
a special custom iterator to get successors and predecessors
concatenated together.

Add some unit tests for `UndirectedChildIterator`.
2024-08-12 12:32:45 +02:00
Andrea Gussoni c32a4776ab GenericGraph: edge traits for llvm::Inverse 2024-08-12 12:32:45 +02:00
Ivan Krysak 9a3086694b UpcastablePointer: do not crash on empty print 2024-06-27 11:05:52 +02:00
Ivan Krysak fbe1416aa2 ConstexprString: add operator* 2024-06-27 11:05:52 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 9e0f0f72f5 RecursiveCoroutine: add operator! 2024-06-27 11:05:51 +02:00
Ivan Krysak e2e95721cc UpcastablePointer: add a new copy constructor 2024-06-27 11:05:51 +02:00
Ivan Krysak 3c64d9b6c8 Concepts: introduce ConstPtrIfConst 2024-06-27 11:05:51 +02:00
Ivan Krysak e268b854cc Concepts: introduce NonBaseDerived 2024-06-27 11:05:50 +02:00
Ivan Krysak 1f16a5bee6 KeyedObjectContainers: add erase_if 2024-06-27 11:05:50 +02:00
Ivan Krysak 73c43add70 TupleTree: revamp the visitors 2024-06-27 11:05:50 +02:00
Ivan Krysak c76f7488d2 YAMLTraits: leave kind-less pointers empty 2024-06-27 11:05:50 +02:00
Ivan Krysak d4bb646708 UpcastablePointer: improve nullptr robustness 2024-06-27 11:05:50 +02:00
Ivan Krysak 284699967f UpcastablePointer: introduce bool operator
This allows writing stuff like
```cpp
if (UpcastablePointer P = getPointerFromSomewhere())
  doSomething(*P);
```
which makes it even more pointer-like.
2024-06-27 11:05:50 +02:00
Ivan Krysak 2dfdff992d UpcastablePointer: introduce copy helper 2024-06-27 11:05:49 +02:00
Ivan Krysak efc24dee4b UpcastablePointer: introduce empty helper 2024-06-27 11:05:49 +02:00
Ivan Krysak 6a1018b860 Remove unused linter suppressors 2024-06-27 11:05:48 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Ivan Krysak b2959e36df Minor improvements 2024-06-27 11:05:48 +02:00
Alessandro Di Federico b5f7576573 Rework TupleTreeGenerator tracking 2024-06-20 10:24:50 +02:00
Massimo Fioravanti f783868dde Model: adopt tryGet instead of find() != end() 2024-06-20 09:57:36 +02:00
Alessandro Di Federico bf6cefc05a Externalize functions to improve build times 2024-05-03 21:52:40 +02:00
Alessandro Di Federico fe1dffcffd Add some missing includes
This is in preparation of reducing headers in Debug.h.
2024-05-03 21:52:40 +02:00
Alessandro Di Federico 25c7834b21 Introduce test_adt
This should reduce build times.
2024-05-03 21:52:40 +02:00
Alessandro Di Federico ab3d546b0a Introduce GenericGraph::dumpGraph() 2024-04-18 17:50:33 +02:00
Alessandro Di Federico dcfb4621a7 Improve GenericGraph::verify 2024-04-18 17:50:33 +02:00
Alessandro Di Federico d36d0184d3 SerializableGraph: fix template usage 2024-04-18 17:50:32 +02:00
Alessandro Di Federico a1b0ba752c GenericGraph: implement Edge::operator==
This fixes a subtle bug in GenericGraph. Basically, if the label of an
Edge was the Empty data structure, whose `operator==` always returns
`true`, the comparison between edges was broken.
2024-04-18 17:50:32 +02:00