Commit Graph

2842 Commits

Author SHA1 Message Date
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 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
Alessandro Di Federico c1bf5562e3 PromoteCSVs: use CSV initializer for non-GPRs
This commit drops calls to `_init_$CPU_STATE` for non-general purpose
registers. Instead, these part of the CPU state are initialized using
the initializer of the CSV, which is in turn provided by QEMU.

This enables us to properly initialize as appropriate fields such as
x86-64's DF flag.
2023-10-24 09:49:05 +02:00
Ivan Krysak 9a1239327c CallGraph: fix the slicing direction
After the changes to the direction `CrossRelation` output is parsed,
the slicer wasn't updated accordingly. Because of that, the slices were
as if they were produced backwards.

As for the full graph, since it starts from an artificially added node
that doesn't have any successors by definition - it was appearing empty
(only the non-emittable "root" node was present).
2023-10-20 15:54:58 +02:00
Pietro Fezzardi cea24b455b Merge branch 'feature/nodesbetween-fix' 2023-10-11 11:17:54 +02:00
Andrea Gussoni d2db8d4cfa ControlFlowEdgesGraph: improve at method
Improve the `at` method by giving it a coherent semantics with a
standard `at` map method semantics.
2023-10-09 10:33:48 +02:00
Andrea Gussoni e2090b8746 GraphAlgorithms: nodesBetween double DFS
We now implement the `nodesBetween` primitive with a double DFS visit.
Specifically, we have:
1) A forward DFS that starts from the `Source`, and stops at `Target`.
2) A backward DFS that starts from the `Target`, and stops at `Source`.
The final result is then the intersection of the nodes found by the two
above DFS visits.

A new `findReachableNodes` primitive is also added to perform a DFS from
a `Source` node, which stops at the `Stop` parameter node, if present.

Added unit tests to improve the coverage.
2023-10-09 10:33:48 +02:00
Alessandro Di Federico 6645a68900 Merge branch 'feature/c-qa-1' 2023-10-06 17:16:42 +02:00
Alessandro Di Federico bd1b5e4ef9 newpc: add nomerge, willreturn, nounwind 2023-10-06 17:16:04 +02:00
Alessandro Di Federico 79c5f59449 DwarfImporter: handle invalid function addresses 2023-10-06 17:16:04 +02:00
Alessandro Di Federico a11435becf BinaryImporter: error on unsupported formats 2023-10-06 17:16:04 +02:00
Alessandro Di Federico c9b95c0556 DetectABI::propagatePrototypes: improve logging 2023-10-06 17:16:04 +02:00
Alessandro Di Federico 86e5ae8680 rm share/revng/well-known-models/CMakeLists.txt
Its presence lead to an undesirable situation where the file itself
would get copied to the install directory and using `add_subdirectory`
led to creating a set of support files (which would get installed too).

Simple solution: just push the content of that file in the root
`CMakeLists.txt`.
2023-10-06 17:16:04 +02:00
Alessandro Di Federico 8ab26f8d7f Adopt TupleTreeReference::empty() 2023-10-05 10:19:44 +02:00
Alessandro Di Federico 3f13fd0c08 PTML Doxygen: emit comment only if present 2023-10-05 10:19:44 +02:00
Alessandro Di Federico aa878e2d12 DetectABI::finalizeModel: delay CFG verification
This ensures all changes have applied and things are coherent.
2023-10-05 10:19:44 +02:00
Alessandro Di Federico 7dff660b36 propagatePrototypesInFunction: propagate names 2023-10-05 10:19:44 +02:00
Alessandro Di Federico e919fff6e7 DetectABI: posticipate propagatePrototypes
This change avoids making changes to the model that `finalizeModel` does
not expect.
2023-10-05 10:19:44 +02:00
Alessandro Di Federico 52dc3faf2c CFGAnalyzer: noreturn tail calls do not return 2023-10-05 10:19:44 +02:00
Alessandro Di Federico d8147aa62e Introduce TupleTreeReference::dump 2023-10-05 10:19:44 +02:00
Alessandro Di Federico c6425b2618 TupleTree::verify: more fine grained assertions 2023-10-05 10:19:44 +02:00
Alessandro Di Federico 2cbf3a8313 TypeCopier: minor rework 2023-10-05 10:19:44 +02:00
Alessandro Di Federico 456b916bcc Move TypePath definition 2023-10-05 10:19:44 +02:00
Alessandro Di Federico bf66ecc389 {,Dynamic}Function::Prototype: support typedefs 2023-10-05 10:19:44 +02:00
Alessandro Di Federico 7ba01f513b ABIAnalyses: fix collection points
The collection points of several ABI analyses where incorrect. Several
analyses that should have collected data only from entry points were
collecting data from any node in the graph.
2023-10-04 17:47:50 +02:00
Alessandro Di Federico 676654ea7b ABIAnalysis: improve logging 2023-10-04 17:47:50 +02:00
Alessandro Di Federico 111b3a819d CFGAnalyzer::milkInfo: add logging 2023-10-04 17:47:50 +02:00
Alessandro Di Federico b67e2ac13a Minor changes 2023-10-04 17:47:50 +02:00
Pietro Fezzardi e2dc45c31a Merge branch 'feature/llvmir-prepare-for-mlir' 2023-10-03 10:18:17 +02:00
Djordje Todorovic ab6bc6473c pipeline: Emit error if a pipe is not LLVM one
A consequence will be that parser will ignore those silently.
2023-09-21 08:05:50 +02:00
Djordje Todorovic fc88a52fae AttachDebugInfo: Fix for MLIR
Up until now, we did not need different !dbg/DISubprogram
attached to each isolated llvm::Function, but for the
purpose of MLIR lowering, we need it.

On the LLVM IR level, we used to reuse root's DISubpgram,
and we have not being attaching !dbg/DISubprogram to the
isolated functions at all (just to llvm::Instructions),
but that was an hack in order to avoid some LLVM verify
checks, since LLVM IR expects !dbg attachments to calls of
functions that could be inlined, but by avoid !dbg on the
Function itself, it won't verify !dbg attachments on the
instructions, since it will assume it has no debug info in
it. When it comes to MLIR, it expects different !dbg
attached to each function, in order to process debug info
in it, so that is the reason we cannot rely on the root
DISubprogram only anymore.
2023-09-21 08:05:49 +02:00
Djordje Todorovic 2760599483 Add StripDebugInfoFromHelpers Pass
During this phase (EnforceABI) the binary is not meant to be run
so the debug info is not useful anymore, so we are striping them
now in order to avoid taking care of them during the pipeline.
2023-09-21 08:05:48 +02:00
Giacomo Vercesi e2504dd6f2 Implement storage credentials update
Add the functionality to rev.ng's infrastructure to allow to dynamically
update the credentials of the underlying storage provider at runtime.
2023-09-14 17:32:08 +02:00
Alessandro Di Federico f95ef2bda7 Merge branch 'feature/dormitory' 2023-09-14 15:44:36 +02:00
Giacomo Vercesi 0c5bc8c120 Drop unused functions from PipelineC
Remove all the functions that are no longer needed by `revng.api`.
2023-09-14 15:44:33 +02:00
Giacomo Vercesi f710af9f2f Cleanup revng.daemon graphql API
Drop autogenerated queries from the GraphQL API and switch `revng.api`
to use `PipelineDescriptor`.
2023-09-14 15:44:33 +02:00