Commit Graph

61 Commits

Author SHA1 Message Date
Ivan Krysak 729b025de3 CAttributes.h: move back to PTML
When `revng` and `revng-c` were being merged, this header founds its
way into `revngSupport` even though it makes more sense under the PTML
umbrella.
2026-03-27 07:19:27 +00:00
Ivan Krysak e706628a49 Rename Annotations.h into CAttributes.h 2026-03-27 07:19:27 +00:00
Giacomo Vercesi d479438d3c Add ImportFromC analysis to pypeline 2026-03-04 14:58:02 +01:00
Ivan Krysak b5f98fcae9 check-conventions: ban anonymous header namespaces 2026-02-25 12:47:27 +01:00
Alessandro Di Federico 5820908675 Remove and ban \file 2025-12-16 17:41:55 +01:00
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 1429b526ab Introduce libtcg
This commit drops libptc in favor of its new form libtcg.

It brings several improvements, among which:

* The QEMU version we work on has been upgraded.
* CPUStateAccessAnalysis has been reimplemented in a way that makes it
  easier to debug and solves some limitations (e.g., tracking leaking
  pointers).
* Identification of pieces of the CPU state that are read by each helper
  and fixing access to the CPU state is now performed at build-time.
* We no longer mmap the code we need to translate, dropping all the
  issues related to code that needed to be mapped where something is
  already present.
* We now have two distinct flavors of helper modules: the full one and
  the "slim" one. The latter contains the definition only of functions
  we intend to inline. It is used in most of the pipeline, a good thing
  since we spend less time optimizing code we don't really care about.
  The full module is only used on the re-compilation branch of the
  pipeline.
* We no longer split the `cpu_loop` function.
* We change MetaAddress to rely on architectures from `model::` as
  opposed to the LLVM ones.
* We no longer attach debug info to LLVM IR containing the original
  assembly.
* We now verify that the lifted code only contains code we expect.
2025-10-31 17:25:03 +01:00
Ivan Krysak ecb9d76c64 Model: drop obsolete default value handling 2025-10-13 18:33:10 +03:00
Ivan Krysak 77ea07c364 Minor improvements 2025-10-08 12:22:30 +03:00
Ivan Krysak c6a175a1b9 Rename _START_AT -> _STARTS_AT 2025-08-29 14:00:29 +03:00
Ivan Krysak 290d2e2c57 ptml::CTypeBuilder: rename into ModelCBuilder 2025-07-23 11:38:53 +02:00
Pietro Fezzardi ea3cbe4c1b Drop type inlining
Type inlining was a feature that allowed type definitions of
structs/unions/enums to be printed in C directly inside the definition
of another parent struct/union, if the inner type was only used once in
the parent type.

This kind of reasoning is inherently global: a type definition of the
subtype can be inlined in the parent type one only if *globally* the
subtype it isn't referred anywhere else.

This caused issues with type inlining inside definitions of stack types
in the body of functions. Indeed, for a given function, due to type
inlining, it was necessary to do global reasoning about what other types
could be inlined in the definition of the function's stack frame type.
This, in turn, had heavy consequences on invalidation, because any
change to any type (even if it wasn't referred in a given function's
body) was causing invalidation of all functions' bodies.

For this reason it was decided to drop the type inlining feature.
2025-05-28 17:11:56 +02:00
Pietro Fezzardi 8c7a800de1 Rename CTypeBuilder::printForwardTypeDeclaration
to printForwardDeclaration.
2025-05-28 17:11:11 +02:00
Ivan Krysak c7bba8c1b9 Prevent Support headers from depending on PTML 2025-05-08 15:42:01 +02:00
Giacomo Vercesi cf08ae41be Drop usage of llvm::ErrorOr<T>
Remove the last two remaining classes in revng which used the
`llvm::ErrorOr` class, replace them with `llvm::Expected`.
2025-05-05 16:02:40 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Ivan Krysak 6ea75f02b3 Model: switch to the new namespace verifier 2025-04-15 16:35:42 +03:00
Ivan Krysak 3edb6cbb9b Minor improvements 2025-04-15 16:35:42 +03:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Ivan Krysak 64446d0453 Adopt name builder across the model users 2024-11-06 19:18:53 +02:00
Ivan Krysak efbc5cdd5c Introduce an error creation helper 2024-11-06 19:18:53 +02:00
Alessandro Di Federico 98903f6b07 Move Ranks.h to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico 253558ba63 Minor changes 2024-11-04 15:09:56 +01:00
Ivan Krysak 1a35cbcb77 Introduce PTMLCTypeBuilder 2024-10-15 10:45:13 +03:00
Ivan Krysak 8aa7b55e2d PTMLIndentedOstream: rename into IndentedOstream 2024-10-15 09:13:28 +02:00
Ivan Krysak 8288bd68d2 PTMLCBuilder: rename into ptml::CBuilder 2024-10-15 09:13:28 +02:00
Alessandro Di Federico 045f982a32 Improve usage of Expected<T> 2024-10-09 15:16:55 +02:00
Alessandro Di Federico 8a5ae5f9c1 s/ExecutionContext &Ctx/ExecutionContext &EC/g 2024-09-27 10:35:10 +02:00
Alessandro Di Federico 08e1dc0f05 Drop no-op Pipe::checkPrecondition 2024-09-27 10:35:10 +02:00
Alessandro Di Federico ca99bbbb66 Adopt toString() 2024-09-26 17:51:08 +02:00
Ivan Krysak a8b5ebdd95 import-from-c: rework testing from the ground up 2024-09-04 16:55:49 +02:00
Pietro Fezzardi 4d845c5cdb HeaderToModel: drop unused Logger 2024-09-04 16:55:49 +02:00
Pietro Fezzardi 4e2617f4c5 HeaderToModel: fix double parsing of enums 2024-09-04 16:55:48 +02:00
Ivan Krysak d36e50e0d1 HeaderToModel: switch to the new annotation system 2024-09-04 16:44:23 +02:00
Ivan Krysak e67a08ce05 HeaderToModel: greatly improve reported errors 2024-09-04 16:43:40 +02:00
Ivan Krysak cc16b8f3c8 HeaderToModel: improve RFT argument handling 2024-09-04 16:43:23 +02:00
Ivan Krysak 60391c9ab6 HeaderToModel: forbid stack return values in RFTs 2024-09-04 16:43:07 +02:00
Ivan Krysak adb1551283 HeaderToModel: make type ID detection stricter 2024-09-04 16:42:50 +02:00
Ivan Krysak 73a723e9f4 HeaderToModel: rework error reporting 2024-09-04 16:42:29 +02:00
Ivan Krysak 748e4dd560 HeaderToModel: add code annotation support 2024-09-04 13:04:44 +03:00
Ivan Krysak cb82331a17 HeaderToModel: add struct size annotation support 2024-09-04 13:04:44 +03:00
Ivan Krysak e708f3f8fc HeaderToModel: add padding annotation support 2024-09-04 13:04:44 +03:00
Ivan Krysak ee22a5a558 HeaderToModel: clean up type replacement 2024-09-04 13:04:44 +03:00
Ivan Krysak 000d9f26aa HeaderToModel: revamp annotation parsing 2024-09-04 13:04:44 +03:00
Ivan Krysak b297bec1bb HeaderToModel: clean up global strings 2024-09-04 13:04:44 +03:00
Ivan Krysak dc6f2456be Minor improvements 2024-09-04 13:04:44 +03:00
Pietro Fezzardi dfe3f4cb47 Rename revng C headers for decompiled code
Strip away the 'revng-' prefix from the filename.
2024-06-27 17:26:18 -04:00