Commit Graph

154 Commits

Author SHA1 Message Date
Giacomo Vercesi cf08ae41be Drop usage of llvm::ErrorOr<T>
Remove the last two remaining classes in revng which used the
`llvm::ErrorOr` class, replace them with `llvm::Expected`.
2025-05-05 16:02:40 +02:00
Alessandro Di Federico e8947cced0 JTM::purgeTranslation: EliminateUnreachableBlocks 2025-04-30 17:40:55 +02:00
Giacomo Vercesi 0ac78dddba Fix codespell errors
Fix erros detected by the new version of `codespell`.
2025-04-24 13:22:14 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak e1c8c370f7 Lift: adopt helper registry 2025-04-17 11:19:17 +03:00
Ivan Krysak aa15d8ca21 Standardize abort-like function usage 2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Ivan Krysak 3edb6cbb9b Minor improvements 2025-04-15 16:35:42 +03:00
Alessandro Di Federico c5c657d11b Lift: increase determinism 2025-04-15 15:31:10 +02:00
Alessandro Di Federico 86f3dcf1ae Minor changes 2025-03-14 17:25:05 +01:00
Alessandro Di Federico c631f9505a JT::harvest: add a step doing instcombine 2025-02-20 17:58:26 +01:00
Alessandro Di Federico 62b518b381 Lift: limit instcombine to one iteration 2025-02-20 17:58:00 +01:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Alessandro Di Federico 2128a80cc8 Preserve metadata after Function::deleteBody
Also, introduce and adopt a simple helper class to get this right.
2025-01-28 12:19:16 +01:00
Alessandro Di Federico b70b3cbe55 RootAnalyzer: improve logging 2025-01-28 12:19:16 +01:00
Alessandro Di Federico ab0010b3f6 Reduce usage of PostHelper jump targets 2024-12-03 12:13:15 +01:00
Ivan Krysak 1eb80ecd2d Introduce an error creation helper 2024-11-06 15:20:37 +02:00
Alessandro Di Federico 16e01f43d6 Import revng-c's FunctionTags.h 2024-10-31 17:19:51 +01:00
Alessandro Di Federico 79689f0da2 s/(LLVMContainer &)TargetsList/\1ModuleContainer/ 2024-09-27 12:07:18 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Alessandro Di Federico c8d4381297 s/Context &Ctx/Context &Context/g 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 9bdce8e5c4 s/ExecutionContext &Ctx/ExecutionContext &EC/g 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 12a0a89e15 Ensure every pipe commits what it should
This commit is the final step in ensuring all the pipes commit what they
should. It also asserts this actually happens, enabling us to easily
catch future problems.
2024-09-27 12:07:16 +02:00
Alessandro Di Federico 0126f0ce9b CodeGenerator: use VirtualSize when ptc.mmaping 2024-09-27 12:07:16 +02:00
Alessandro Di Federico 744184c90c Do not use CallBase::getCalledFunction
Use our wrapper, which does not return nullptr if the `FunctionType`s do
not match.
2024-08-07 16:07:59 +02:00
Alessandro Di Federico 901a78a66f Lift: fix usage of empty instead of isEmpty 2024-07-09 08:58:51 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 94c9e9d4dd Make verifys inside asserts strict 2024-06-27 11:05:50 +02:00
Ivan Krysak 927e8006b9 Model: rename TypePath to DefinitionReference 2024-06-27 11:05:49 +02:00
Ivan Krysak 6a1018b860 Remove unused linter suppressors 2024-06-27 11:05:48 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Alessandro Di Federico f60c1bb4ad s/TrackGuard/DisableTracking/ 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 553d869d03 Drop Pipe::print method 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 148e6b1979 Rename all LLVMContainer arguments 2024-06-20 10:24:51 +02:00
Alessandro Di Federico bce1d6c0f3 Adopt invalidation along the core pipeline 2024-06-20 10:24:50 +02:00
Alessandro Di Federico b5f7576573 Rework TupleTreeGenerator tracking 2024-06-20 10:24:50 +02:00
Alessandro Di Federico d25d53e711 RootAnalyzer: use generic preserved registers
Before this commit, when outlining parts of `root` for analysis
purposes, we used to replace calls with a set of instructions clobbering
the set of register *not* preserved by such call, or, in case the
prototype was not available, by the default prototype.

This commit forces the usage of the default prototype.

This trades off precision with accuracy but we get the lift pipe not to
depend on any model::Function prototype.
2024-06-20 10:24:50 +02:00
Massimo Fioravanti 43349943a7 Stop serializing the model in the IR 2024-06-20 09:57:36 +02:00
Alessandro Di Federico 47c3dd8f0f Drop model::Segment::Sections 2024-05-22 10:25:25 +02:00
Alessandro Di Federico 3be8f4c3d3 Lift: require DefaultABI or DefaultPrototype 2024-05-22 10:25:25 +02:00
Alessandro Di Federico e64eee9402 CodeGenerator: handle partially valid instructions
Sometimes we have instructions that are, say, two bytes long but only
one of the two bytes are invalid (because they end up out of the
segment).
2024-05-15 13:19:42 +02:00
Alessandro Di Federico fe1dffcffd Add some missing includes
This is in preparation of reducing headers in Debug.h.
2024-05-03 21:52:40 +02:00
Pietro Fezzardi df3bd470a1 Enforce determinism on CSV handling
Various parts of revng replace `llvm::GlobalVariable`s representing CSVs
with Allocal/Load/Store. In particular, these are PromoteCSV,
RootAnalyzer and PromoteGlobalToLocalVars.

Before this commit, those places were sloppy when replacing CSVs with
Alloca/Load/Store, and did that iterating on a container sorted by
pointers. This caused Alloca/Load/Store to be emitted in different order
accross runs, which in turn caused more non-determinism down the
pipeline.

This commit fixes the non-deterministic behavior, sorting CSVs based on
their names, which should always be present and deterministic.
2024-03-19 09:43:59 +01:00
Ivan Krysak c9c4d5c8b6 Lift: stop using Layout 2024-03-18 19:32:34 +01:00
Alessandro Di Federico 250354bd27 ValueMaterializer: work around unreachable blocks 2024-03-15 19:05:10 +01:00
Alessandro Di Federico 83b94026e4 RootAnalyzer: handle missing prototype 2024-02-09 10:04:20 +01:00
Alessandro Di Federico a04ccb6883 CodeGenerator: relax check on entry point 2024-02-09 10:04:19 +01:00
Alessandro Di Federico f81851c36b CodeGenerator: do not tag LLVM intrinsics 2024-02-09 10:04:19 +01:00
Ivan Krysak 77b1acaf00 Prefer uint64_t to size_t wherever relevant 2024-01-29 11:57:54 +02:00