Commit Graph

6113 Commits

Author SHA1 Message Date
Giacomo Vercesi bc7cde4cf7 tuple_tree.ts: fix diffing for abstract types
The previous `makeDiff` implementation did account nor have enough
information to be able to upcast abstract types. This commit introduces
the necessary information for this to happen.
2023-11-03 16:30:40 +01:00
Giacomo Vercesi d737a13117 manager.py: temporarily remove auto-saves
Remove the auto-save code that gets triggered when running analyses.
This improves performance since it doesn't force the manager to save to
storage. This is due to the manager eagerly serializing the pipeline
(both in terms of amount of data and which container should be
serialized), this is especially expensive when the resume directory is
backed by S3.
2023-11-03 16:30:40 +01:00
Alessandro Di Federico 70344e0a78 Merge branch 'feature/context-global-index' 2023-11-03 15:23:55 +01:00
Giacomo Vercesi 046612f11c revng.graphql: enforce index consistency
Force clients to provide the current index to run `produce` or
`runAnalysis`. Requests that do not provide the correct index return an
IndexError object.
2023-11-03 14:51:31 +01:00
Giacomo Vercesi c83932003b revng.daemon: also send index in invalidations
When sending invalidations via websocket, also send the new context
global index.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 94aa2b51d2 Add Context Global Index 2023-11-03 12:13:58 +01:00
Giacomo Vercesi 04698bb550 Return invalidations when deserializing container
When deserializing a container in the pipeline, return the invalidations
that have been caused by the container changing content.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 56af9c1f9d Propagate errors from Analysis/Pipes to daemon
Leverage the `rp_error` mechanism to propagate errors from analyses and
pipes to the GraphQL schema.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 3b0d708a2f Drop custom globals mutator from PipelineC
Remove globals mutator from PipelineC api, as there are analyses present
that allow changing them.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 4f94988a4d Add Globals Analyses
Add analyses that allow the modification of globals via the analysis
mechanism of Pipeline.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 37adeb7eeb Pipeline options: introduce -path options
In the case of string options, the pipeline will also create a `-path`
option, which makes the option contents from reading the specified file.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi acd498bf25 Pipeline options: restrict to int and strings
Restrict the type of pipeline options to integers and strings. Rework
the CLOpt mechanism to avoid parsing the string twice.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi 7378bee983 Storage/Path.cpp: fix local path normalization
Move the local path normalization process to a stand-alone function. Fix
a bug that caused relative paths to not be properly resolved due to
missing `true` in `remove_dots`.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi fec3d1d92e StorageClient.h: remove mention of dummy client 2023-11-03 12:13:57 +01:00
Giacomo Vercesi 94eb1a1d43 Prototypes.h: drop old LENGTH_HINTS
Remove `LENGTH_HINTS` that are no longer applicable to the API exposed
by PipelineC.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi d6890473f4 PipelineC: add missing null checks 2023-11-03 12:13:57 +01:00
Giacomo Vercesi ca0a6f82eb Global.h: remove dead code
Remove the `HasVerify` concept as it is a leftover that's currently
unused.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi 6f4fa9853a Assert.h: drop dead code
The `AbortHook` functionality has been dropped since `7fda1ef4`, but the
header declarations were not removed.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi 8dd0b64030 revng.daemon: add missing emit_event
The `runAnalysesList` resolve did not emit a `CONTEXT` event when run.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi f467671173 revng.api: drop the use of islice
The `itertools.islice` function does not support negative index slices,
rework the code of `collection.abc.Sequence` classes to use `range`
instead.
2023-11-03 12:13:57 +01:00
Giacomo Vercesi 58cef84e3a cli.graphql: improve log messages
Explicitly state the analyses list being run rather than the generic
"Autoanalysis complete".
2023-11-03 12:13:57 +01:00
Andrea Gussoni f7e59d5736 SimplifyDualSwitch: handle complete simplification
Handle the situation where the whole dispatcher `switch` is simplified
after the `SimplifyDualSwitch` is run.

Enforce check that when a `SwitchBreakNode` is removed due to the
`SimplifyDualSwitch` it must be pertinent to the containing dispatcher
`switch`.
2023-11-03 11:44:23 +01:00
Andrea Gussoni fb336d1461 BeautifyGHAST: reorder simplifyImplicitContinue
Move the `simplifyImplicitContinue` at the end of the beautify pass,
after all the pass that modify the anatomy of the ASTTree.

Before this change, the pass was run before some changes that moved some
`continue`s in positions where they are not considered implicit.

Added an assertion which checks that during the `noFallThrough`
promotion phase, no implicit `ContinueNode` is present.
2023-11-03 11:44:23 +01:00
Andrea Gussoni 67a708c1e8 SimplifyHybridNot: improve BBExprsMap
The container used to store the associated `ExprNode`s that we need to
flip when performing a `HybridNot` simplification, is changed from a
`llvm::SmallVector` to `llvm:SmallSet`.
Indeed, during the collection of the `ExprNode`s pointing to a
`llvm::BasicBlock`, it should not be possible to find a single
`ExprNode` twice. We now assert this fact.
2023-11-03 11:44:09 +01:00
Andrea Gussoni eed117f75d ASTNode: fix updateASTNodesPointers method
Fix the `updateASTNodesPointers` method for the `SwitchBreakNode` class,
updating the `ParentSwitch` field.
2023-11-03 11:44:09 +01:00
Andrea Gussoni 53fcb14147 ASTNode: fix updateASTNodesPointers method
Fix the `updateASTNodesPointers` method for the `ScsNode` class,
correctly updating the `RelatedCondition` field.
2023-11-03 11:44:04 +01:00
Andrea Gussoni 9248130bab BeautifyGHAST: reassign RootNode
Reassign the `RootNode` after the `simplifyAtomicSequence` beautify pass
has run.
2023-11-03 11:44:00 +01:00
Alessandro Di Federico c6cb97cfd2 Merge branch 'feature/i386-microsoft-abis' 2023-11-03 10:04:22 +01:00
Ivan Krysak fc7d9841bf ABI-testing: simplify script structure 2023-11-02 17:10:04 +01:00
Ivan Krysak f3acdcdef3 ABI: rewrite the testing suite documentation 2023-11-02 17:10:04 +01:00
Ivan Krysak e9824977dd ABI: switch to the new testing toolchain 2023-11-02 17:10:04 +01:00
Ivan Krysak ca3d3fe5f1 ABI-testing: rework the layout verification
Following the switch in the testing approach on the revng-qa side,
the logic here also needed to be updated.
2023-11-02 17:10:04 +01:00
Ivan Krysak 65fa67df84 YAMLTraits: specialize for std::byte 2023-11-02 17:10:04 +01:00
Ivan Krysak dcc8fd16c5 ABI-testing: rename the parser file
Since `artifact` is so ambiguous, a more explicit name was given.
2023-11-02 17:10:04 +01:00
Ivan Krysak 117451308d ABI: mark 32-bit microsoft ABIs as safe
This enables the conversion by default by the raw->cabi analysis.
2023-11-02 17:10:04 +01:00
Ivan Krysak 8964dc815c Layout: fix a bug with missing SPTAR arguments
Because of a mistake with the last refactoring iteration, this extra
argument was lost when converting to RFTs (it was still present in
layouts). This commit reintroduces it.
2023-11-02 17:10:04 +01:00
Ivan Krysak fdd3234e4f ABI: fix stdcall return value location 2023-11-02 17:10:04 +01:00
Ivan Krysak e4cbcaa520 ABI: remove an unnecessary repeat-for array 2023-11-02 17:10:04 +01:00
Ivan Krysak 99748a5cbc ABI: make microsoft ABIs more regparm-like
32-bit microsoft ABIs that allow using registers for accepting arguments
behave the same way `regparm` ABIs do, but weren't marked as such.
2023-11-02 17:10:04 +01:00
Ivan Krysak f4557f1353 ABI: fix alignment of scalars in 32-bit microsoft 2023-11-02 17:10:04 +01:00
Ivan Krysak 775852c6c9 ABI: fix a problem with return value location
If the location was not also used a normal argument, it would get lost
when sorting argument registers.
2023-11-02 17:10:04 +01:00
Ivan Krysak dbc99ff587 ABI: improve a register sorting error message 2023-11-02 17:10:03 +01:00
Ivan Krysak cfe28d8e56 Stop using std:: prefix for u?int\d+_t types 2023-11-02 17:10:03 +01:00
Giacomo Vercesi ce446576a4 Fix typos 2023-11-02 16:49:49 +01:00
Giacomo Vercesi 0cb3e497a4 Fix typos 2023-11-02 16:48:33 +01:00
Alessandro Di Federico 29e52bb21d CMakeLists.txt: use system's clang
Before this commit, we were using the clang executable associated to the
LLVM installation we link againsts. But that's not what we want here.
2023-11-02 16:48:33 +01:00
Alessandro Di Federico 6e3b7322ff support.c: drop AT_HWCAP2
AT_HWCAP2 is not supported by old kernels.
2023-11-02 16:48:33 +01:00
Pietro Fezzardi 43d6a2c5c5 TypeSystemPrinter: allow prototype-less functions
Before this commit, the TypeSystemPrinter implicitly assumed that
model::Function and model::DynamicFunction always had a prototype.

However, this is not guaranteed by the model schema.

This commit extends the TypeSystemPrinter so that it doesn't make that
wrong assumption anymore, and can successfully print any model::Function
and model::DynamicFunction, even when a prototype is not present.
2023-10-31 17:42:13 +01:00
Alessandro Di Federico d9c540247b Doxygen: be quiet in absence of comments 2023-10-24 09:49:05 +02:00
Alessandro Di Federico 4388acb482 Yield: improve artifact naming 2023-10-24 09:49:05 +02:00