Commit Graph

6113 Commits

Author SHA1 Message Date
Alessandro Di Federico 6f4923265e Type verify: improve error reporting 2024-03-01 14:53:06 +01:00
Alessandro Di Federico 3cfd01e617 DwarfImporter: correctly handle Expected 2024-03-01 14:53:06 +01:00
Alessandro Di Federico c7868b4e7d Runner: improve logging 2024-03-01 14:53:06 +01:00
Alessandro Di Federico 0da9d1e1a4 Model: fix handling of 0-sized arguments
We used to support having a single `void` argument. It was for some
C-compatibility ambitions, but just omitting the argument is perfectly
fine.

Also, the DWARF importer has been fixed to handle typedef'd void as
arguments.

More in general, arguments are now required to always have a size.
2024-03-01 14:53:06 +01:00
Alessandro Di Federico d9e649d272 Importer/Binary: improve logging 2024-03-01 14:53:06 +01:00
Alessandro Di Federico aa882f1bef Importer/Binary: fix default XDG cache path 2024-03-01 14:53:06 +01:00
Alessandro Di Federico dd16a320a2 CMake: fix well-known-models install path 2024-03-01 14:53:06 +01:00
Alessandro Di Federico 6b4f44af2d Minor changes 2024-03-01 14:53:06 +01:00
Alessandro Di Federico 8479f3d8b8 artifact: reorganize how we run analysis lists 2024-03-01 14:28:12 +01:00
Alessandro Di Federico 2347304b70 Progress.cpp: handle StepsCount == 0 2024-03-01 14:23:30 +01:00
Alessandro Di Federico 340b02c71e DwarfImporter: improve progress reporting 2024-03-01 14:23:08 +01:00
Alessandro Di Federico db4ec438f4 Merge branch 'feature/open-revngc' 2024-03-01 10:23:47 +01:00
Alessandro Di Federico 09c0633391 Merge branch 'feature/open-revngc' 2024-03-01 10:23:18 +01:00
Alessandro Di Federico 85abd9b6fc revng artifact: introduce --analyze 2024-02-29 18:04:35 +01:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Alessandro Di Federico d21aadfdd0 docs: document binary installation 2024-02-29 17:03:04 +01:00
Alessandro Di Federico 77c88d2714 Import README.md and licensing information 2024-02-26 17:02:17 +01:00
Alessandro Di Federico 2403f1e10b mkdocs: make links relative 2024-02-26 16:08:54 +01:00
Alessandro Di Federico aa511e07ef Rewrite README.md 2024-02-26 16:03:32 +01:00
Alessandro Di Federico 401a653c89 Reorganize licensing information 2024-02-26 16:02:52 +01:00
Pietro Fezzardi b2e0057907 Merge branch 'feature/alap-variable-declaration' 2024-02-20 23:23:13 +01:00
Andrea Gussoni e1a49e417f ALAPVariableDeclaration: introduce ALAP Var Decl
Perform the ALAP Variable Declaration process.
The process is structured in the following stages:
- We start by collecting all the `Variable`s that need to be assigned in
  a `ASTNode`.
- We build a `GenericGraph` where each `ASTNode` is connected with its
  child nodes, and also its immediate successor.
- We perform a walk in post order over this graph, and for each
  `ASTNode` we decide if the current node could be the ALAP location
  where we can declare the `Variable`, i.e., where we dominate all its
  uses.
2024-02-20 16:35:36 +01:00
Andrea Gussoni 3966d57cfd DecompileFunction.cpp: move helpers to header file
Move some helper functions to the `DecompilationHelpers.h` file in order
to use them from other `.cpp` files.
2024-02-20 16:35:36 +01:00
Pietro Fezzardi a4b14b2d77 Merge branch 'feature/lit-test-cleanup' 2024-02-20 16:21:13 +01:00
Ivan Krysak 3e48504675 PrepareIR: base anonymous struct names on ID alone 2024-02-20 14:35:56 +01:00
Ivan Krysak 6adee367ee RemoveExtraValues: simplify the pass
Simplification includes dropping dependencies onto
`FunctionMetadataCachePass` and `LoadModelWrapperPass`, as well
as removing "StructName" logic outright.
2024-02-20 14:35:56 +01:00
Ivan Krysak 5da851fcd5 lit-tests: remove unnecessary isolated tag 2024-02-20 14:35:56 +01:00
Pietro Fezzardi 8eefe52bc2 Merge branch 'feature/fix-switch-tile' 2024-02-16 15:52:48 +01:00
Andrea Gussoni d4d5e1a966 GenerateAst: rewrite SwitchNode tiling
Perform a complete rewrite of the `SwitchNode` tiling routine.
The tiling now works in the following way:
- When encountering a node which will produce a `SwitchNode` (either a
  standard `switch` or a dispatcher `switch`), we look for the following
  situations:
  1) We have a node, a successor (case) of the `switch`, which in turn
     is the successor of all the other successors (cases) of the
     `switch`.
  2) We have a node, not a successor (case) of the `switch`, which is
     the successor of all the successors (cases) of the `switch`.
- If we find such candidate node, this node will be the fallthrough of
  the `switch`. In addition, depending on whether the `switch` dominates
  the candidate fallthrough, we can incorporate it as the immediate
  successor of the `SwitchNode` we are building.
- There is currently an exception to the above, due to how we currently
  handle weaved `switch`es. In such cases, we mandate that the weaved
  `switch` is nested inside the main corresponding `switch`. For this
  reason, we have a special casing handling the "all inlined but one"
  situation in the new code, while this part could in theory be merged
  in the common criterion below, at the cost of dropping the invariant
  of the nesting of weaved switch`es.
2024-02-16 15:42:27 +01:00
Alessandro Di Federico 9f097e079d revng-c opening: update docs 2024-02-16 10:32:49 +01:00
Andrea Gussoni 2542833bd7 InlineDispatcherSwitch: simplify empty cases
Simplify `switch` cases that are simplified away during the dispatcher
`switch` inlining beautify.
Usually, we can simplify ast nodes by replacing them with `nullptr`s,
but due to how the `switch` cases work, we need to handle them in a
custom way.
2024-02-15 14:28:28 +01:00
Andrea Gussoni 4f642f0e71 InlineDispatcherSwitch: SwitchBreak inlining
Support the situation where we want to inline a `SwitchBreak` node,
which is represented with passing `nullptr` as `InlinedBody`.
2024-02-15 14:28:28 +01:00
Alessandro Di Federico ff5516b5da Merge branch 'feature/msvc-abi-testing' 2024-02-09 17:05:53 +01:00
Alessandro Di Federico b21ff0bd2a Merge branch 'feature/msvc-abi-testing' 2024-02-09 17:05:50 +01:00
Ivan Krysak 4d97044d15 unit-tests: include helpers 2024-02-09 16:24:47 +01:00
Ivan Krysak b0b1f10e72 ABI: move ToCABIFunctionType analysis to revng 2024-02-09 16:24:44 +01:00
Ivan Krysak 069d3d3972 ToCABI: improve logger messages 2024-02-09 15:09:37 +00:00
Ivan Krysak e708a3655b ABI: drop incomplete clrcall support 2024-02-09 15:09:37 +00:00
Ivan Krysak c8cd0ab503 ValueDistributor: improve success log message 2024-02-09 15:09:37 +00:00
Ivan Krysak b1ed3aa959 AccessTracker: make an assertion more obvious
It's pretty confusing for a nullptr access to fail on the same line as
an existing assert, which is why it's better to move them to separate
lines.
2024-02-09 15:09:37 +00:00
Ivan Krysak e62d4f79ef ABI: remove an obsolete definition parameter
Since pointer to copy system got straightenned up, the old way of
marking them (`abi::Definition::UsePointerToCopyForStackArguments`)
is no longer needed.
2024-02-09 15:09:37 +00:00
Ivan Krysak 5a36d8fccf ABI-tests: update documentation 2024-02-09 15:09:37 +00:00
Ivan Krysak 94b6be25ae ABI-tests: check equivalence after compatibility
This does not change anything about the "successful" tests, but does
make "failing" ones slightly easier to debug - since "compatibility"
failures are generally easier to work with (they provide more explicit
information about the failure) that "equivalence" ones.
2024-02-09 15:09:37 +00:00
Ivan Krysak b73d4934c8 ABI-tests: extend register comparison
It now accounts for endianness.
2024-02-09 15:09:37 +00:00
Ivan Krysak 52c9ae0b4d ABI-tests: fix vector-less MIPS tests 2024-02-09 15:09:37 +00:00
Ivan Krysak bd6ab10454 ABI-tests: stop using unsupported primitives 2024-02-09 15:09:37 +00:00
Ivan Krysak 27491410d6 ABI: introduce a way to disable vector registers 2024-02-09 15:09:37 +00:00
Ivan Krysak fe025e37ef ABI: short-circuit zero-offset to always be zero 2024-02-09 15:09:37 +00:00
Ivan Krysak bc6673d90d ABI: make alignment-computation fails stricter 2024-02-09 15:09:37 +00:00
Ivan Krysak a018d443e1 ABI: update "safe" conversion list 2024-02-09 15:09:37 +00:00