19 Commits

Author SHA1 Message Date
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 e13e5add06 Add RemoveLiftingArtifacts to pypeline 2025-12-10 15:05:53 +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
Alessandro Di Federico 8cd4ee3b59 Move Kinds.h to revng 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 800340d6e8 IRHelpers.cpp has been moved to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico e1f46264f8 Ensure every pipe commits what it should 2024-09-26 17:51:07 +02:00
Alessandro Di Federico e22ea4b2d8 Minor changes 2024-05-29 12:23:32 +02:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +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
Massimo Fioravanti fdf5cf0325 Fix incorrect usage of TaggedFunctionKinds
A bug in revng allowed to use any TaggedFunctionKinds in place of any
other one. That bug has been fixed and the wrong usages in revng-c have
been updated.
2023-11-06 14:35:06 +01:00
Alessandro Di Federico dfb18bd1cf RemoveLiftingArtifacts: drop makeInitRegsUndef
Redundant w.r.t. PromoteInitCSVToUndef.
2023-02-21 16:48:35 +01:00
Massimo Fioravanti 5d730d1411 Upgrade to support starless revng 2022-10-20 16:06:13 +02:00
Alessandro Di Federico c14677b162 RemoveLiftingArtifacts: do not fail, if env is absent 2022-09-26 17:02:38 +02:00
Massimo Fioravanti 370b081c0e Moved kinds to kinds namespace 2022-08-25 17:09:15 +02:00
Pietro Fezzardi f62cdc1181 RemoveLiftingArtifacts: promote init_* to undef 2022-05-31 12:40:52 +02:00
Pietro Fezzardi 97f0f8c521 IRHelpers: add deleteOnlyBody helper 2022-05-11 15:19:34 +02:00
Pietro Fezzardi 350af8abc7 Add RemoveLiftingArtifacts Pass
This pass integrates all the other passes that were previously part of
the RemoveLifingArtifacts library.
2022-04-26 11:50:42 +02:00