Commit Graph

14 Commits

Author SHA1 Message Date
Pietro Fezzardi e34426c03e Decompiler: handle PHINode with StructType 2021-05-06 10:37:56 +02:00
Pietro Fezzardi 3be9d0a9a1 Fix missing parenthesis around ConditionalOperator 2021-04-27 21:19:06 +02:00
Pietro Fezzardi 7a1b11a83d DecompilationHelpers: improve int->ptr casts
Before this commit, we assumed integer-to-pointer casts were only
widening, never narrowing.
Turns out this is not true. For instance, narrowing casts happen when
decompiling s390x code.

With this commit, the decompiler can handle that case gracefully.
2021-02-03 12:03:29 +01:00
Pietro Fezzardi 3f1ee6ea64 Stub of DLA integration in Clang AST emission 2021-02-02 11:23:53 +01:00
Pietro Fezzardi ca999a7c3c Add DeclCreator class to unify forward declaration
Before this commit, the logic to generate all the emitted C forward
declarations (types, global variables, and functions) that has to be
printed before each decompiled function was scattered across three
classes: FuncDeclCreationAction, TypeDeclCreationAction, and
GlobalDeclCreationAction.

These are all gone now, because the scattered logic was very confusing
to follow. Now we only have a single class that takes care of
declarations with global scope: DeclCreator.

Thanks to this, I was able to drop a bunch of useless layers of software
engineering used to shape the creation of the declaration as if it was
some kind of clang ASTConsumer, which is pointless.
2021-02-02 11:23:53 +01:00
Pietro Fezzardi 93d9cbb67b Enforce new include conventions 2020-11-12 18:00:45 +01:00
Alessandro Di Federico 37fde04594 Move licensing details to LICENSE.md 2020-11-09 10:03:33 +01:00
Pietro Fezzardi c3a6a09f11 Upgrade to llvm-9 2020-01-15 18:24:28 +01:00
Pietro Fezzardi 569ec5658e Add and enforce -Wall and -Werror 2019-11-20 15:16:14 +01:00
Pietro Fezzardi b058c326c6 Enforce coding style 2019-05-08 17:40:53 +02:00
Pietro Fezzardi ed3d1b1ab8 Properly print bool variables from stdbool.h 2019-04-05 18:52:13 +02:00
Pietro Fezzardi 9e4c5f0ece Add support for functions returning structs 2019-04-02 11:57:07 +02:00
Pietro Fezzardi a5175908dc Fix emission of statements after decompiler rework 2019-03-21 11:59:06 +01:00
Pietro Fezzardi 2640bbfeeb Use uniform naming for decompiler source files 2019-03-11 18:11:05 +01:00