31 Commits

Author SHA1 Message Date
Alessandro Di Federico 903617e79e IRHelpers: turn some functions into IRBuilder::* 2026-06-19 09:18:16 +02:00
Pietro Fezzardi 59f91dcfc0 MakeModelGEP: drop unnecessary includes 2026-04-10 15:27:24 +02:00
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 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
Pietro Fezzardi 03e0de9458 Improve debug info propagation in legacy pipeline 2025-09-10 17:44:02 +02:00
Pietro Fezzardi e68ab95102 MakeModelCasts: cast array indices to integers 2025-05-29 09:38:09 +02:00
Pietro Fezzardi 6e2618a988 MakeModelCasts: improve logging 2025-05-29 09:31:26 +02:00
Pietro Fezzardi f13e919678 MakeModelCastPass: allow casting non-scalars
Before this commit, MakeModelCastPass was assuming that it would never
try to emit casts involving non-scalars, which don't compile in C.

From now on, the semantic of ModelCast in understood to be bitcast, and
it's valid also when involving non-scalar types.
This may cause the emission of ModelCast that are then emitted in C as
casts that don't compile.
Since the LLVM-based decompilation pipeline is deprecated in favor of
the clift-based decompilation pipeline, this is now considered
acceptable, as long as the C backend prints a warning and a comment on
the broken cast.
2025-03-05 14:47:46 +01:00
Pietro Fezzardi 7f7c38fa35 MakeModelCastPass: postpone arguments computation
This commits reworks MakeModelCastPass so that the computation the of
arguments for the invocation of a ModelCast are now computed later: not
when we decided that a cast must be emitted, but right before we emit
the call.

This simplifies the code and lays the groundwork for relaxing some
assertions later.
2025-03-05 14:47:46 +01:00
Pietro Fezzardi bd1f2f3422 MakeModelCastsPass: add model::Binary * member
This field is initialized at the entry of the `runOnFunction` method, to
avoid passing it throughout a bunch of methods as explicit argument.
2025-03-05 14:47:46 +01:00
Pietro Fezzardi 556e14dfb1 MakeModelCastsPass: drop unused member 2025-03-05 14:47:46 +01:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +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 8706fd8459 Initialize pointers to nullptr 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 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
Ivan Krysak 95cfa4785f MakeModelCastPass: remove an obsolete if branch 2024-06-27 11:07:02 +02:00
Ivan Krysak 94a0ad6b93 Adopt reworked model::Type 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 5186a58053 s/FunctionMetadata/ControlFlowGraph/ 2024-06-18 17:56:24 +02:00
Djordje Todorovic c58fec45e3 Add ImplicitModelCastPass
We introduce a new LLVM Pass that should detect implicit
casts, by marking the 3rd argument of ModelCast as `true`.
The backend will omit printing a cast expression if the
ModelCast is implicit one.
2024-05-16 17:57:22 +02:00
Djordje Todorovic 39f513f9b5 MakeModelCast: replace SExt ZExt Trunc 2024-05-16 17:57:22 +02:00
Djordje Todorovic c4eda86471 MakeModelCast: Change OpaqueFunctionsPool
Introduce new key: use TypePair instead of Type *.
2024-05-16 17:57:22 +02:00
Djordje Todorovic dd68f7d810 Move casts to MakeModelCastPass
Production of casts in backend should be indicated by
call to ModelCast only. This patch implements that.
2024-05-16 17:57:22 +02:00
Ivan Krysak a88b03aef8 Backend: fix an assertion on a lost typedef 2024-03-15 19:05:10 +01:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Alessandro Di Federico 7a2e315e29 s/IRCanonicalization/Canonicalize/g 2024-02-09 09:03:34 +01:00