73 Commits

Author SHA1 Message Date
Alessandro Di Federico 12b9a44ace Ban dynamic-size allocas, use ArrayType instead 2026-06-19 09:18:16 +02:00
Alessandro Di Federico 903617e79e IRHelpers: turn some functions into IRBuilder::* 2026-06-19 09:18:16 +02:00
Alessandro Di Federico 0bf97a9e68 getPointerSizedInteger: use model::Architecture
No need to get model::Binary.
2025-12-22 11:34:47 +01:00
Alessandro Di Federico ce4f6ef996 llvmName: turn into a free function 2025-12-22 11:34:46 +01:00
Giacomo Vercesi 1632aeac73 Comment run* function with inlinable content
Add `TODO` comments to piperuns' `run*` functions that will have content
inlined once the old pipeline is removed.
2025-12-10 16:16:14 +01:00
Giacomo Vercesi a8ed75fdb1 Add CleanupIR to pypeline 2025-12-10 16:16:14 +01:00
Giacomo Vercesi e4e259df3c Add MakeSegmentRef to pypeline 2025-12-10 15:05:53 +01:00
Giacomo Vercesi 0bc74e0234 Add PromoteInitCSVToUndef to pypeline 2025-12-10 15:05:53 +01:00
Giacomo Vercesi e13e5add06 Add RemoveLiftingArtifacts to pypeline 2025-12-10 15:05:53 +01:00
Pietro Fezzardi 2397b82bcd MakeSegmentRef: fix handling of constexpr casts 2025-11-28 16:14:02 +01:00
Pietro Fezzardi d61f06756f MakeSegmentRef: handle multiple identical operands 2025-11-14 15:53:29 +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
Alessandro Di Federico f8bd4c3bac Move around some files in preparation for libtcg
* Make the following private headers public:
  * Lift/CPUStateAccessAnalysisPass.h
  * Lift/CSVOffsets.h
  * Lift/PTCDump.h
  * Lift/VariableManager.h
* Move from revngSupport to revngLift:
  * IRAnnotators.{h,cpp}
  * SelfReferencingDbgAnnotationWriter.{h,cpp}
* Move from revngSupport to revngModel:
  * FunctionTags.{h,cpp}
  * ProgramCounterHandler.{h,cpp}
* Move from revngSupport to revngRecompile:
  * OriginalAssemblyAnnotationWriter.{h,cpp}
2025-10-24 15:34:11 +02:00
Ivan Krysak 2ba5ca3e3d Suppress selected IRBuilder checks 2025-10-21 19:17:37 +03:00
Ivan Krysak 3561c2b907 Adopt IRBuilder wrapper 2025-10-21 19:17:01 +03:00
Ivan Krysak 76ed261375 Use revng_undefined_ instead of init_
Current `init_` prefix used to set the default values of SCVs
is very common in typical code, hence it would cause a lot of
collisions.
2025-04-17 11:19:17 +03:00
Ivan Krysak 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03:00
Ivan Krysak 8841bc7144 Don't include model::NameBuilder from the binary 2025-02-13 13:09:50 +02:00
Pietro Fezzardi 18ec6ac53c MakeSegmentRef: use hasSegmentKeyMetadata helper 2025-01-29 15:17:15 +01:00
Pietro Fezzardi 1fb613579f Drop leftover useless files 2025-01-29 15:17:15 +01:00
Alessandro Di Federico 36edf810ef Introduce support for function pointers 2025-01-28 15:20:45 +01:00
Pietro Fezzardi 6ceca5891b MakeSegmentRef: ignore args of OpaqueExtractValue 2025-01-10 16:47:05 +01:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Alessandro Di Federico 8cd4ee3b59 Move Kinds.h to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico 4e670ac8e6 Either link revngcSupport or revngSupport 2024-11-04 15:09:56 +01:00
Alessandro Di Federico 2e4f4d09b9 Remaining FunctionTags have been moved to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico e239e18b0c Adopt FunctionPoolTag 2024-11-04 15:09:56 +01:00
Alessandro Di Federico 800340d6e8 IRHelpers.cpp has been moved to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico a1889b77b3 s/(LLVMContainer &)TargetsList/\1ModuleContainer/ 2024-09-27 10:35:10 +02:00
Alessandro Di Federico 8a5ae5f9c1 s/ExecutionContext &Ctx/ExecutionContext &EC/g 2024-09-27 10:35:10 +02:00
Alessandro Di Federico 9c99ac33ac s/serializeToLLVMString/toLLVMString/ 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 4653796008 Drop Pipe::print 2024-09-27 10:35:10 +02:00
Alessandro Di Federico ca99bbbb66 Adopt toString() 2024-09-26 17:51:08 +02:00
Alessandro Di Federico e1f46264f8 Ensure every pipe commits what it should 2024-09-26 17:51:07 +02:00
Alessandro Di Federico 0cb3eedd37 Do not use CallBase::getCalledFunction
Use our wrapper, which does not return nullptr if the `FunctionType`s do
not match.
2024-08-07 15:40:56 +02:00
Pietro Fezzardi a12b621832 Add CleanupIRPass 2024-06-27 17:14:28 -04:00
Ivan Krysak 94a0ad6b93 Adopt reworked model::Type 2024-06-27 11:07:01 +02:00
Ivan Krysak c2b4fb70bb Model: rename TypePath to DefinitionReference 2024-06-27 11:07:01 +02:00
Ivan Krysak 3705906074 Model: rename Type into TypeDefinition 2024-06-27 11:07:01 +02:00
Alessandro Di Federico 988af25a7d Adopt UniquedBy* FunctionTags for deduplication 2024-06-26 12:21:58 +02:00
Alessandro Di Federico e22ea4b2d8 Minor changes 2024-05-29 12:23:32 +02:00
Pietro Fezzardi 847cad3422 MakeSegmentRef: fix checks on pointer size 2024-03-19 09:44:00 +01:00
Alessandro Di Federico 308e7eccd9 MakeSegmentRef: limit strings to pointer-sized int 2024-03-01 16:11:28 +01:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Alessandro Di Federico b997e24280 PromoteInitCSVToUndef: preserve link register only 2024-02-09 09:04:25 +01:00
Alessandro Di Federico f6f542769b Convert all public strings to kebab-case 2024-02-09 09:04:25 +01:00
Pietro Fezzardi 8acf6c2f94 Allow type-less Segments in the Model 2024-02-09 09:04:23 +01:00
Massimo Fioravanti 86e45461a0 Introduce pipeline execution context 2024-01-02 11:05:50 +01:00
Alessandro Di Federico 9d4cea6d7f RemoveLiftingArtifacts: update what gets purged
We used to manually purge `raise_exception_helper`, which has now been
split in `_abort` and `_unreachable`.  We want to purge the latter but
keep the former. The latter is marked as `Exceptional`, so this commit
updates the logic to purge all functions with `Exceptional` tag.

Also, due to the inability of the backend to emit globals of `struct`
type, we ban `set_PlainMetaAddress`, which is not critical for
decompiled code.
2023-12-12 10:58:58 +01:00