3016 Commits

Author SHA1 Message Date
Lauri Vasama 68436c58d6 StatementOpInterface::isIndirectlyNoFallthrough 2025-11-12 15:28:54 +02:00
Lauri Vasama 121f408bdd More Clift op helpers 2025-11-12 15:28:54 +02:00
Lauri Vasama c09862516d Make Clift operations commutative 2025-11-12 15:28:54 +02:00
Lauri Vasama a912df4c06 Fix loop label related issues 2025-11-12 15:28:54 +02:00
Alessandro Di Federico 5d3973b111 Model verify: allow / in most places
`/` is now supported in names except for the parts of the model that use
the name as the key, i.e., `DynamicFunction` and `LocalIdentifier`.

Eventually, `/` should be allowed there as well, but we first need to
make sure that when they end up in a location they are properly
escaped/unescaped.
2025-11-11 17:56:54 +01:00
Pietro Fezzardi 1480a3f0aa Move simplifyTerminator into IDS source file
The implementation of `simplifyTerminator` is very specific to the
operations of IDS, can be easily misused, and is not currently used
anywhere else in the codebase.
2025-11-06 13:32:56 +01:00
Pietro Fezzardi ff3ab1183d ScopeGraphUtils: improve simplifyTerminator docs 2025-11-06 13:32:56 +01:00
Alessandro Di Federico 21d9cb56a0 Ban functions in .bss 2025-11-05 12:02:58 +01:00
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 2025-10-31 17:25:03 +01:00
Alessandro Di Federico d8b0395253 VariableManager: move fields declarations to top 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 6b78293b22 RawBinaryView: outline to .cpp 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
Lauri Vasama 086dc9fbc9 Remove RecursiveCoroutine operator*
* Add rc_eval to force evaluation.
2025-10-31 17:23:52 +01:00
Lauri Vasama 429608d122 RecursiveCoroutine improvements 2025-10-31 17:23:52 +01:00
Lauri Vasama fb34338310 Add UniqueCoroutineHandle 2025-10-31 17:23:52 +01:00
Ivan Krysak 5b419540cc Disable IRBuilder checks in some additional places 2025-10-31 09:04:59 +01:00
Alessandro Di Federico 0d5e05688d collectTuple: add non-recursive implementation 2025-10-29 15:10:18 +01:00
Alessandro Di Federico dfbe005307 ReadFields: switch to vectors 2025-10-29 15:10:18 +01:00
Alessandro Di Federico 46a0af46c8 TupleTree visits: improve handling of upcast 2025-10-29 15:10:18 +01:00
Alessandro Di Federico 724703910c QuickMetadata: add support for bool 2025-10-29 10:57:41 +01:00
Alessandro Di Federico 97e75d0019 MetaAddress: improve verify 2025-10-29 10:56:59 +01:00
Alessandro Di Federico e81dbfd898 Minor changes 2025-10-29 10:56:50 +01:00
Alessandro Di Federico c9e7ba7943 TupleTree visits: bypass access tracking
Use non-`const` version to bypass tracking.
2025-10-28 09:18:27 +01:00
Alessandro Di Federico db8eb227b9 TupleTreePath: rewrite with TraitfulAny 2025-10-28 09:18:27 +01:00
Alessandro Di Federico 97415b5ffe TupleTree visits: fix handling of upcast
We now suspend tracking before calling `.upcast`.
2025-10-24 18:24:25 +02:00
Alessandro Di Federico 0d066767f2 mips: fix f register size 2025-10-24 18:24:03 +02:00
Alessandro Di Federico 8cef543257 MFP: improve logging 2025-10-24 18:23:44 +02:00
Alessandro Di Federico 1e55635b65 Introduce efa::FunctionEdgeType::Unexpected 2025-10-24 18:23:23 +02:00
Alessandro Di Federico fb80f4b8bd FunctionCallIdentification: handle delay slot 2025-10-24 18:21:07 +02:00
Alessandro Di Federico ed3fc26166 MaterializedValue: handle loading mutable data 2025-10-24 18:20:54 +02:00
Alessandro Di Federico 4fb6b5f4e1 Minor changes 2025-10-24 18:20:48 +02: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 50823caaf6 Introduce IRBuilder wrapper 2025-10-21 19:16:58 +03:00
Lauri Vasama 7980e57fb5 Add Clift C legalization pass 2025-10-21 09:15:40 +02:00
Lauri Vasama 02d3c82887 Add support for Clift for-loop initializers 2025-10-21 09:15:40 +02:00
Lauri Vasama bf5adce413 Overhaul Clift loop syntax, add break/continue 2025-10-21 09:15:40 +02:00
Lauri Vasama 16589c935c Add BranchOpInterface for if and switch 2025-10-21 09:15:40 +02:00
Lauri Vasama 3d9df0f50d Add then marker for Clift if-statement assembly 2025-10-21 09:15:40 +02:00
Lauri Vasama 34cd63e60c Add CliftOpHelpers.h 2025-10-21 09:15:40 +02:00
Lauri Vasama 7da5792f0a Add Clift label and jump operation interfaces 2025-10-21 09:15:40 +02:00
Lauri Vasama f3be99f317 Use keyword for attr dicts of ops with regions 2025-10-21 09:15:40 +02:00
Lauri Vasama 26e6b9086c Simplify Clift pass declarations 2025-10-21 09:15:40 +02:00
Giacomo Vercesi 6abba05d7e Introduce ImportFiles pipe
Introduce the `ImportFiles` pipe which leverages the newly-introduced
`FileStorage` to fetch the required files and store them in the
`BinariesContainer`.
2025-10-16 17:48:45 +02:00
Giacomo Vercesi b622fe8f19 Implement FileProvider interface
Implement the `FileProvider` interface, this allows pipes to request
files given a `FileRequest` (hash and optional size/name).
2025-10-16 17:48:45 +02:00
Giacomo Vercesi 40da49548b Add Binaries list to the model
Add to the model an entry detailing the list of input binaries under
`Binaries`. This will be referenced by `Segments` when needed.
2025-10-16 17:48:45 +02:00
Giacomo Vercesi e57442fafe Introduce Tar.h
Split off the `GzipTarReader` into `Tar.h`, include a normal
`TarWriter` class which leverages libarchive to generate the tar file.
2025-10-16 16:08:05 +02:00
Giacomo Vercesi 2f83d8f5c9 Introduce CUniquePtr
Add a helper using of `std::unique_ptr` that allows easier wrapping of
C pointer with destructors.
2025-10-16 16:08:05 +02:00
Giacomo Vercesi ca0f312b1e Pipebox: remove const from ArrayRef
Remove the `const` from `ArrayRef<const char>` as the `ArrayRef` already
implies the underlying type will be accessed only in `const`.
2025-10-16 16:07:09 +02:00