Commit Graph

6113 Commits

Author SHA1 Message Date
Pietro Fezzardi 8a257a3cdc Merge branch feature/adopt-cabi-prototypes 2022-05-05 14:52:35 +02:00
Alessandro Di Federico fd350de6b4 Merge branch 'feature/adopt-cabi-prototypes' 2022-05-05 14:48:54 +02:00
Alessandro Di Federico f5b3bff9b2 Introduce SegregateStackAccesses tests 2022-05-03 21:50:42 +02:00
Alessandro Di Federico 2e434dbd7e DLA: relax handling of stack arguments
This commit improves how DLA commits its results into
`model::RawFunctionType::StackArgumentsType`.
2022-05-03 21:48:07 +02:00
Alessandro Di Federico f85f08e410 SegregateStackAccesses: handle CABIFunctionType
This commit heavily reworks SegregateStackAccesses in order to have
`llvm::Function`s reflect the prototype in the model.
2022-05-03 21:48:07 +02:00
Alessandro Di Federico 1370763bc4 llvm pipeline: handle - as input 2022-04-29 17:57:49 +02:00
Alessandro Di Federico cafdd7c6f9 Introduce revng model override-by-name 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 9ca3447b5d revng.cli: introduce try_run 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 3c2a7dd5f2 EnforceABI: in case of no prototype, use default 2022-04-29 17:57:49 +02:00
Alessandro Di Federico a4d7e78856 Stop registering Invalid model::Functions 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 92d3b95fba Model: make more things optional 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 291ed672b4 Introduce FunctionType::Layout::dump 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 83f08249d7 Introduce Layout::Argument::StackSpan::operator+ 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 305a6ba69c Isolate: use Attribute::NullPointerIsValid
This enables us to handle memory accesses at nullptr.
2022-04-29 17:57:49 +02:00
Alessandro Di Federico 9e46d4fdcc Introduce getLLVMTypeForScalar(QualifiedType) 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 0e907021e3 EnforceABI: preserve metadata
This is particularly useful for preserving `FunctionTag`s.
2022-04-29 17:57:49 +02:00
Alessandro Di Federico 2e933cde6b Dynamic functions: use OriginalName
`OriginalName` is the key.
2022-04-29 17:57:49 +02:00
Alessandro Di Federico 0f3c29fa1b Split moveToNewFunctionType off changeFunctionType 2022-04-29 17:57:49 +02:00
Alessandro Di Federico a355a90c7e model::Binary::getPointerTo(model::QualifiedType) 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 85e031c218 FunctionType::Layout: construct from model::Type 2022-04-29 17:57:49 +02:00
Alessandro Di Federico 4904f8cbe1 GeneratorIterator: simplify iterators 2022-04-29 17:57:49 +02:00
Massimo Fioravanti 016a9464b8 Model diff: handle UpcastablePointer correctly 2022-04-29 17:57:49 +02:00
Alessandro Di Federico e6f6010cfd Build with -fvisibility-inlines-hidden
`-fvisibility-inlines-hidden` ensures that each dynamic library uses its
own version of each `inline` function.

This reduces the number of exported symbols and resolves issues related
to picking a version of a weak symbol that has already been deleted upon
`dlclose`.

The downside of this flag is that the address of `inline` functions can
be different across different libraries. This commit drops certain
assertions that were relying on this behavior.
2022-04-29 16:40:24 +02:00
Alessandro Di Federico 890829cbb9 Build with -fvisibility-inlines-hidden
`-fvisibility-inlines-hidden` ensures that each dynamic library uses its
own version of each `inline` function.

This reduces the number of exported symbols and resolves issues related
to picking a version of a weak symbol that has already been deleted upon
`dlclose`.
2022-04-29 16:40:15 +02:00
Pietro Fezzardi 0b64b58e84 Unify recompilation tests
Before this commit we were using xargs to speed-up recompilation tests,
which kinda sucked because:
- it spawned a lot of processes, one for each file to recompile
- the runtime of each test was dominated by parsing the headers, that
  were included over and over again in each C file

Now we collapse all the C files together, which gives us 2 benefits:
- we only spawn a single process for each recompilation test, meaning
  that cmake can do a better job at parallelizing without starving
  others
- the headers are included and parsed only once, speeding up the
  compilation further
2022-04-29 15:04:27 +02:00
Alessandro Di Federico 13bf5a7171 Merge branch 'feature/resourcefinder-use-self-maps' 2022-04-28 22:19:01 +02:00
Giacomo Vercesi 168eab6cc5 Use /proc/self/maps to determine root
Use the path of the mapped librevngSupport.so to determine the root
directory.
2022-04-28 22:18:08 +02:00
Giacomo Vercesi 91067a8886 getCurrentExecutableFullPath: assert on error
`getCurrentExecutableFullPath` now aborts if it cannot determine the
real path instead of returning an empty string.
2022-04-28 22:10:14 +02:00
Giacomo Vercesi d109a68bc4 Remove BUILD_PATH
It has not been relevant for a long time.
2022-04-28 22:10:02 +02:00
Alessandro Di Federico fe9b125aa4 Merge branch 'feature/revng-check-conventions-fix' 2022-04-28 09:47:49 +02:00
Giacomo Vercesi 23362444b8 check-conventions: improve file list generation
Improves the generation of the file list by using git diff-files and
parsing the output directly.

Also:

* The list now only includes files that exist in the working directory
  (so no existence checks are needed).
* Added `--cached` option to check staged files only.
* Fix some missing local variable declarations.
2022-04-28 09:46:10 +02:00
Giacomo Vercesi 7c64831835 revng-check-conventions: install configurations
Fix bug in revng-check-conventions that caused config files to not
be present in the install directory and to not be looked for if run
from there.
2022-04-28 09:45:52 +02:00
Alessandro Di Federico e0dac4e27d Merge branch 'feature/string-map-container-usability' 2022-04-28 08:32:40 +02:00
Pietro Fezzardi e9470d031d Add std::map-like methods to StringMapContainer 2022-04-27 17:40:21 +02:00
Pietro Fezzardi de0398754d Add makeStringMapContainerFactory 2022-04-27 17:09:28 +02:00
Pietro Fezzardi da44302bba Fix StringMapContainer::remove on isAll target
Before this commit, the container did not properly remove everything
when removing a wildcard * target.
2022-04-27 17:08:13 +02:00
Pietro Fezzardi 150ee39289 Drop old unused ReachabilityPass 2022-04-26 18:15:44 +02:00
Pietro Fezzardi 2c9829f042 Backend: skip dumpToString call when Loggers off
This brings a huge speedup to the new decompiler backend.
2022-04-26 18:12:08 +02:00
Alessandro Di Federico 72d0c5776f Merge branch 'feature/python-api-graphql' 2022-04-26 16:08:07 +02:00
Giacomo Vercesi b9794b84bb revng.daemon: introduce tests
Add end-to-end tests checking that every GraphQL endpoint is properly
working and returning the expected result
2022-04-26 15:59:35 +02:00
Giacomo Vercesi 4f7908753e Introduce the revng-daemon command 2022-04-26 15:59:35 +02:00
Giacomo Vercesi 172faebacf Introduce the revng.daemon GraphQL API
This commit introduces the `revng.daemon` Python module, a Flask-powered
web application that exposes the functionality from `revng.api` across a
GraphQL API
2022-04-26 15:59:35 +02:00
Giacomo Vercesi 7231ee607a Introduce PipelineC wrapper for Python
Add the revng.api module: a wrapper around the PipelineC API.
2022-04-26 15:59:35 +02:00
Giacomo Vercesi 4445a841b2 revng-pipeline: introduce artifacts
Add a new key to a Step, named Artifacts. If present, it indicates that
the step has a "default" Kind and Container that can be easily retrieved
without explicitly specifying either when producing an artifact.
2022-04-26 15:59:35 +02:00
Giacomo Vercesi 99ae9c98e0 Add MIMEType to container
Add additional field MIMEType to Container.

This allows API consumers to know at runtime how to treat the data
within a container without any prior knowledge.
2022-04-26 15:59:35 +02:00
Pietro Fezzardi f6db74abbc Use xargs for parallel recompilation tests 2022-04-26 15:43:23 +02:00
Giacomo Vercesi f4d63759de PipelineC: expose kinds, ranks and more
Adds missing API functions to PipelineC that will be needed by the
GraphQL API:

* Kinds enumeration
* Get Rank and parent of a Kind
* Enumerate and inspect Ranks
* Get a Step's parent

Included are some docstring fixes
2022-04-26 15:05:30 +02:00
Giacomo Vercesi 87b09fd401 PipelineC: Refactor headers
Split PipelineC.h in 4 separate header, this is due to cffi not
being able to interpret `#ifdef`s so C++ declarations need to be
in a separate file.
2022-04-26 15:05:30 +02:00
Giacomo Vercesi e5c9141ccc Refactor revng.cli.support
* Removed shadowed `relative` function
* Clean up imports
* Add type hints to functions
* Use Path where possible
2022-04-26 15:05:30 +02:00
Giacomo Vercesi b90773b642 Move librevngRecompile to analyses 2022-04-26 15:05:30 +02:00