Commit Graph

3168 Commits

Author SHA1 Message Date
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak f494ae5f5f Standardize comment formatting
Use `*something*` instead of `_something_` when adding emphasis.
2025-02-13 13:09:50 +02:00
Ivan Krysak 492e5dc354 Yield: greatly simplify node size calculation 2025-02-13 13:09:50 +02:00
Ivan Krysak bd68130eaa Yield: adopt CommentLineWidth 2025-02-13 13:09:50 +02:00
Ivan Krysak 99a8e28e3b PTMLCTypeBuilder: adopt CommentLineWidth 2025-02-13 13:09:50 +02:00
Ivan Krysak 05faed3795 PTML: introduce a way to disable comment warnings 2025-02-13 13:09:50 +02:00
Ivan Krysak fb95595b10 Backend: add comment emission support 2025-02-13 13:09:50 +02:00
Ivan Krysak 45e01ae0d2 Introduce a pipe for embedding statement comments 2025-02-13 13:09:50 +02:00
Ivan Krysak 255bd256fe Backend: expose isStatement helper 2025-02-13 13:09:50 +02:00
Ivan Krysak ab1da1d986 FunctionTags: introduce Comment 2025-02-13 13:09:50 +02:00
Ivan Krysak de7d13c7d7 Yield: adopt statement comments in disassembly 2025-02-13 13:09:50 +02:00
Ivan Krysak d4ab801ab7 Rename range_with_value_type into RangeOf
Original name was reminiscent of the STL, but there's no such concept
in there, as such it's probably better to use revng naming convention
instead.
2025-02-13 13:09:50 +02:00
Ivan Krysak 3ec854421b Yield: separate prefix size computation 2025-02-13 13:09:50 +02:00
Ivan Krysak 1c9b6a70db PTML: add statement comment support 2025-02-13 13:09:50 +02:00
Ivan Krysak 08bd4ecca8 Model: introduce statement comment verification 2025-02-13 13:09:50 +02:00
Ivan Krysak 9564959871 Model: introduce statement comments 2025-02-13 13:09:50 +02:00
Ivan Krysak 9e48994c97 EFA: pass the block to the new nodes
Before this commit, only its index was passed.
2025-02-13 13:09:50 +02:00
Ivan Krysak 8841bc7144 Don't include model::NameBuilder from the binary 2025-02-13 13:09:50 +02:00
Ivan Krysak 6c43cebc90 Model: let VerifyHelper depend on NameBuilder 2025-02-13 13:09:50 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Ivan Krysak 929cb4b35b Minor improvements 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
Ivan Krysak 9bb71627ea ToCABI: do basic float detection cleanup
Note that this whole thing is going to get redesigned from scratch
(by manifesting a proper type system graph) when we'll finally start
working on the *real* float support.
2025-02-12 16:43:11 +02:00
Ivan Krysak e4d9a022cd ToCABI: factor alignment computation out
Alignment considerations all over the place where growing increasingly
verbose and complex, increasing the likelihood of getting them wrong.

This unifies all the alignment logic in one place.
2025-02-12 16:43:05 +02:00
Ivan Krysak a5a2bead4f ABI: fix success detection and trailing padding
There were issues with how trailing padding is processed which sometimes
led to it being discarded. That should not happen from now on.

As a size benefit this also strictens the exit condition and improves
wording on some of the comments.
2025-02-12 16:40:59 +02:00
Ivan Krysak 7ad6b52974 ABI: improve distributor safety
This makes sure we never try to use a distributor object after
discarding some of its outputs.
2025-02-12 16:36:20 +02:00
Ivan Krysak ab535feb13 ABI: always use distributor for index selection 2025-02-12 16:36:20 +02:00
Ivan Krysak 8e85515969 ABI: fix mishandling of the top of the stack
Some ABI's (think mips) require a part of the stack to be reserved,
but before this patch we treated those fields as arguments.

Note that this analysis never inserts fields, so if there are no
sufficient field already inserted before-hand it's just going to fail
the conversion (for example, if the field at the *newly adjusted*
offset 0 is not present).
2025-02-12 16:36:20 +02:00
Ivan Krysak 566cbad8ae ToCABI: switch argument verification pair
Before this, arguments were verified in a (current, next) pair,
this makes it so (previous, next) pair is used instead.
2025-02-12 16:36:20 +02:00
Ivan Krysak c861e1c552 ToCABI: bundle argument-specific data together 2025-02-12 16:36:20 +02:00
Ivan Krysak 2521ffc1be ABI: allow ValueDistributor reassignment 2025-02-12 16:36:20 +02:00
Ivan Krysak 69144a7e3b ToCABI: improve function name logging 2025-02-12 16:36:18 +02:00
Ivan Krysak 492c169217 ToCABI: mark AAPCS64 as a safe ABI 2025-02-12 16:26:56 +02:00
Ivan Krysak 9186d476d2 ToCABI: fix mistreating of the safe cli argument 2025-02-12 16:26:56 +02:00
Ivan Krysak 850677115e Minor improvements 2025-02-12 16:26:56 +02:00
Giacomo Vercesi a06b380ce0 S3StorageClient: implement parallel upload
Allow uploads to S3 to be executed in parallel, this should reduce the
time it takes for a `save` operation to conclude.
2025-02-06 12:21:23 +01:00
Giacomo Vercesi 761e84fc9f Add revng::cantFail
Add the `revng::cantFail` function which allows to wrap functions with
`std::error_code` and check their result. This is analogous to
`llvm::cantFail` for `llvm::Error`.
2025-02-05 10:46:00 +01:00
Pietro Fezzardi a18c32dd95 Decompile Function: fix escaping of char literals
Before this commit, char literals were always printed with html
escaping, even if the associated PTML builder was set to Tagless.

This commit fixes the problem.
2025-02-03 17:24:12 +01:00
Pietro Fezzardi c33b7c9c4a DecompileFunction: drop unused Model arguments 2025-02-03 17:07:36 +01:00
Pietro Fezzardi 4efcce2867 DLA: fixed invalid access to NotMergedNode
Before this commit, the DLAStep DeduplicateFields was using
NotMergedNode (a reference) in an assertion, in a place where it was
already invalidated by a preceding call to
CollapseSingleChild::collapseSingle that can mutate the graph.

This caused the assertion to trigger erroneously in some situations.

This commit moves the assertion earlier, in a place where the reference
is guaranteed to always be valid.
2025-01-30 18:00:21 +01:00
Pietro Fezzardi 298e49d80b DLA: add comment on assumptions 2025-01-30 18:00:00 +01:00
Pietro Fezzardi 2c79e3f5b8 DLA: reuse number of children in DeduplicateFields 2025-01-30 17:57:41 +01:00
Lauri Vasama 6343bfcb40 Add c-verify pass 2025-01-30 14:52:47 +02:00
Lauri Vasama 998114501b Replace PlatformInfo with TargetCImplementation 2025-01-30 14:52:47 +02:00
Lauri Vasama 06d91d485d Factor visitation out of ModuleOp verify 2025-01-30 14:52:47 +02: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 391f5c780f SwitchToStatements: use LocalVariableBuilder 2025-01-29 23:55:49 +01:00
Pietro Fezzardi 0f2466e84b SegregateStack: drop old unused LocalVarPool 2025-01-29 15:17:15 +01:00
Pietro Fezzardi 1676ecdd8f SegregateStack: emit AddressOf only in legacy mode 2025-01-29 15:17:15 +01:00