Commit Graph

152 Commits

Author SHA1 Message Date
Ivan Krysak a67ba96644 Adopt name builder across the model users 2024-11-06 15:43:13 +02:00
Alessandro Di Federico f9fad18cb4 EFA, Yield: handle blockless functions 2024-10-31 17:19:51 +01:00
Alessandro Di Federico 16e01f43d6 Import revng-c's FunctionTags.h 2024-10-31 17:19:51 +01:00
Ivan Krysak 43f0304cb2 Pipeline: toString -> locationString 2024-10-15 09:12:55 +02: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 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 850276f5c8 Minor changes 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 06023b4555 BitLivenessWrapperPass::dump 2024-07-10 16:19:26 +02:00
Alessandro Di Federico 7ddae47040 Minor changes 2024-07-10 15:34:19 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak 823e561806 TTG: rework polymorphic serialization
For now, the only serialization trait we were verifying
a polymorphic TTG type to have was the wrong (the one
that only printed base class's fields).

This commit explicitly disables said serializer and
ensures it's never used.

Here's an illustration of the impact of the changes:
```
model::UpcastableType MyType = getTypeFromSomewhere();
model::Type &View = *MyType;
model::PointerType &Pointer = MyType->asPointer();

serialize(MyType); // Good
serialize(Pointer); // Good
serialize(View); // new: explicit error
                 // old: only print base type's fields
```
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 9e6bf29f74 TTG: pull dump helper into the template 2024-06-27 11:05:49 +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
Alessandro Di Federico 398681c5ce Introduce tests for invalidation 2024-06-25 09:50:38 +02:00
Alessandro Di Federico b62bc8df91 s/FunctionMetadata/ControlFlowGraph/g 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 276a6e0efb s|ControlFlowGraph.h|CFGHelpers.h|g 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 6e49fed965 FunctionMetadata::{ControlFlowGraph,Blocks} 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 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
Massimo Fioravanti f783868dde Model: adopt tryGet instead of find() != end() 2024-06-20 09:57:36 +02:00
Lauri Vasama 3e33a300d5 Introduce RawFunctionType::Architecture 2024-05-29 15:42:15 +02:00
Alessandro Di Federico b273caa8dc FunctionMetadata::findBlock: do not ignore IBDHB 2024-05-15 13:19:42 +02:00
Alessandro Di Federico 452036edf1 Purge instructions to save return address 2024-04-30 15:25:53 +02:00
Alessandro Di Federico 0459b9d084 Introduce RegisterUsageAnalyses 2024-04-19 18:33:00 +02:00
Alessandro Di Federico ba65443293 DetectABI call graph: no multiple identical edges 2024-04-18 17:55:22 +02:00
Alessandro Di Federico 53f0c71d3b FunctionMetadata::dumpCFG: dump to file 2024-04-05 13:29:15 +02:00
Alessandro Di Federico dda484d642 FunctionMetadata::simplify: use .nextBlock()
Before we were using `.End()` which lead to lose the inlining index.
2024-04-05 13:28:31 +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 89b454a224 EFA: improve robustness against non-existent FSO 2024-03-18 19:32:35 +01:00
Ivan Krysak 6b7650276e EFA: split importModel into multiple methods 2024-03-18 19:32:34 +01:00
Ivan Krysak 5afba1382c EFA: update clobbered register list computation 2024-03-18 19:32:34 +01:00
Ivan Krysak 7e08c341e9 EFA: update preserved register diffing 2024-03-18 19:32:34 +01:00
Ivan Krysak 2aad45f452 EFA: reorder prototype-based summary importer
This lets up cleanly "bail out" after only some of the computation
is done. This way we avoid reading information we don't really use
from the model based on who is the specific user of the oracle.
2024-03-18 19:32:34 +01:00
Ivan Krysak 78d0802f74 EFA: turn importPrototype into a helper struct 2024-03-18 19:32:34 +01:00
Ivan Krysak b1c2683b87 EFA: stop using Layout 2024-03-18 19:32:34 +01:00
Alessandro Di Federico aec4be9b07 AttachDebugInfo: improve docs 2024-03-01 14:53:07 +01:00
Alessandro Di Federico 346b367c19 Drop revng efa-extractcfg 2024-02-09 10:04:25 +01:00
Alessandro Di Federico d9367954a4 Convert all public strings to kebab-case 2024-02-09 10:04:24 +01:00
Alessandro Di Federico bef9efc599 EFA, importModel: handle missing prototype 2024-02-09 10:04:18 +01:00
Massimo Fioravanti c276a439b5 Add pipeline invalidation
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
2024-01-02 11:14:56 +01:00
Alessandro Di Federico ef3ec71cf1 DetectABI: reorder functions 2023-12-12 10:20:32 +01:00