Commit Graph

212 Commits

Author SHA1 Message Date
Andrea Gussoni 71988af041 Fix MIT license 2025-04-30 16:10:54 +02:00
Ivan Krysak 5d0986c315 FunctionIsolation: 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 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03:00
Ivan Krysak dce5c1a02c NamingConfiguration: pull more prefixes inside
Unify additional values that used to be hardcoded in the old backend
under the same naming configuration root.
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
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 8841bc7144 Don't include model::NameBuilder from the binary 2025-02-13 13:09:50 +02:00
Ivan Krysak a67ba96644 Adopt name builder across the model users 2024-11-06 15:43:13 +02:00
Ivan Krysak 1eb80ecd2d Introduce an error creation helper 2024-11-06 15:20:37 +02:00
Ivan Krysak a12f5d9e97 Minor improvements 2024-11-04 18:51:12 +02:00
Alessandro Di Federico c97438c5e4 DynamicHierarchy: ensure we call init last 2024-10-31 17:19:51 +01:00
Alessandro Di Federico fbf79b5d1b Make Pipe::checkPrecondition optional 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 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
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 20b2f97484 EnforceABI: register all recreated functions
Before this change, we were remapping from old to new only functions
that have been requested. Now, we remap also those that are just called.
2024-09-27 12:07:16 +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 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 ae7e7a0bc7 IsolateFunctions: add tracing 2024-08-07 16:07:59 +02:00
Alessandro Di Federico ee2d2e25c6 InlineHelpers: add tracing 2024-08-07 16:07:59 +02:00
Alessandro Di Federico fa6249edc0 Isolate: add FunctionTag to declared functions 2024-08-05 17:42:04 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak f3c020ffb3 EnforceABI: ensure every function has a prototype 2024-06-27 11:05:51 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 927e8006b9 Model: rename TypePath to DefinitionReference 2024-06-27 11:05:49 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Ivan Krysak 84c8822c37 Model: drop TypedRegister 2024-06-27 11:05:48 +02:00
Alessandro Di Federico 3e8764093e RawFunctionType return type: adopt literal struct 2024-06-20 10:24:51 +02:00
Alessandro Di Federico b62bc8df91 s/FunctionMetadata/ControlFlowGraph/g 2024-06-20 10:24:51 +02:00
Alessandro Di Federico c3733f293a s/RevngPasses/FunctionPass/g 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 6cff5416d6 InvokeIsolatedFunctions should add IsolatedRoot
Before this commit, it was added by `IsolateFunctions` instead.
2024-06-20 10:24:50 +02:00
Alessandro Di Federico 7553e2acf8 Introduce UniquedBy{Prototype,Metadata}
This commit introduces new tags to specify how LLVMContainer should
deduplicate sets of equivalent functions, typically managed by an
`OpaqueFunctionPool`.
2024-06-20 10:24:50 +02:00
Alessandro Di Federico a6cf3fbb83 Centralize computation of llvm::Function names
This commit introduces a function to obtain the name assigned to a
`llvm::Function` associated to a `model::Function`. This simplifies the
codebase but also enables us to introduce an option to produce
human-friendly names for debugging/testing purposes.
2024-06-20 10:24:49 +02:00
Alessandro Di Federico 3097e94a0d Enable fetching call site prototype without CFG
Before this commit, we used to attach to call site a metadata to trace
back the call site to the CFG (i.e., `FunctionMetadata`).

This led several passes in revng-c to depend on `FunctionMetadata` just
for this.

This commit, attaches to call sites a reference to the prototype itself
(on the `revng.prototype` metadata), breaking many of such dependencies.
2024-06-20 10:24:49 +02:00
Massimo Fioravanti db15f7df9a Propagate info about inputs and outputs of pipes
This comit propagates the deduced info about inputs and outputs of pipes
all the way up to the runner, so that the requested output of a pipe can
be passed to its invocation.
2024-06-20 10:24:49 +02:00
Lauri Vasama 185afcf4c0 Fix spelling of FunctionEntryMDName 2024-05-29 15:42:15 +02:00
Alessandro Di Federico 38ea8f5237 Handle calls to non-functions 2024-05-15 13:19:40 +02:00
Alessandro Di Federico 0459b9d084 Introduce RegisterUsageAnalyses 2024-04-19 18:33:00 +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 6b7650276e EFA: split importModel into multiple methods 2024-03-18 19:32:34 +01:00
Ivan Krysak 9c9e642589 EnforceABI: stop using Layout 2024-03-18 19:32:34 +01:00
Alessandro Di Federico 4bca30df5d InlineHelpers: fix bug preventing inlining helpers 2024-02-09 10:04:18 +01:00
Alessandro Di Federico f997f85efd PromoteCSVs: always recreate allocas 2023-12-12 12:04:33 +01:00
Alessandro Di Federico 98f5304c54 InlineHelpers: do not inline recursive functions
Also, turn it into a ModulePass.
2023-12-12 12:04:33 +01:00
Alessandro Di Federico 0e7d3a9a71 Pass PlainMetaAddress by pointer 2023-12-12 10:20:51 +01:00