Commit Graph

2244 Commits

Author SHA1 Message Date
Antonio Frighetto 69e8615c9f Introduce test for Segment.Type importing 2023-02-06 12:08:18 +01:00
Antonio Frighetto ab36efca8d Model: import data objects in Segment.Type 2023-02-06 12:08:18 +01:00
Alessandro Di Federico b89c3e9332 Merge branch 'feature/no-error-list-preliminaries' 2023-02-06 09:37:52 +01:00
Antonio Frighetto 87dec68f24 Pipeline: refine overestimated targets
A logic issue was addressed in `Runner::getDiffInvalidations`.
Premature invalidation of all targets (overestimated targets
found by `getInvalidations`) could lead to an error due to
lack of those targets (do not exist yet). We make sure that
such targets exist before providing them to the pipeline.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 7c671ed6de TupleTreeDiff: evict cached references in apply
As the input model requires to be mutable, `evictCachedReferences`
is needed in order to invalidate cached references.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 15fcf98446 ProcessCallGraph: fix access to Metadata
A logic issue existed in the Pipe, as it was mistakenly relying on
`IsolatedRoot` instead of the isolated function. That was breaking
things if those functions were to be removed. This issue has been
addressed by correcting the behaviour of the Pipe.
2023-02-06 09:37:23 +01:00
Antonio Frighetto f73b9876fa FunctionIsolation: execute CollectCFG earlier
This change makes sure that CollectCFG is always intertwined
with FunctionIsolation, as it needs to run before the latter
executed. To avoid possible rearrangements on the pipeline
in the future, CollectCFG pass is now registered within FI.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 17f799e3c2 Move ProcessCallGraph pipe within Isolate
`CrossRelations` container needs to be available
just as `FunctionIsolation` has executed.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 2d086e04a1 Context: fix entry in containsReadOnlyContainer
`ReadOnlyContainers` is defined to be a `llvm::StringMap`
of a further `llvm::StringMap` of `std::unique_ptr`s of
`ContainerBase`. A logic issue has been addressed by
properly dereferincing the inner map.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 8ca4c4c6ea Runner: bail out with no requests target 2023-02-06 09:37:23 +01:00
Antonio Frighetto 308d8ee8a3 Loader: associate container name to its role
`Container` names were mistakenly associated to the name
of their declaration. This has been fixed by associating
them to their `Role`.
2023-02-06 09:37:23 +01:00
Antonio Frighetto c91a44363a Yield: split internal pipes off
A cyclic dependency between shared objects `revngYield` and
`revngFunctionIsolation` could exist if `FunctionIsolation`
were to use `yield`-defined methods. This has been prevented
by splitting pipes off within `Yield`.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti 9432399254 Introduce ApplyDiffAnalysis 2023-02-06 09:37:23 +01:00
Antonio Frighetto ea0a06a876 revng.daemon: accept no arguments for analysis
Let GraphQL accept zero or more parameters for analyses.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti dad043027d Rework and EFA yield cross relations
Yield and EFA shared the same namespace, this commits splits them and
introduces tuple tree containers as well.
2023-02-06 09:37:23 +01:00
Antonio Frighetto c5d9a4d787 Introduce helper for location conversion 2023-02-06 09:37:23 +01:00
Antonio Frighetto c3480b6f9b CLOption: improve isSet for a cl::opt<T>
A logic issue existed when validating whether a `cl::opt<T>`
was set. This has been addressed by replacing `isDefaultOption`
method with `getNumOccurrences`, as the former one was not
meant to be used for checking if the option was set or not.
Likewise, the default Option itself is written to a `std::string`,
in method `get`; the latter is leveraged by `Invokable`.
2023-02-06 09:37:23 +01:00
Alessandro Di Federico c7ade9595c Merge branch 'feature/debug-info' 2023-02-02 15:27:01 +01:00
Djordje Todorovic a48e518467 Introduce AttachDebugInfo pass 2023-02-02 15:26:44 +01:00
Djordje Todorovic eb6849045d FunctionMetadataCache: split an assert 2023-02-02 15:26:26 +01:00
Djordje Todorovic 3365a626df LLVMContainer: avoid copying !dbg to declarations 2023-02-02 15:26:18 +01:00
Pietro Fezzardi 04d877a992 TypeSystemPrint: fix print without stack type 2023-02-02 14:49:46 +01:00
Giacomo Vercesi f3f04ef891 daemon/test.py: improve daemon log handling
Improve the handling of the daemon process when running tests.
print.
2023-02-01 17:46:21 +01:00
Giacomo Vercesi b4c1cd94e1 revng-daemon: preserve more signals
Add more signals to be handled from python rather than LLVM.
2023-02-01 17:46:19 +01:00
Alessandro Di Federico 4a7ccfd68e Merge branch 'feature/fix-fetch-debuginfo' 2023-01-27 21:52:42 +01:00
Djordje Todorovic 8f95f14f12 CrossModelFindType: consider ExportedNames 2023-01-27 17:54:08 +01:00
Djordje Todorovic fec0ec7034 Model: add ExportedNames for local Functions 2023-01-27 17:54:06 +01:00
Djordje Todorovic 55d098b994 DwarfImporter: parse DW_AT_ranges 2023-01-27 17:54:03 +01:00
Djordje Todorovic 83905cf5ed Fix the level for FetchDebugInfo 2023-01-27 17:53:47 +01:00
Alessandro Di Federico 925fae4c4f Merge branch 'feature/fix-idb-importer' 2023-01-27 17:51:46 +01:00
Djordje Todorovic 22ba1800c5 idb: fix generation of empty structs and unions
There was a log message that we are creating typedef void* for empty
structs, but we have missed that piece of code. This patch adds that
logic.

In the case of unions, we completely ignored empty ones, and also
there was not handling if the type was generated by ordinal (as
in the case of structs). This patch also fixes it.
2023-01-27 17:49:11 +01:00
Djordje Todorovic 3e75c09da0 dropTypesDependingOnTypes: purge from Function too
This commit ensure that, not only we drop `model::DynamicFunction`s
depending on an invalid type, but `model::Function`s are dropped too.
2023-01-27 17:48:19 +01:00
Djordje Todorovic 0f7c473cf3 FixModel: factor out logic of type deletion 2023-01-27 17:46:23 +01:00
Djordje Todorovic 5be245c971 FixModel: filter zero-sized fields 2023-01-27 17:46:21 +01:00
Djordje Todorovic e1b070f2da FixModel: filter out empty arrays 2023-01-27 17:46:18 +01:00
Alessandro Di Federico e590afb38e CMake: use LIBRARY_OUTPUT_DIRECTORY for libaries
This ensure we don't have to `cmake -E copy`.
2023-01-21 18:56:43 +01:00
Alessandro Di Federico bf20a83268 revng-pipeline: reduce dependencies 2023-01-21 18:56:22 +01:00
Alessandro Di Federico 4929f201d1 script/revng: fix detection of packages directory 2023-01-21 16:46:35 +01:00
Alessandro Di Federico 7913bf9e58 Disable LeakSanitizer 2023-01-21 16:46:35 +01:00
Alessandro Di Federico 47fd084c88 revng --verbose: shorten paths only if beneficial 2023-01-21 16:46:35 +01:00
Alessandro Di Federico 70e4f24d9f revng-check-conventions: fix mypy if no normal_files 2023-01-21 16:46:35 +01:00
Alessandro Di Federico c6630a2414 eraseIfNoUse: check if WeakVH is dead 2023-01-03 20:51:45 +01:00
Alessandro Di Federico a4f4906ba7 Lift: re-enable InstCombine upon harvesting
InstCombine was disabled in favor of some more basic constant
propagation, but it turns that under certain circumstances this leads to
direct branches appearing as indirect branches until we run InstCombine
during finalization, which triggers an assertion, since we do not expect
any direct jump there.

If this, affects translation performance, we can think to run it less
often.
2023-01-03 13:41:40 +01:00
Alessandro Di Federico 8030f1c909 finalizeNewPCMarkers: do not copy attributes 2023-01-03 13:41:40 +01:00
Alessandro Di Federico dd5914ce61 ProgramCounterHandler: initialize field
The uninitialized field led to SIGSEGVs.
2023-01-02 14:22:56 +01:00
Alessandro Di Federico 991980806e LinkForTranslation: use -l:ld-linux-x86-64.so.2 2023-01-02 10:46:13 +01:00
Alessandro Di Federico 329f610a42 Merge branch 'feature/import-debug-info' 2022-12-13 11:28:16 +01:00
Djordje Todorovic 74c840a9f5 DwarfImporter: set prototype only if available 2022-12-13 11:27:23 +01:00
Djordje Todorovic 8976ab4126 DwarfImporter: handle DW_AT_noreturn 2022-12-13 11:27:16 +01:00
Djordje Todorovic 961f9e5461 Model: search debug info locally upon import
Also find prototypes in Models of dynamic libs for both PE and ELF.
2022-12-13 11:26:54 +01:00