mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
02cc6923d0
The `EmitFieldAccesses` pass transforms `clift` by taking pointer-typed expressions computed via integerr arithmetic with type-safe field accesses and array accesses. The transformation is split in three main phases: 1) `PointerArithmetic` computation. 2) `BestTraversal` computation. 3) `FieldAccess` `clift` rewrite. The high level driver is implemented in the `EmitFieldAccesses` header and cpp, while the nested 3 phases are implemented respectively in `PointerArithmetic`, `BestTraversal` and `FieldAccessReplacement`. The `computerPointerArithmetic` phase is concerned with taking a pointer-typed `ExpressionOp`, called `PointerToReplace`, and expressing it in a `BasePointer+Offset` form. The `computeBestTraversal` phase is concerned with computing the best traversal of the type pointed to by `BasePointer`, that can be used to rewrite the pointer arithmetic in `clift` with just field accesses and array subscripts. The `replaceFieldAccess` phase takes the `Traversal` computed at the previous step, and actually rewrites in `clift` the `PointerToReplace` in terms of field accesses and array accesses w.r.t. the `BasePointer`.
rev.ng python package
This python package provides classes that can be used to represent, serialize and deserialize rev.ng models.
It also contains other modules related to various revng CLI tools.
How to install
You probably want to install this package in a virtualenv:
python -m venv <virtualenv_dir>
source <virtualenv_dir>/bin/activate
Installation
To build and install from source:
pip install .
Creating redistributable packages
This command will create a redistributable package in dist:
python setup.py bdist_wheel
The package can be installed using pip:
pip install dist/revng*.whl