Commit Graph

6113 Commits

Author SHA1 Message Date
Giacomo Vercesi 73cd5a5655 revng daemon: allow manuanlly saving via SIGUSR2
This commit adds the functionality, in debug mode, for `revng daemon` to
save when the SIGUSR2 signal is sent.
2024-01-26 19:13:58 +01:00
Giacomo Vercesi ca3fb32aeb Fix Step::invalidationMetadataContains
This commit fixes the `Step::invalidationMetadataContains` function
since it returned an inverted result.
2024-01-26 19:13:58 +01:00
Alessandro Di Federico f40e5297ae Merge branch 'feature/container-cache-invalidation' 2024-01-26 17:46:37 +01:00
Giacomo Vercesi 6ac7c0c557 Implement container cache pruning
Implement the pruning of container caches (resume directory) when there
is a mismatch between the current revng components' hash and the saved
one. This functionality is activated via `-check-components-version`.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi 06f6137004 ResourceFinder: implement getComponentsHash
Implement the `getComponentsHash` function which returns a hash string
for all the components currently installed in revng.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi b7e01a764d CMake: generate component-hashes/revng
Generate the `share/revng/component-hashes/revng` file, which contains
the git commit from which the current build of revng (dirty files
notwithstanding) was built from.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi 5070fe6aef revng::Path: add newline to dump
The `revng::Path.dump` method was missing a newline, which caused the
output to be harder to read.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi 27b6fa984d STLExtras: fix append
Before this commit, the `append` function did not work with contained
objects which were not default-constructible. This commit fixes this
behavior by using a different choice of iterator wrappers which avoids
the need for the contained object to be default-constructible.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi 443301a402 S3StorageClient: fix directory detection
The detection of directories in S3StorageClient was flawed as it did not
account for files with a suffix. This commit forces the use of a `/` at
the end to guarantee that the matched path is a sub-{file,directory}.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi 9a701a0665 GzipTarWriter: fix append for empty files
The `GzipTarWriter::append` method erroneously added an empty block of
padding when an empty file (size == 0) was supplied. This corrects the
algorithm by excluding 512 as a valid padding size.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi ca66b4ddfc InitRevng: fix command line parsing
This commit fixes command line parsing of revng through the
REVNG_OPTIONS environment variable. Previously the env was prepended to
the actual command-line variables, now it's appended, allowing to
specify command line arguments that depend on `-load`s.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi af1e927e7e Drop ApplyDiffAnalysis' files
The files `ApplyDiffAnalysis.{cpp,h}` were mis-re-merged in c276a439.
Drop them.
2024-01-26 17:46:21 +01:00
Giacomo Vercesi d7d71a5370 CMake: generate component-hashes/revng-c
Generate the `share/revng/component-hashes/revng-c` file, which
contains the git commit from which the current build of revng-c (dirty
files nonwithstanding) was built from.
2024-01-26 17:15:08 +01:00
Alessandro Di Federico b2ef96927f Merge branch 'feature/rebuild-dispatcher-fixes' 2024-01-26 17:12:45 +01:00
Pietro Fezzardi a27277c142 Merge branch 'feature/c-qa-tier-2-website-snippet' 2024-01-26 16:52:56 +01:00
Pietro Fezzardi 73cf39d206 DLA: add MergePointeesOfPointerUnion DLAStep 2024-01-26 16:49:52 +01:00
Pietro Fezzardi 8df6b0d7d8 DLA: relax assertions on MergePointerNodes
The DLAStep can now effectively run at any time, without assuming any
specific property of the underlying graph.
2024-01-26 16:49:52 +01:00
Pietro Fezzardi f598df6113 DLA: fix moveEdgeTargetWithoutSumming
Before this commit, the method could partly fail in moving the edge
target even in legitimate scenarios, because of a bug in how it fixed up
the Successors link in the edge source.
This commit fixes the bug.
2024-01-26 16:49:52 +01:00
Pietro Fezzardi c41a6392c0 Run loop-simplify to enable DLA to detect arrays 2024-01-26 16:49:52 +01:00
Pietro Fezzardi 04bb1d0fb3 Backend: avoid casting to uint8_t in conditions
Explicitly casting to uint8_t has the semantics of truncating, in case
the value being casted is larger than 8 bits.
Avoiding the cast default to regular C behavior, where every non-zero
integer is considered true.
2024-01-26 16:49:47 +01:00
Pietro Fezzardi c30ee01d85 MakeLocalVariables uses initModelTypes
This enables to generate LocalVariables with nicer-looking types,
learning from Stores that write values into them.

RemoveLoadStore had to be updated to handle cstringLiteral as a corner
case.

In the future, we can probably treat cstringLiteral homogeneously if we
change MakeSegmentRefs so to inject AddressOf around cstringLiteral, and
change cstringLiteral itself to have reference semantics.
2024-01-26 16:49:47 +01:00
Pietro Fezzardi 5d1ab13289 Drop old RemoveRefDeref pass
The pass has always been redundant, only used to simplify the IR and not
for anything useful.
Recently, after the work done to tidy up casts, it has started to give
problems: turns out ModelGEPRefs without indices are not always
redundant, and removing them can cause `trunc` instructions that then
end pessimizing the C code generation.

This commit drops the pass altogether.
2024-01-26 16:49:37 +01:00
Andrea Gussoni b6d5a38bbe CMakeLists.txt: flag for no-limit-debug-info
Add a commented line in `CMakeLists.txt` to easily enable
`no-limit-debug-info`, which is useful to make debugging easier when
methods are missing from llvm classes.
2024-01-26 16:47:33 +01:00
Pietro Fezzardi 9db3c53f1e Convert FIXMEs to TODOs 2024-01-26 16:45:20 +01:00
Andrea Gussoni 4589330f82 CMakeLists.txt: flag for no-limit-debug-info
Add a commented line in `CMakeLists.txt` to easily enable
`no-limit-debug-info`, which is useful to make debugging easier when
methods are missing from llvm classes.
2024-01-26 15:42:16 +01:00
Andrea Gussoni 8125a19379 JumpTargetManager: improve rebuildDispatcher
Improve the way in which we connect the non reachable `JumpTargets` when
rebuilding the dispatcher for non `SemanticsPreserving` `CFGForm`s.

When connecting group of jump targets that are not currently reachable
from the entry dispatcher, we elect the jump target with the lowest
program counter value, as the one to be connected to the dispatcher.
We also mark the jump targets now transitively reachables from the
elected one, as reachable, so to avoid adding other unnecessary edges
from the dispatcher.
2024-01-18 11:06:17 +01:00
Pietro Fezzardi 000b4bc481 Segregate: fix iteration on OpaqueExtractValues
Before this commit, the code was making a couple of broken assumptions on
OpaqueExtractValues
- that OpaqueExtractValues were always ordered in the same way as struct
  fields (e.g. the OpaqueExtractValue extracting field 0 was always the
  first use of the struct-typed value it was extracting from)
- that there was always one and exactly one OpaqueExtractValue for each
  field index in the struct

This commit fixes the issue, while reusing available facilities for
dealing with OpaqueExtractValues.
2024-01-09 09:32:25 +01:00
Pietro Fezzardi d6a6e29ae0 TANP: inject UnaryMinus on negative call arguments 2024-01-09 09:32:25 +01:00
Alessandro Di Federico 31a29b193a Merge branch 'feature/pipeline-on-diff-invalidation' 2024-01-02 15:47:56 +01:00
Alessandro Di Federico 840015fcfb Merge branch 'feature/pipeline-on-diff-invalidation' 2024-01-02 15:46:41 +01:00
Massimo Fioravanti 2ec4683874 Fix: invalidation map and invalidation cache
The invalidation map passed by callers of pipeline invalidate was
assumed to be always empty. This requirement has been relaxed.

The pipe invalidation cache now checks that what must be removed is
actually present. This is relevant for targets that are killed by later
pipes before the end of the step.
2024-01-02 15:08:26 +01:00
Alessandro Di Federico 028908a592 revng graphql: print analyses' errors 2024-01-02 15:08:26 +01:00
Massimo Fioravanti d7c56bd1f4 Remove redundant model copy 2024-01-02 12:10:21 +01:00
Massimo Fioravanti f6ff8e544d Add tracking debug infrastructure
Add a mechanism to make the program crash when a given element of the
model is read or written.
2024-01-02 11:14:56 +01:00
Massimo Fioravanti c276a439b5 Add pipeline invalidation
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
2024-01-02 11:14:56 +01:00
Massimo Fioravanti e5347b2910 Remove llvm pipeline 2024-01-02 11:14:55 +01:00
Massimo Fioravanti 643d96698d Preliminaries for pipeline invalidation
Fix various bugs already present in the codebase.
2024-01-02 11:06:48 +01:00
Massimo Fioravanti 86e45461a0 Introduce pipeline execution context 2024-01-02 11:05:50 +01:00
Massimo Fioravanti 5a2e3b2359 Drop llvm pipeline 2024-01-02 11:05:50 +01:00
Pietro Fezzardi 4b01849e59 AddAssignmentMarkerPass: relax assertion 2023-12-19 01:57:11 +01:00
Pietro Fezzardi 8475e73fb5 Segregate: drop unnecessary variable 2023-12-19 01:57:06 +01:00
Pietro Fezzardi 72fc2be260 Add missing NoMerge function attributes 2023-12-19 01:27:12 +01:00
Alessandro Di Federico c895d53f22 Merge branch 'feature/hub-artifacts' 2023-12-13 15:36:48 +01:00
Giacomo Vercesi b6d1f178fd FunctionStringMap: UncompressedSize in index
Add the `UncompressedSize` field in the index file.
2023-12-13 14:45:10 +01:00
Giacomo Vercesi 942cf50735 python: create python wheels
Package revng's python code in two wheels: `revng` and `revng_internal`.
The revng wheel contains the
`revng.{pipeline_description,model,tupletree}` modules, while the
`revng_internal` one everything under `revng.internal`.
2023-12-12 14:52:22 +01:00
Giacomo Vercesi 7deb85b863 revng daemon: implement plugin interface
Deprecate the `STARLETTE_MIDDLEWARES_*` environment variables in favor
of a plugin infrastucture, which allows plugins to register middlewares
and save hooks via a `setup` function.
2023-12-12 14:52:22 +01:00
Alessandro Di Federico 951078a4e4 Merge branch 'feature/c-qa-2' 2023-12-12 14:00:46 +01:00
Alessandro Di Federico 5babd3e1b3 Merge branch 'feature/c-qa-2' 2023-12-12 14:00:27 +01:00
Alessandro Di Federico 03c3372c57 ConvertToCABI: fix VerifyHelper usage 2023-12-12 14:00:04 +01:00
Pietro Fezzardi e4f0c5fc1f MarkAssignment: refactor and update comments 2023-12-12 13:59:41 +01:00