Commit Graph

6113 Commits

Author SHA1 Message Date
Giacomo Vercesi dab9369942 ContainerFactory: expose mime type
Allow retrieving the mimetype of a container without having to
materialize it in the pipeline.
2023-09-14 15:44:32 +02:00
Giacomo Vercesi aa8eb26028 S3StorageClient: fix bug in generateNewFilename
Fix a corner-case where an '/' would be erroneously prepended if the
Path did not contain a directory name.
2023-09-14 15:44:32 +02:00
Alessandro Di Federico 26310efc1c TypeCopier::copyTypeInto: fix returning wrong type
TypeCopier::copyTypeInto used to return a random type among those just
created instead of the new version of the originally requested type.
2023-09-11 14:15:37 +02:00
Pietro Fezzardi c04b96f72a DLA: RemoveBackedges.cpp uses EquivalenceClasses
llvm::EquivalenceClasses is an efficient data structure from LLVM, to
compute equivalence classes among objects with Tarjan's union-find.

This commit uses that to avoid an hand-crafted very inefficient
algorithm.
2023-09-07 12:19:35 +02:00
Pietro Fezzardi b8c48be350 Add progress bars to DLA 2023-09-07 12:19:35 +02:00
Giacomo Vercesi e43e720a35 revng daemon: allow setting exposed CORS headers
Add the enviroment variable `REVNG_EXPOSE_HEADERS` for `revng daemon` to
allow customizing the headers exposed via CORS.
2023-09-06 16:12:43 +02:00
Alessandro Di Federico a328de3d37 Merge branch 'feature/revng-s3' 2023-09-06 15:23:50 +02:00
Alessandro Di Federico 9c37b70976 Merge branch 'feature/revng-s3' 2023-09-06 15:23:47 +02:00
Giacomo Vercesi 0b2754c824 pipeline: drop Disk from storage methods
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.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi ca82e47f79 FunctionStringMap: switch to using GzipTarFile
Change the serialization and deserialzation functions of
`FunctionStringMap` to use the GzipTarFile. Also change che filename
of the underlying containers accordingly.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi 4a2cd259e3 Introduce GzipTarFile
Add the GzipTarFileWriter and GzipTarReader classes that allow reading a
slightly custom `.tar.gz`.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi 3b80a8efd1 Fix README.md instructions
With the introduction of `StorageClient`, permissions are no longer
transferred to the output of the `revng translate command`. Change the
README.md to reflect this change.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi 93d3a6238d revng: introduce S3 support
Add the capability for all revng tooling to run with an S3-backed
workdir.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi a84ebd0e51 revng.daemon: trim Eventmanager's functionality
Drop most of the functionality provided by EventManager. Add the
functionality that allows saving the working directory after a period of
inactivity.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi 7f0bea6f6a Improve TemporaryFile
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
2023-09-06 15:23:43 +02:00
Giacomo Vercesi dc90bca33e revng/Support: split part of Statistics in OnQuit
Split the OnQuit functionality of Statistics as a separate header and
object file. Rework the interface to use lambdas instead of the
OnQuitInterface.
2023-09-06 15:23:43 +02:00
Pietro Fezzardi 851771eaa5 Improve tracing 2023-09-06 12:59:10 +02:00
Giacomo Vercesi d95c3b4732 Change extension for Decompiled container
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.
2023-09-06 11:23:40 +02:00
Pietro Fezzardi 6addadcda7 DynamicHierarchy.h: drop unused include 2023-09-05 15:53:43 +02:00
Giacomo Vercesi 9223ada54f ImportModelFromCAnalysis: use TemporaryFile
Remove the usage of `createUniqueDirectory` that does not run cleanup on
crash/shutdown and instead use `TemporaryFile`.
2023-08-24 10:30:27 +02:00
Alessandro Di Federico b2ba33c08f Merge branch 'feature/remove-hardcoded-analyses-lists' 2023-08-23 17:45:42 +02:00
Alessandro Di Federico e88985eecb Merge branch 'feature/remove-hardcoded-analyses-lists' 2023-08-23 17:45:40 +02:00
Giacomo Vercesi 187d2744e9 tests: add graphql --produce-artifacts
Add among the tests an invocation of `graphql --produce-artifacts`.
2023-08-23 17:45:36 +02:00
Giacomo Vercesi 1d9e3fc936 tests: add revng graphql
Add a run of `revng graphql` among the tests being run. This
leverages the new Component property to filter out any unwanted
artifacts from being produced.
2023-08-23 17:45:36 +02:00
Giacomo Vercesi 4ca1d1237f Add component configuration for revng-c
`revng` now requires all pipeline files to have a `Component` field
which tells the command line driver to what component the pipeline
definition belongs to.
2023-08-23 17:45:36 +02:00
Giacomo Vercesi e719b3b7e5 Add components to revng cli driver
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.
2023-08-23 17:45:36 +02:00
Giacomo Vercesi 9fc9ca0d1e revng.cli: centralize collect_pipelines
Move the logic that collects all the pipeline files to a cental
implementation.
2023-08-23 17:45:36 +02:00
Giacomo Vercesi 13ba286a9a Drop hard-coded analyses list
Remove any use of hard-coded analyses lists, relying on user interaction
(e.g. command-line arguments) to have it instead.
2023-08-23 17:45:36 +02:00
Giacomo Vercesi d9f97f44d0 revng.test-daemon: only run for with-debug-info
Run the `revng.test-daemon` test only with a debug-info executable in
order to reduce the overall test time.
2023-08-23 17:45:36 +02:00
Alessandro Di Federico 54106ea533 Merge branch 'feature/fix-prefixes' 2023-08-23 17:14:17 +02:00
Alessandro Di Federico 469fa029f7 Merge branch 'feature/fix-prefixes' 2023-08-23 17:14:14 +02:00
Alessandro Di Federico f3d6bbb047 s/ThePTMLCBuilder/B/g 2023-08-23 16:40:54 +02:00
Alessandro Di Federico 76984c9e8b Doxygen: strip trailing \param whitespace 2023-08-23 16:40:51 +02:00
Alessandro Di Federico cc126f63b9 Adopt model::PrimitiveType::fromName 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 4a9329ebdd s/getIncommingTypesForT/getIncomingTypesFor/ 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 17bf31526a Drop Revng prefixes 2023-08-23 16:37:39 +02:00
Alessandro Di Federico eaed9c7302 HeaderToModel: s/DILogger/Log/ 2023-08-23 16:37:39 +02:00
Alessandro Di Federico e512cd8918 CMake: drop hardcoded clang path 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 4e1fed5fa0 ModelToHeader: omit _enum_max_value_* when editing 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 489dddd0e7 TupleTreeReference::isValid is for assertions only 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 2b97576ebb HeaderToModel: do not hardcode clang paths 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 30c127267c Improve ModelToHeader and HeaderToModel tests
* Fix non-PrimitiveTypes with low IDs.
* Ensure we use `revng model compare` to test the model.
* Updates the name to reflect the recent changes in naming convention
  and in the way we represent `model::Type::ID`s.
2023-08-23 16:37:39 +02:00
Alessandro Di Federico 100a27bb1c HeaderToModel: emit forward declaration later
We used to emit the forward declaration for the type we were editing
*before* `#pragma once`. This was not good per se, but it also lead to
failures due to the introduction of `_PACKED`, which is not yet defined
at that stage.
2023-08-23 16:37:39 +02:00
Alessandro Di Federico c623e2d9d6 HeaderToModel: fix a couple of std::optional bugs 2023-08-23 16:37:39 +02:00
Alessandro Di Federico 5ab0659966 HeaderToModel: change CustomName only if different
This commit fixes two problems with HeaderToModel: we no longer emit
fields for padding and do not change the name if it's identical to the
old `.name()`.

This issues led to create fields for padding and, in case the entity was
originally missing the `CustomName`, to set `CustomName`s to the
generated name.
2023-08-23 16:37:39 +02:00
Alessandro Di Federico 330d2b6cc7 Model: rework how we name things
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.
2023-08-23 16:37:39 +02:00
Alessandro Di Federico f81e9d615b dumpModelToHeader: introduce struct for options
This commit also introduces a new option for emitting code right after
the `#include` section.
2023-08-23 16:37:39 +02:00
Alessandro Di Federico f406e978e3 Adopt progressive model::Type::IDs 2023-08-23 16:37:39 +02:00
Alessandro Di Federico b5aa75f1f1 Introduce model::PrimitiveType::fromName 2023-08-23 16:14:05 +02:00
Alessandro Di Federico f6a5857d80 StructType: move the Size field up 2023-08-23 16:14:05 +02:00