Commit Graph

51 Commits

Author SHA1 Message Date
Alessandro Di Federico dcc795c424 Drop Logger's StaticEnabled feature 2025-10-31 14:49:05 +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 3561c2b907 Adopt IRBuilder wrapper 2025-10-21 19:17:01 +03:00
Ivan Krysak a285ad2785 IRHelperRegister: get a comment from Description 2025-07-23 11:38:53 +02: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 8a8e0ce4ae PromoteStackPointer: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak 154287b5d5 init_local_sp: drop leading _ 2025-04-17 11:19:17 +03: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 2e4f4d09b9 Remaining FunctionTags have been moved to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico 5d0d4005c5 s/Ctxt?/Context/g 2024-09-27 10:35:10 +02:00
Alessandro Di Federico e1f46264f8 Ensure every pipe commits what it should 2024-09-26 17:51:07 +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
Ivan Krysak cb113db124 PromoteSP: stop using Layout 2024-03-18 17:24:01 +01:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Alessandro Di Federico 330d2b6cc7 Model: rework how we name things
This commit:

* Introduces `_` as a prefix for all non-user entities we emit in
  decompiled code.
  Also, some names have been changed to be more concise.
  Specifically, the following entities have changed:
  `_ENUM_UNDERLYING`, `_ABI`, `_REG`, `_padding_at_`,
  `_artificial_struct_`, `_artificial_wrapper_`, `_stack`,
  `_break_from_loop_`, `_var_`, `_stack_arguments`,
  `_artificial_struct_returned_`, `_enum_max_value_`.
* Introduce _PACKED for `__attribute__((packed))`.
* `EnumEntry` name: drop the `EnumType` name prefix.
2023-08-23 16:37:39 +02:00
Alessandro Di Federico 017aa6a47f Drop CallToLifted
We no longer have such tag, we now inspect the callee using
`isCallToIsolatedFunction`.
2023-04-14 14:54:14 +02:00
Alessandro Di Federico 887009a14b InaccessibleMemOnly: adopt MemoryEffects 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 21bbd8b414 Drop usages of Type::getPointerElementType 2023-04-14 14:54:14 +02:00
Alessandro Di Federico 0e5863e2e4 Make CreateLoad usages opaque pointers-compatible 2023-04-14 14:54:14 +02:00
Ivan Krysak c2f0fc19e5 ABI: FunctionType.h -> FunctionType/Layout.h 2023-03-15 10:28:24 +01:00
Alessandro Di Federico e73bd95493 Improve handling of declarations
SegregateStackAccesses and PromoteStackPointer were not handling
functions declarated (but not defined) properly.

This commit fixes this, in part by adopting `TaggedFunctionPass`.
2023-03-13 13:42:33 +01:00
Alessandro Di Federico 098b9b3aa4 PromoteStackPointer: prevent DCE of init_local_sp
We need to prevent DCE from killing `revng_init_local_sp`, since certain
passes downstream might want to introduce new uses of it, and they might
be the first.

`SegregateStackAccesses` will take care of removing it by hand.
2023-02-21 16:48:35 +01:00
Massimo Fioravanti 87aef3fbad revng-c now uses Model accessors 2022-12-12 11:35:52 +01:00
Alessandro Di Federico 32e8333f58 PromoteStackPointer: handle CABIFunctionType 2022-12-01 12:20:09 +01:00
Massimo Fioravanti 335d402245 Change signatures to forward metadata cache. 2022-11-22 12:27:02 +01:00
Massimo Fioravanti 5d730d1411 Upgrade to support starless revng 2022-10-20 16:06:13 +02:00
Massimo Fioravanti 370b081c0e Moved kinds to kinds namespace 2022-08-25 17:09:15 +02:00
Pietro Fezzardi 234f9cf401 Add PromoteStackPointerPipe 2022-04-26 14:21:59 +02:00
Alvise de Faveri 72461f6329 Add attributes to revng_init_local_sp() 2022-04-20 17:35:05 +02:00
Giacomo Vercesi ab125b35b0 Fix License headers
Change company name to "rev.ng Labs Srl" in all license headers
to reflect changed company name and legal status
Add missing license headers to files that didn't have one
2022-04-19 12:17:59 +02:00
Antonio Frighetto 765219d58c Support for control-flow graph out of the model
The control-flow graph has been taken out of the model. Related changes
to `getCallSitePrototype` have been here addressed.
2022-04-06 16:25:05 +02:00
Alessandro Di Federico 77335d036a Rename Lifted tag to Isolated 2022-03-17 14:08:05 +01:00
Alessandro Di Federico 5d197bff15 Adopt API changes in the model 2022-03-10 17:59:05 +01:00
Pietro Fezzardi 198ecd08d9 Update to new revng API for getCallSitePrototype
This commit updates the calls to getCallSitePrototype according to the
new API introduced in revng in commit 0659e6b6a3
2022-03-02 18:04:36 +01:00
Pietro Fezzardi d237bc439e IRCanonicalization: switch to FunctionTags 2022-01-14 14:29:05 +01:00
Alessandro Di Federico 7a910eeb48 PromoteStackPointer: ignore CABIFunctionType 2022-01-09 14:14:03 +01:00
Alessandro Di Federico 24f5515842 Import passes of the new stack promotion pipeline 2021-12-17 14:01:00 +01:00
Alessandro Di Federico d733640143 Ensure functions begin with allocas only
Mixin `alloca`s with other instructions is malpractice.
2021-12-17 13:50:46 +01:00
Alessandro Di Federico f51808be24 Review PromoteStackPointerPass
* Adjust stack pointer upon returning from call.
  In architecture where the return address is pushed on the stack, on
  the caller side, we see the the push but not the pop. This means that,
  once the stack pointer is no longer global, we need to take this into
  account.
  This commit fixes this increase the stack pointer of
  `FinalStackOffset` right after a function call.
* Drop the size argument from the `revng_init_local_sp` function.  We
  will have a `revng_stack_frame` function to represent the actual stack
  frame pointing to its beginning.
2021-12-17 13:50:46 +01:00
Alessandro Di Federico 01e4fb7f88 Minor changes to PromoteStackPointerPass 2021-12-17 13:50:46 +01:00
Alessandro Di Federico 54e9a96a03 PromoteStackPointer: do not force stack alignment 2021-12-17 13:50:46 +01:00
Pietro Fezzardi 36e42855a5 PromoteStackPointer.cpp: fix deprecated include
This caused compilation error with llvm-12.
2021-05-27 17:14:25 +02:00
Pietro Fezzardi 36a525314a Detect isolated functions using FunctionTags 2021-04-27 21:19:06 +02:00
Pietro Fezzardi 52e29ccdbf PromoteStackPointer: do nothing with missing sp
The PromoteStackPointerPass now trivially handles running on modules
where the global variable for the stack pointer is missing.
When the global is not found, the pass just does nothing and returns
false.
This is necessary to handle very small functions, typically from tests.
2021-03-29 17:21:34 +02:00
Alessandro Di Federico 690e5fd9bd Update LoadModelPass usage 2021-03-16 12:01:15 +01:00
Pietro Fezzardi e95c21db25 Use Model to detect isolated functions 2021-02-23 10:39:05 +01:00
Pietro Fezzardi 148119c528 PromoteStackPointer: make local sp aligned 2021-02-09 15:07:04 +01:00