Commit Graph

93 Commits

Author SHA1 Message Date
Khaled Ismaeel 383af5b6b0 Add the version field to schemas YAML
Here we start restructuring the the schemas YAML such that it
contains a top-level `version` field. In this commit we only modify
the YAML, the build system changes will come later, to avoid
enormous commits.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 53a5ff07cf Remove embedded TUPLE-TREE-YAML 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
In this commit we instruct the build system to use the unified schema
files  instead of collecting the `TUPLE-TREE-YAML` comments.

The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel f384b10435 Check schemas into the codebase
These schema files are currently generated at build time by
collecting various TUPLE-TREE-YAML comments using the
`extract_yaml.py` script. In this commit we move them to the codebase
but we don't use them yet, this will be done at a later commit for
the sake of readability.
2025-04-30 15:08:40 +02: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
Ivan Krysak bf6aa40e05 buildControlFlowGraph: improve error messages
A concept is going to lead to clear feedback as opposed to typical
SFINAE-adjacent construction error message.
2025-02-13 13:10:51 +02:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 9e48994c97 EFA: pass the block to the new nodes
Before this commit, only its index was passed.
2025-02-13 13:09:50 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Alessandro Di Federico f9fad18cb4 EFA, Yield: handle blockless functions 2024-10-31 17:19:51 +01:00
Alessandro Di Federico a0c670652c Improve usages of Expected<T> 2024-10-10 14:50:26 +02:00
Alessandro Di Federico bc064244d6 s/deserialize/fromString/g 2024-09-27 12:07:17 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 7ddae47040 Minor changes 2024-07-10 15:34:19 +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 8ab27800a8 EFA: remove some dead code 2024-06-27 11:05:49 +02:00
Ivan Krysak 32fd1eed5b TTG: move classof boilerplate into the template 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 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 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
Alessandro Di Federico b350d12ad2 TTG: spread some optional: true around 2024-06-20 10:24:49 +02:00
Alessandro Di Federico b0d897b87d Minor changes 2024-06-20 10:24:49 +02:00
Lauri Vasama 8ec89c658c Template FunctionMetadataCache for use with MLIR 2024-05-29 15:42:15 +02:00
Alessandro Di Federico 8eca2e13fe Do not use SmallPtrSet with std::includes 2024-05-03 17:59:34 +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 0b4476d824 Introduce FunctionSummary::clone 2024-04-18 17:55:15 +02:00
Ivan Krysak 6b7650276e EFA: split importModel into multiple methods 2024-03-18 19:32:34 +01:00
Alessandro Di Federico e63feda848 Outliner::getCallSiteInfo: drop unused argument 2023-12-12 10:05:30 +01:00
Alessandro Di Federico 28a0fa5b7d DetectABI: run to fixed point and more
This commit switches the approach with which we run the ABI analyses: we
now run them until we reach a fixed point. This enables proper
interprocedural propagation of arguments and return values.

Basically, we now inject reads before call sites, so that, if a function
immediately calls another one, the arguments of the callee are
propagated to the caller.

This commit also updates the logic with which we propagate function
prototypes (and names) to callers. The main advantage of this, is that
function wrappers (in particular, PLT entries) now have the same name as
the function they wrap.
2023-12-12 10:05:22 +01:00
Alessandro Di Federico 02458724b0 Drop CallSummarizer::RegistersClobberedPool 2023-12-11 16:29:13 +01:00
Giacomo Vercesi 0cb3e497a4 Fix typos 2023-11-02 16:48:33 +01:00
Alessandro Di Federico bf66ecc389 {,Dynamic}Function::Prototype: support typedefs 2023-10-05 10:19:44 +02:00
Alessandro Di Federico f51af94e8f TupleTreeReference::isValid is for assertions only 2023-08-23 16:14:05 +02:00
Alessandro Di Federico 247879f7fc model::Type::ID: switch to progressive IDs
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.

On top of this, this commit introduces the following changes:

* TypeCopier: import all the necessary PrimitiveTypes and improve
  handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
  an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
  of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
  `Binary.recordNewType(makeType<model::*Type>())`.
2023-08-23 16:14:04 +02:00
Kacper Kołodziej 75ed8f7788 Add WrittenRegisters set to FunctionSummary
WrittenRegisters will be used in propagating prototypes to wrappers
functionality to check if function writes to arguments or stack pointer.
2023-07-20 18:09:48 +02:00
Ivan Krysak 9f1d9fd5d0 Use Container::contains() where appropriate 2023-07-02 15:06:11 +00:00
Ivan Krysak a123ec2c35 Remove clang-format off around concepts
Now that clang-format no longer breaks anything involving a concept or
a requires clause on sight, these are no longer necessary
2023-07-02 13:20:49 +02:00
Ivan Krysak bc98e0079f Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-02 13:20:49 +02:00
Ivan Krysak 7ed14ca65c Minor improvements 2023-07-02 11:06:55 +00:00
Ivan Krysak 641fb61f7b EFA: upgrade buildControlFlowGraph
It now assumes that the nodes of the graph it constructs also require
the function entry point on top of the basic block ID.
2023-05-17 14:08:05 +02:00
Ivan Krysak d99b0241e8 Minor improvements 2023-05-17 14:08:04 +02:00
Alessandro Di Federico 739bed3c1d DetectABI: serialize CFG in root
This is done mainly so that downstream passes do not need to run
`CollectCFG` to store information that has already been computed but not
serialized.

This come at the cost of computing the CFG also of functions we don't
want to analyze in `DetectABI`.
2023-05-17 11:17:44 +02:00