This commit reorders the argument passed to various `printDeclaration`
and `printDefinition` helper functions, to make them more uniform across
each other, and to accept the same arguments in the same order.
Improve the logic of the first iteration outline:
1) The cloning of the nodes involved in the first iteration outlining,
is now performed with a series of DFS visits from all the late entry
nodes in the `MetaRegion`, instead of performing a blind clone of all
the nodes and removing those not needed.
2) Restoring the edges between the cloned nodes has been subject to
minor changes.
3) The outline nodes are now assigned to a `MetaRegion` using a new
logic, instead of blindly assigning them to the parent `MetaRegion`.
We now explicitly store the retreatings edges, that will eventually be
connected to the `continue` nodes, so that we can explicitly handle
them, without resorting to iterating over the predecessors of the
`EntryNode`, which although correct is a fragile method with respect to
defective situations.
In addition, we check that after the restructuring, all the retreating
edges that we connect to `continue` nodes, do point to the `EntryNode`
before the transformation.
We now implement the `nodesBetween` primitive with a double DFS visit.
Specifically, we have:
1) A forward DFS that starts from the `Source`, and stops at `Target`.
2) A backward DFS that starts from the `Target`, and stops at `Source`.
The final result is then the intersection of the nodes found by the two
above DFS visits.
A new `findReachableNodes` primitive is also added to perform a DFS from
a `Source` node, which stops at the `Stop` parameter node, if present.
Added unit tests to improve the coverage.
- Add PrepareLLVMIRForMLIR Pass.
This Pass performs massaging of the LLVM IR
produced by revng so it can be parsed/accepted
for the LLVM MLIR Dialect.
- Introduce new pipeline branch: llvmir-to-mlir.yml.
- Add LLVMIRToMLIR step.
- Add ImportLLVMToMLIRPipe pipe.
This commit sets a name for types we use in OpaqueExtractValues.
These are StructTypes that can only be returned from isolated functions
with RawFunctionType prototype on the model, or from helpers that do not
represent isolated functions.
The name is required because when we will converto to MLIR LLVM Dialect,
there are checks in place that forbid unnamed types.
The code re-uses code that is used to print C code, in order to make
sure that the struct names we use for this are the same as those we emit
in C, to ease debugging.
This commit also cleans up the unittest to make it more concise, while
still testing the same things.
Add the PipelineDescription object that describes the structure of a
pipeline. This will be used by all the downstream users instead of
pipeline accessor methods via PipelineC.
This commit changes the following method names across the codebase:
* `storeToDisk` -> `store`
* `loadFromDisk` -> `load`
This has been done since the storage is no longer bound to the local
storage.
Change the serialization and deserialzation functions of
`FunctionStringMap` to use the GzipTarFile. Also change che filename
of the underlying containers accordingly.
This commit adds the following enhancements to `TemporaryFile`:
* Adds TemporaryFile::make to allow catching the error if the temporary
file creation fails
* Fix the move assignment, as it would leak the original file until shutdown
* Fix the destructor, as it would be called even on a moved object
The Decompiled container (which use FunctionStringMap) now uses
`.tar.gz` as the container format, as opposed to YAML. Change the
filename of the containers accordingly.
This commit introduces the concept of `Component` to a pipeline step.
This, in turn, can be used by clients to figure out which artifacts are
produced by which revng component.
Additionally, this commit overhauls the `revng daemon-self-test`
command, renaming it to `revng graphql` and adding extra flexibility.
This commit:
* Introduces `_` as a prefix for all non-user entities we emit in
decompiled code.
Also, some names have been changed to be more concise.
Specifically, the following entities have changed:
`_ENUM_UNDERLYING`, `_ABI`, `_REG`, `_padding_at_`,
`_artificial_struct_`, `_artificial_wrapper_`, `_stack`,
`_break_from_loop_`, `_var_`, `_stack_arguments`,
`_artificial_struct_returned_`, `_enum_max_value_`.
* Introduce _PACKED for `__attribute__((packed))`.
* `EnumEntry` name: drop the `EnumType` name prefix.
This commit improves the formalization of how we handle names.
The main changes are:
* Now `_` is a reserved prefix and all the generated names start with
`_`.
* The model verification routine now checks that `CustomName`s in the
global scope do not collide with any local namespace (e.g., fields of
a `StructType`).
* We changed the prefix `prefix_` to `unreserved_` to better convey the
fact that the prefix has been introduce to use an non-reserved name.
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.
On top of this, this commit introduces the following changes:
* TypeCopier: import all the necessary PrimitiveTypes and improve
handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
`Binary.recordNewType(makeType<model::*Type>())`.