Commit Graph

6113 Commits

Author SHA1 Message Date
Pietro Fezzardi 142428c9a1 TypeNames: assert no CABIFT returns a RegisterSet
This assertion mirrors the equivalent set of assertions on RFT, that
never return ModelAggregate.
2025-01-29 15:17:15 +01:00
Pietro Fezzardi 8114c19164 Replace WIP comment with TODO 2025-01-29 15:17:15 +01:00
Pietro Fezzardi f4c79e0579 Pipeline: fix typo 2025-01-29 15:17:15 +01:00
Pietro Fezzardi 30558bcc29 Add -fno-strict-overflow to compile-flags.cfg
This prevents recompilation of decompiled C code to cause UB on
overflows, because all integer and pointer overflows now wrap.
2025-01-29 15:17:15 +01:00
Pietro Fezzardi 1fb613579f Drop leftover useless files 2025-01-29 15:17:15 +01:00
Alessandro Di Federico 7045be5c0d Merge branch 'feature/ui-qa-2025-01-16' 2025-01-28 15:36:59 +01:00
Alessandro Di Federico 36edf810ef Introduce support for function pointers 2025-01-28 15:20:45 +01:00
Alessandro Di Federico b523889742 DwarfImporter: try .debug before giving up
Also, improve logging.
2025-01-28 15:20:45 +01:00
Alessandro Di Federico dfe0970715 FromUnusedAddressesPass: use simple literals
Consider simple literals as candidates for the second run of function
collection.
2025-01-28 15:20:45 +01:00
Alessandro Di Federico 2128a80cc8 Preserve metadata after Function::deleteBody
Also, introduce and adopt a simple helper class to get this right.
2025-01-28 12:19:16 +01:00
Alessandro Di Federico b576fd1988 CollectFunctions tests: ignore loaded addresses
The tests was testing if a function whose entry address is the target of
load was identified as a function or not (it shouldn't).

This test was passing accidentally. This has not been supported since
the introduction of `RootAnalyzer`.  In order to support this again, we
need to resurrect `processLoadsAndStores`.
2025-01-28 12:19:16 +01:00
Alessandro Di Federico b70b3cbe55 RootAnalyzer: improve logging 2025-01-28 12:19:16 +01:00
Alessandro Di Federico 2879cbfdd3 PTMLCTypeBuilder: add missing const &
This lead to copy a model data structure instead of using the original
one, which, in turn, led to missed invalidation tracking.
2025-01-28 12:19:15 +01:00
Andrea Gussoni 1855bb9e87 ScopeGraph: fix marker call prototypes 2025-01-27 23:27:59 +01:00
Pietro Fezzardi 255e7ac30b Merge branch 'feature/scopegraph-dotgraphtraits' 2025-01-15 11:54:46 +01:00
Andrea Gussoni 9af0c2962c ScopeGraph: dump .dot of the ScopeGraph
Dump the `.dot` file representing the `ScopeGraph` in the
`dumpScopeGraph` debug function.
2025-01-15 11:54:28 +01:00
Andrea Gussoni d2fa797d5e ScopeGraph: implement DOTGraphTraits
Provide the `Scope<llvm::Function *>` specialization implementation for
the `DOTGraphTraits`.
2025-01-15 11:54:28 +01:00
Andrea Gussoni db719a23be ScopeGraph: delete Scope(&&) constructor
Delete the `Scope(const GraphType &&)` constructor, in order to avoid
potential bugs due to the storage of a temporary reference in the `const
GraphType &Graph` member.
2025-01-15 11:54:28 +01:00
Pietro Fezzardi 4520442f22 Merge branch 'feature/scopegraph-inverse' 2025-01-15 11:53:45 +01:00
Andrea Gussoni 684cbf649a ScopeGraph: implement Inverse<Scope<>>
Implement the `Inverse<Scope<...>>` `GraphTraits`. This are needed in
order to support the computation of the `PostDominatorTree` on a
`ScopeGraph`.

Add some `FileCheck` tests to test the dominator and postdominator trees
on the `ScopeGraph`.
2025-01-15 11:48:28 +01:00
Pietro Fezzardi f81bbcc754 Add new EagerMaterializationRangeIterator
Introduce the `EagerMaterializationRangeIterator`, which substitutes the
`GeneratorIterator`, and is used to materialize the successors of a
node in the `ScopeGraph`.

In addition, remove the `GeneratorIterator`.
2025-01-15 11:48:28 +01:00
Pietro Fezzardi 3137de6146 DLA: fix stack type size initialization
Before this commit, the DLA frontend wasn't initializing the size of
stack types properly, nor tracking the fact that they are not scalar.

These 2 problems were causing stack types to be merged with other types
in the DLA pipeline, possibly even scalar types and in some situations
changing the size of the stack type.
All these consequences were just wrong and need to be avoided because
they break assumptions of the DLA pipeline, leading to crashes in the
DLA backend, when trying update the model to integrate DLA's results.

This commit prevents all the mentioned wrong manipulation of stack
types, simply by correctly assigning an the size of the stack type from
the beginning, and marking it as non scalar.
2025-01-15 11:48:21 +01:00
Pietro Fezzardi 6ceca5891b MakeSegmentRef: ignore args of OpaqueExtractValue 2025-01-10 16:47:05 +01:00
Pietro Fezzardi 1a7632bd05 Merge branch 'feature/clift-backend' 2025-01-10 09:33:58 +01:00
Lauri Vasama 96312ce164 Add Clift C Backend LIT tests 2025-01-10 08:04:20 +02:00
Lauri Vasama 4a0867e394 Add emit-c MLIR pass 2025-01-10 08:04:20 +02:00
Lauri Vasama bda55aac19 Add Clift C Backend 2025-01-10 08:04:20 +02:00
Lauri Vasama db6b757c42 Remove duplicate C++ unit test 2025-01-10 08:03:20 +02:00
Lauri Vasama 8515ffffce Move Clift label C++ unit test to LIT 2025-01-10 08:03:20 +02:00
Lauri Vasama ab9da50e68 Remove unreachable return in clift-opt 2025-01-10 08:03:20 +02:00
Lauri Vasama 216489b06d Fix ModelOption value name 2025-01-10 08:03:20 +02:00
Lauri Vasama aaddafa15b Add check for conflicting local names in Clift 2025-01-10 08:03:20 +02:00
Lauri Vasama 4cedc22efb Merge access ops into AccessOp with indirect flag 2025-01-02 11:25:32 +02:00
Lauri Vasama fd4033ce7e Add ClassTypeAttr for structs and unions 2025-01-02 11:25:32 +02:00
Lauri Vasama 769c357648 Merge SizedType into TypeDefinitionAttr 2025-01-02 11:25:32 +02:00
Lauri Vasama 9f6003f1f4 Add SwitchOp::getConditionType 2025-01-02 11:25:32 +02:00
Lauri Vasama 11ff4d7abd Fix relational op tablegen naming 2025-01-02 11:25:32 +02:00
Lauri Vasama fe2e70e885 Improve label and goto ops 2025-01-02 11:25:32 +02:00
Lauri Vasama da8e581861 Loosen LocalVariableOp verification 2025-01-02 11:25:32 +02:00
Lauri Vasama 3b8e9dc3bb Loosen YieldOp verification
Yield is not return. There is no need to verify the types being yielded.
f; is a valid expression statement, even when f is a function. In this
case a function is yielded, but that is fine.
2025-01-02 11:25:32 +02:00
Lauri Vasama 4052863dcf Fix CliftAttributes.td formatting 2025-01-02 11:25:32 +02:00
Lauri Vasama e0c3f352d8 Fix CliftInterfaces.td formatting 2025-01-02 11:25:32 +02:00
Lauri Vasama 03ef33f65c Add function location reference functions 2025-01-02 11:25:32 +02:00
Lauri Vasama 9d9de10660 Refactor primitive type location references 2025-01-02 11:25:32 +02:00
Lauri Vasama 7dd3743f89 Add missing keywords and operators in CBuilder 2025-01-02 11:25:32 +02:00
Lauri Vasama 814e025ee2 Remove moves before return in NameBuilder.cpp 2025-01-02 11:25:32 +02:00
Lauri Vasama 1195617e5b Add revng_register_library, use for MLIR libs 2025-01-02 11:25:32 +02:00
Lauri Vasama 8be366b168 Move MLIR includes to mlir/CMakeLists.txt 2025-01-02 11:25:32 +02:00
Lauri Vasama 3232105320 Make clift::ModuleOp IsolatedFromAbove 2025-01-02 11:25:32 +02:00
Alessandro Di Federico f616f30d21 Merge branch 'feature/ui-qa-2024-11-26' 2024-12-20 21:53:16 +01:00