Commit Graph

987 Commits

Author SHA1 Message Date
Alessandro Di Federico 4b2e067574 rcc: ban functions we wrap 2023-04-28 14:34:52 +02:00
Alessandro Di Federico 4eeb942afb LLVMContainer: outline methods to .cpp 2023-04-28 14:34:49 +02:00
Alessandro Di Federico 8b3f641a29 Rename LLVMGlobalKindBase to LLVMKind 2023-04-28 14:34:49 +02:00
Massimo Fioravanti 4d4b587e1d Drop LLVMGlobalKindBase template argument 2023-04-28 14:34:47 +02:00
Alessandro Di Federico a0dcd176b2 Purge useless headers 2023-04-28 14:34:40 +02:00
Alessandro Di Federico 58b50e6b2a Dismiss LLVMContainerBase 2023-04-28 14:34:39 +02:00
Alessandro Di Federico f68185abc9 Push ParseCommandLineOptions into InitRevng 2023-04-28 14:34:35 +02:00
Alessandro Di Federico 50f396c43d Drop revng.csv in favor of a Tag 2023-04-28 14:04:32 +02:00
Alessandro Di Federico 8af3fd7fa3 LLVMContainer: do not duplicate appending globals
`llvm.global_ctors` and llvm.global_dtors were being cloned
exponentially many times. This was due to their `appending` linkage.
2023-04-28 14:04:32 +02:00
Alessandro Di Federico 2f917a2772 Introduce ModuleStatistics 2023-04-28 14:04:32 +02:00
Alessandro Di Federico 628aa42cc2 Introduce collectTypes 2023-04-28 14:04:31 +02:00
Alessandro Di Federico 170749b0aa Introduce revng::verify 2023-04-28 14:04:31 +02:00
Djordje Todorovic c9b2ffaf72 JumpTargetManager: improve data structures
This commit adopts `llvm::DenseSet`, `llvm::DenseMap` and
`std::unordered_set` where needed.
It also tweaks some `llvm::SmallVector` sizes.

It brings an additional ~3% improvement during lifting.
2023-04-27 19:22:03 +02:00
Ivan Krysak b2916e946f Yield: retire the old Graph 2023-04-27 18:12:52 +02:00
Ivan Krysak a532f738e2 Yield: switch to new layouter invocation style 2023-04-27 18:12:28 +02:00
Ivan Krysak 04cac0018d Yield: introduce new control flow graph type 2023-04-27 18:12:25 +02:00
Ivan Krysak 3774c9a3ab Yield: introduce new call graph type 2023-04-27 18:12:21 +02:00
Ivan Krysak c5805a754a Sugiyama: switch to the new internal graph 2023-04-27 18:10:06 +02:00
Ivan Krysak 52cfbe9523 Sugiyama: introduce new internal graph 2023-04-27 18:09:58 +02:00
Ivan Krysak 4cef969b96 Layout: introduce InputGraph and OutputGraph 2023-04-27 18:09:53 +02:00
Ivan Krysak 28574a87bc Yield: switch to layout's position and size 2023-04-27 18:09:38 +02:00
Ivan Krysak 1c2efd09db Layout: introduce LayoutableGraphTraits 2023-04-27 17:28:22 +02:00
Ivan Krysak 00b450a8c2 Sugiyama: move the namespace under layout
Also removed a few entities to avoid duplication in the full names:
- `yield::layout::sugiyama::LayoutOrientation`
  -> `yield::layout::sugiyama::Orientation`
- `yield::layout::sugiyama::layout(...)`
  -> `yield::layout::sugiyama::compute(...)`
2023-04-27 17:28:22 +02:00
Ivan Krysak 44b9bfd04c Yield: SugiyamaStyle as a part of GraphLayout 2023-04-27 17:28:22 +02:00
Ivan Krysak 268f53cdeb Sugiyama: move the "main" file inside the layouter 2023-04-27 17:28:22 +02:00
Ivan Krysak 6d43876e78 SVG: move one of the sugiyama::layout overloads
It isn't generic enough to be kept in the header, so it was moved
closer to its users.
2023-04-27 17:28:22 +02:00
Andrea Gussoni 7a92d70b8c Introduce llvm::dfs usage for graph algorithms
Implement a couple of restructure algorithms in a template manner, so
that they can be used with any data structure implementing
`GraphTraits`.

Test the algorithms using the `GenericGraph` data structure.
2023-04-27 17:28:22 +02:00
Ivan Krysak 5034488766 GenericGraph: hasSuccessor and hasPredecessor
Older node types didn't have these helpers, so they were added
for compatibility.
2023-04-27 17:28:22 +02:00
Ivan Krysak 49d3499b26 EFA: fix buildControlFlowGraph requirements 2023-04-27 17:28:22 +02:00
Ivan Krysak 7ca012dbc3 Minor improvements 2023-04-27 17:28:22 +02:00
Massimo Fioravanti 69aafd4181 TupleTree: implement tracking data manipulation
Implement the core visits that are able to inspect the model bypassing
the instrumentation.
2023-04-21 17:51:05 +02:00
Massimo Fioravanti 254dc99fcb TupleTreeGenerator: emit tracking machinery 2023-04-21 17:50:16 +02:00
Massimo Fioravanti d65d73359d TrackingContainer: review API 2023-04-21 17:49:26 +02:00
Giacomo Vercesi a2b7d0e0bf PipelineC: add tracing
Add support for tracing onto the PipelineC. This is done by:
1. Creating wrapper functions for each PipelineC function with the
   script in `scripts/PipelineC_add_tracing.py`. These will call a
   special function called `wrap` which will ultimately call a method
   with a `_` prepended to the name
2. Conversion of all PipelineC methods in `PipelineC.cpp` to `static`
   and their rename with a `_` in front, in order for them to work with
   the wrapper function in (1)
3. Generation of 2 additional include files, one for types and one for
   functions, to be used by users of tracing files in order to have
   introspection.

These steps allow the creation of a trace file with the use of the
`REVNG_C_API_TRACE_PATH` environment variable. The traces can then be
used in conjunction with the `revng trace run` and `revng trace
inspect` commands.
2023-04-20 14:43:13 +02:00
Giacomo Vercesi 19bb38d32b PipelineC: fix UAF on rp_targets_list
The underlying rp_target pointer was not stable, switch to returning a
copy of the target instead.
2023-04-20 14:43:13 +02:00
Giacomo Vercesi 566cb6310b PipelineC: make indexed object stably sorted
Many Pipeline objects (Globals, Ranks, Kinds, Targets in a TargetList)
were ordered by load order, this makes the playback of traces difficult.
Moreover the order of loading of pipeline files also influences the
ordering of other elements (Step, Analys{is,esLists}). These are also
ordered to prevent incosistent ordering.
2023-04-20 14:43:13 +02:00
Giacomo Vercesi 8d89c6a318 PipelineC: rp_initialize: only use argc and argv
Switch from specifying `libraries` and `pipelines` in `rp_initialize`
and `rp_manager_create` to the use of command-line options that are to
be passed via `argc` and `argv` in `rp_initialize`.
2023-04-20 14:43:12 +02:00
Giacomo Vercesi 9a972009d1 PipelineC: size and const-correctness
Fix the return type (often mismatched from uint64_t to int) and the
const-correctness of many functions in PipelineC
2023-04-20 14:43:12 +02:00
Alessandro Di Federico 5b8d5a8a41 Introduce OpaqueFunctionsPool::initializeFromName 2023-04-14 08:36:05 +02:00
Alessandro Di Federico 40135aad97 Drop CSVAliasAnalysisPass 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 8ef567471b LLVMContainer::mergeBackImpl: postpone verify
This commit moves module verification after cleanup.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico 060d26f212 Introduce getLocation(Instruction *) 2023-04-13 18:11:48 +02:00
Alessandro Di Federico 8c5f6628d1 Stop considering Instructions Taggable
Adding custom (i.e., non-dbg) metadata to Instructions has proven to be
too brittle.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico bce3555285 Drop CallToLifted tag
This commit drops the `CallToLifted` tag in favor of a
`getCallToIsolatedFunction` function which checks if the call has the
`IsolatedFunction` tag. The function also assumes that indirect calls
are calls to lifted functions.
2023-04-13 18:11:48 +02:00
Alessandro Di Federico 92b9ba5571 Import findPhiTreeLeaves 2023-04-08 08:42:24 +02:00
Alessandro Di Federico dc7f731bef Mark build_PlainMetaAddress as const 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 995d44cf73 Implement Location::{parent,back} 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 52ee85f55f Implement efa::BasicBlock::contains 2023-04-08 08:42:24 +02:00
Alessandro Di Federico 6564fc0568 Minor changes 2023-04-08 08:42:24 +02:00
Alessandro Di Federico daafc6a1e7 AVI: handle SCEV's scSequentialUMinExpr 2023-04-08 08:42:24 +02:00