Commit Graph

860 Commits

Author SHA1 Message Date
Giacomo Vercesi 37caa91e6d Ranks: fix Rank keys
Use model::Function::Key for the Function rank instead of the naked
MetaAddress as it allows forward-compatibility if the model::Function
key is ever changed.

Use a std::tuple<uint64_t> for TypeField as it's the current type for
{Struct,Enum,Union}Field.key()
2022-09-01 17:46:57 +02:00
Giacomo Vercesi e1adce0f69 PTMLIndentedOstream: rework write_impl
Previous implementation would write '\n' if the buffer ended with
'\n\n'.
2022-09-01 17:46:04 +02:00
Alessandro Di Federico b0bfa5db4a CollectCFG: nop if root is absent 2022-09-01 14:58:50 +02:00
Alessandro Di Federico 40f1e06135 CFGAnalyzer, opaque_true: use inaccessiblememonly
This prevents EarlyCSE from deduplicating calls to this functions with
the same arguments, which has unintend effects and leads to loss of
code.
2022-09-01 11:32:42 +02:00
Alessandro Di Federico df34095721 Minor changes 2022-09-01 11:32:12 +02:00
Massimo Fioravanti 9a4e97d8ea Pipeline: handle having 0 functions 2022-08-31 18:07:47 +02:00
Alessandro Di Federico 712585be48 CodeGenerator: handle PTC translation failure 2022-08-31 18:07:47 +02:00
Alessandro Di Federico d8230c3e9a revng-pipeline: improve error reporting 2022-08-31 18:07:47 +02:00
Alessandro Di Federico f93eefda66 replaceAll: move to STLExtras.h 2022-08-31 18:07:47 +02:00
Djordje Todorovic 2abd250ae0 model: Skip nameless dyn functions in PE 2022-08-31 18:07:47 +02:00
Alessandro Di Federico cd7429d100 pipes::Lift: fail if Architecture is Invalid 2022-08-29 15:13:25 +02:00
Massimo Fioravanti 9ce7b1e527 Drop Pipe suffix from pipe names 2022-08-29 14:45:45 +02:00
Massimo Fioravanti 633f49c1ef Introduce dedicated namespace for kinds and ranks 2022-08-29 14:44:53 +02:00
Massimo Fioravanti 915c083661 Pipes: reorganize who defines pipes 2022-08-29 14:44:35 +02:00
Massimo Fioravanti 2a996ef666 Pipeline: allow analyses to fail 2022-08-29 14:44:10 +02:00
Massimo Fioravanti 7e75a1a4b8 Pipeline: introduce preconditions for pipes 2022-08-29 14:44:02 +02:00
Massimo Fioravanti 6b099c57e8 Pipeline: introduce options for analyses 2022-08-29 14:43:25 +02:00
Alessandro Di Federico 178b58b9d5 ImportBinary: turn into an analysis 2022-08-26 09:50:42 +02:00
Alessandro Di Federico 38d91a793b AddPrimitiveTypes: turn into an analysis 2022-08-26 09:50:42 +02:00
Alessandro Di Federico 1d91ed9beb tuple_tree_generator: make C++ just a regular backend
The `tuple_tree_generator` component was still heavily treating C++ as a
special citizen.
This commit normalizes the situation.
2022-08-11 16:20:42 +02:00
Massimo Fioravanti d250d43ee4 revng-pipeline: factor out common CLI options
Common CLI options that were used by multiple tools and have now been
isolated into a single include file to be used before declaring main.
2022-08-10 09:49:24 +02:00
Massimo Fioravanti 261a114d6d Pipeline: corner-case fix in backward deduction 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 0bb115a4f3 revng-pipeline: rework syntax for targets
Was: step:container:p/a/t/h:kind
Now: step/container/p/a/t/h:kind
2022-08-10 09:49:24 +02:00
Massimo Fioravanti 4cd5abe2b0 revng-pipeline: introduce --produce and --analyze 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 96bd5835d8 revng-pipeline: rework file-to-container syntax 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 85a9c9637f revng-pipeline: rework logging 2022-08-10 09:49:24 +02:00
Alessandro Di Federico 1cf9a06009 EnforceABI: use read-only model 2022-08-08 13:55:36 +02:00
Alessandro Di Federico 6a6cd939db Rework EarlyFunctionAnalysis 2022-08-08 13:55:34 +02:00
Alessandro Di Federico a844589739 ProgramCounterHandler: align PC address
ProgramCounterHandler now emits code masked with an alignment mask to
ease the job of various analyses.
2022-08-08 13:55:26 +02:00
Alessandro Di Federico 562bb9959d Reimplement GCBI::getBlocksGeneratedByPC
GCBI::getBlocksGeneratedByPC has been reimplemented using recursive
coroutines.  Caching dominator trees was very error-prone.
2022-08-08 13:55:26 +02:00
Alessandro Di Federico f2bd49d562 defaultPrototype: set FinalStackOffset 2022-08-08 13:55:26 +02:00
Alessandro Di Federico f236a490c3 GCBI::getSuccessors: make .Other additive
Previously, if `.Other` was set, all the other fields where unset.
2022-08-08 13:55:25 +02:00
Alessandro Di Federico 4eb70b0e35 Reimplement exitTBCleanup 2022-08-08 13:55:25 +02:00
Alessandro Di Federico 4d69437548 Split moveBlocksInto off moveToNewFunctionType 2022-08-08 13:55:25 +02:00
Alessandro Di Federico b07d134b73 Introduce CanonicalRegisterValues in the model
These canonical values ease certain analysis that can assume their value
at function entry.
2022-08-08 13:55:25 +02:00
Alessandro Di Federico 0566381ecf ELFImporter: make importing more robust 2022-08-08 13:55:25 +02:00
Alessandro Di Federico e0e8b4e5b6 ELFImporter.cpp: s/Log/ELFImporterLog/ 2022-08-08 13:55:25 +02:00
Alessandro Di Federico 8e358d6609 Introduce additional assertions 2022-08-08 13:54:41 +02:00
Alessandro Di Federico 81c2a93add Normalize FilePortion 2022-08-08 13:54:41 +02:00
Ivan Krysak b3f9ce7cc2 Use locations in PTML exporter 2022-08-05 21:47:05 +03:00
Ivan Krysak dff7c5f37d Move yield pipes into revngYield 2022-08-05 21:46:28 +03:00
Massimo Fioravanti c97187fd0e Add cross relations role 2022-08-05 21:45:19 +03:00
Ivan Krysak 191fc99c1c Add a pipe for call-graph processing 2022-08-05 20:45:16 +02:00
Ivan Krysak 8f4590bf00 Outline the cross-relation interface 2022-08-05 21:42:58 +03:00
Ivan Krysak 792da8151e Redesign the rank definition process 2022-08-05 19:58:57 +02:00
Ivan Krysak 65d1a016d4 Standardize concept naming across the codebase 2022-08-05 17:27:56 +03:00
Ivan Krysak 8dce9ef724 Fix the problem with negative node ranks
Having the initial rank threshhold too low caused them to sometimes
loop around and become negative, causing problems later down the line.

This sets the rank of the "entry" node to 4 offsetting the possible
causes of this issue quite a bit.
2022-08-05 17:27:56 +03:00
Ivan Krysak 240f334d78 Fix minor wording issues 2022-08-05 17:27:56 +03:00
Ivan Krysak 4ffadb2144 Fix an iteration invalidation caused issue 2022-08-05 17:27:56 +03:00
Ivan Krysak 8305e020b0 Move ranks into their own namespace 2022-08-05 17:27:56 +03:00