Commit Graph

417 Commits

Author SHA1 Message Date
Giacomo Vercesi 85998b1bd9 Fix S3 storage test
Fix the storage test by converting it from bash to python and also
testing all the occasions where a save should be triggered.
2025-03-28 10:24:10 +01:00
Alessandro Di Federico c5b9728289 LocalVariableBuilder: add pointer size assumption
This commit further centralizes the creation of allocas + ptrtoint.  The
creation of these pair of instructions is problematic when the size of a
pointer in the input and target architecture differ.

In fact, in such cases, LLVM turns trunc into masking the integer to
suppresse the high bits. This results in problematic code.

This commit introduces an assumption that ensures LLVM does not do that.
2025-03-17 08:51:29 +01:00
Giacomo Vercesi 140735a913 tuple-tree-generate-typescript: drop --prettier
The `prettier` binary is now assumed to be installed as part of the
system. No need to manually install it and use the `--prettier`
command-line option.
2025-03-13 14:06:02 +01:00
Ivan Krysak 45e01ae0d2 Introduce a pipe for embedding statement comments 2025-02-13 13:09:50 +02:00
Ivan Krysak a93ffd3760 Rename UnusedStackArgumentBytes
Old name was `StackBytesAllocatedForRegisterArguments`.
2025-02-12 16:43:19 +02:00
Pietro Fezzardi 5dc4d86f81 Pipeline: squash late-optimize into segregate
Passes without an artifact and a single successor are pointless anyway.
You can't get their output with revng artifact but you need to save
them on disk.
2025-01-29 23:55:49 +01:00
Pietro Fezzardi 1f0c8e1ae5 Pipeline: remove import-clift-types Pipe
At the moment this pipe is broken, because it claims to be producing
artifacts with function rank, while it only produces types.

This pipe should be extended and turned into a pipe that generates
the whole Clift module including functions from LLVM IR, and not just
types.

We should add an input LLVMContainer, and the run() method should first
import types, and then create the functions and their bodies.

For the time being the Pipe is removed from the pipeline.
2025-01-29 23:55:49 +01:00
Pietro Fezzardi 9e0f015eb8 Drop old conversion from LLVM to MLIR
The previous conversion from LLVM to MLIR was translating plain LLVM IR
to LLVM MLIR Dialect, as a preliminary step for further conversion from
LLVM MLIR Dialect to Clift.
This is not how things are expected to work anymore, so the old code is
now dead and can be removed.
2025-01-29 23:55:49 +01:00
Pietro Fezzardi 6e17dbed58 Tests: test the prepare-for-clift artifact
This is the initial part of the clift-based decomilation pipeline.
2025-01-29 23:55:49 +01:00
Pietro Fezzardi 186798c2aa Add initial part of clift-based decompilation 2025-01-29 23:55:49 +01:00
Pietro Fezzardi 7be6491258 Pipeline: avoid duplicate SingleTargetFilename 2025-01-29 23:55:49 +01:00
Pietro Fezzardi 391f5c780f SwitchToStatements: use LocalVariableBuilder 2025-01-29 23:55:49 +01:00
Pietro Fezzardi 59a1434fab Segregate: add template for legacy local variables
Introduce LegacySegregateStackAccessesPipe

This commit restructures the SegregateStackAccesses pass and
SegregateStackAccessesPipe so that they can have 2 modes of operations:
1. Legacy, with the same behavior as the old version, injecting local
   variables as custom llvm::Functions representing opcodes, such as
   LocalVariable, AddressOf, StackFrameAllocator, and CallStackArguments
   allocator.
2. Non-legacy, that is meant to operate with the new LocalVariableHelper
   to inject local variables as regular alloca instructions, with
   additional metadata to discriminate among them.

This commit renames the old SegregateStackAccessesPipe to
LegacySegregateStackAccessesPipe.
It then re-uses the old SegregateStackAccessesPipe name for a new pipe,
meant to work in non-legacy mode.

The pipeline definition YAML file is updated to keep using the legacy
version for now.

For now the implementation is still the same.
2025-01-29 15:17:15 +01:00
Pietro Fezzardi f4c79e0579 Pipeline: fix typo 2025-01-29 15:17:15 +01:00
Pietro Fezzardi 30558bcc29 Add -fno-strict-overflow to compile-flags.cfg
This prevents recompilation of decompiled C code to cause UB on
overflows, because all integer and pointer overflows now wrap.
2025-01-29 15:17:15 +01:00
Alessandro Di Federico b576fd1988 CollectFunctions tests: ignore loaded addresses
The tests was testing if a function whose entry address is the target of
load was identified as a function or not (it shouldn't).

This test was passing accidentally. This has not been supported since
the introduction of `RootAnalyzer`.  In order to support this again, we
need to resurrect `processLoadsAndStores`.
2025-01-28 12:19:16 +01:00
Lauri Vasama 1195617e5b Add revng_register_library, use for MLIR libs 2025-01-02 11:25:32 +02:00
Alessandro Di Federico 276a4aa974 Generate model docs 2024-12-11 16:15:10 +01:00
Alessandro Di Federico ade0603d3f Add docs for artifacts and analyses 2024-12-11 16:15:10 +01:00
Alessandro Di Federico 832840c307 Importers: ignore unmapped code
This commit ensures that parts of the model that must point to code
(specifically `Binary::EntryPoint`, `Binary::ExtraCodeAddresses` and
`Function::Entry`) actually point to a segment mapped as +x.
2024-11-28 15:22:10 +01:00
Alessandro Di Federico 686083bdab Remove mentions to revng-c 2024-11-21 15:54:23 +01:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Giacomo Vercesi 7a01742421 mass-testing: show smallest binaries
Show on the overview page of mass-testing the smallest binary for OOMs
and timeouts, as these are probably show an early sign of some broken
aspect of the pipeline.
2024-11-13 09:28:12 +01:00
Alessandro Di Federico efcea8ae48 importBinary: fix error handling 2024-11-12 18:05:48 +01:00
Alessandro Di Federico ba186a130c s/module.ll/module.bc.zstd/g 2024-11-12 14:58:00 +01:00
Alessandro Di Federico 30f464119e s/module.ll/module.bc.zstd/g 2024-11-11 16:51:18 +01:00
Ivan Krysak c72abab5e4 Introduce name collision tests 2024-11-06 19:18:53 +02:00
Ivan Krysak 64446d0453 Adopt name builder across the model users 2024-11-06 19:18:53 +02:00
Ivan Krysak 2240da4ffc Improve test documentation 2024-11-06 19:18:53 +02:00
Alessandro Di Federico a48e0f5c93 Rework usage of analyses list 2024-11-04 15:09:56 +01:00
Alessandro Di Federico bd84bd7f2e Rework --analyze and --analyses-list 2024-10-31 17:19:51 +01:00
Giacomo Vercesi 248e642f02 Fix tests due to module.ll format change
`module.ll` is now a zstd-compressed bitcode file. Change the tests
where it relied on the module being LLVM IR by decompressing and
disassembling the input on the fly.
2024-10-30 10:28:08 +01:00
Alessandro Di Federico bf9ef91f4e Drop revng model import binary 2024-10-16 11:46:56 +02:00
Ivan Krysak 94d860e2b2 Clean up builder configuration
This also re-enables stack inlining by default.
2024-10-15 10:45:13 +03:00
Ivan Krysak 1a35cbcb77 Introduce PTMLCTypeBuilder 2024-10-15 10:45:13 +03:00
Ivan Krysak 724f8bfb59 ABI: streamline terminology
"packed" is used instead of "unnaturally aligned".
2024-10-08 13:53:53 +02:00
Ivan Krysak 4bdc7f83b5 ABI: drop incomplete pascal support 2024-10-08 13:53:53 +02:00
Ivan Krysak 5150fbd8c8 ABI: Limit usage of the StackAlignment option 2024-10-08 13:53:53 +02:00
Ivan Krysak 6d44a4b1c2 ABI: introduce UseStrictAggregateAlignmentRules 2024-10-08 13:53:52 +02:00
Ivan Krysak 7dfd669bde ABI: introduce a new configuration option:
`StackArgumentsUseRegularStructAlignmentRules`.
2024-10-08 13:53:52 +02:00
Ivan Krysak b20bcbe1d4 ABI: introduce BigArgumentsUsePointersToCopy 2024-10-08 13:53:52 +02:00
Ivan Krysak fb06320154 ABI: introduce Microsoft_AAPCS64 2024-10-08 13:53:52 +02:00
Ivan Krysak e92c0b68bb ABI: introduce Apple_AAPCS64 2024-10-08 13:53:52 +02:00
Ivan Krysak e4d8ead973 ABI: make MinimumStackArgumentSize explicit 2024-10-08 13:53:52 +02:00
Ivan Krysak d5d1a7da99 ABI: introduce ReturnValueLocationIsReturned 2024-10-08 13:53:51 +02:00
Ivan Krysak a4196fdd5e ABI: allow unnatural structs in aarch64 registers 2024-10-08 13:53:51 +02:00
Giacomo Vercesi 3fe3a8524a Implement mass testing
Add the `revng mass-testing` commands and auxiliary executables which
simplify running revng on a huge quantity of input executables.
2024-10-01 13:38:21 +02:00
Alessandro Di Federico 8ca6a0739d precedence.c.filecheck: fix argument names
Due to a bug fix in revng, we're now having arguments in a different
(correct) order. Let the test reflect this.
2024-10-01 11:52:33 +02:00
Alessandro Di Federico 55fd4d9f66 s/cfg.yml/cfg.yml.tar.gz/ 2024-09-29 12:53:23 +02:00
Alessandro Di Federico c5f2c8055e s/cfg.yml/cfg.yml.tar.gz/ 2024-09-27 20:45:26 +02:00