Commit Graph

12 Commits

Author SHA1 Message Date
Pietro Fezzardi 2bdff9bbaf MarkForSerialization: fix ExtractValueInst
With this commit `ExtractValueInst`s are handled so that they don't have
side effects.
This significantly improves the quality of the decompiled output,
preventing the forced serialization of all the extraction of struct
fields after calls to function that return structs, except for when it's
really needed.
2020-11-02 12:52:58 +01:00
Pietro Fezzardi 2b599d0ebc RestructureCFG: fix NDuplicates 2020-10-30 01:12:03 +01:00
Pietro Fezzardi 6d10120e2e Decompiler: fix emission of code before branches
Before this commit, the C statements before an IfNode or a SwitchNode
were not guaranteed to be emitted if they were not involved in the
computation of the branch condition.

This commit fixes this problem.
2020-07-22 17:27:02 +02:00
Pietro Fezzardi fc2912ca32 enforce clang-format 2020-01-15 18:24:28 +01:00
Pietro Fezzardi c6c6f19535 Enforce check-conventions 2019-11-20 15:16:17 +01:00
Andrea Gussoni 9e4a9b2484 TEMP: Soft fail for decompilation 2019-07-23 09:09:47 +00:00
Andrea Gussoni 20b380c0d1 NDuplicates passed as reference to Mark
Removed the computation of the information contained in the
`NDuplicates` prevously done in the `MarkForSerialization` pass, since
the information is now precomputed in the `RestructureCFG` pass and
exposed with a dedicated method.
2019-04-15 10:16:05 +02:00
Pietro Fezzardi 9e4c5f0ece Add support for functions returning structs 2019-04-02 11:57:07 +02:00
Pietro Fezzardi a231d013d0 improve lazy serialization of branch conditions 2019-03-29 11:08:13 +01:00
Pietro Fezzardi dadbf54631 Rework decompiler 2019-03-20 17:47:04 +01:00
Andrea Gussoni 3cf9ffd3ca Move beautify passes in DecompilationPass
Moved a lot of passes that apply optimizations on the AST in the
decompilation pass.

All the optimization functions are now in a dedicated file
(`CDecompilerBeautify.cpp`) and the only function used as interface with
the `CDecompilerAction` pass is the `beautifyAST` function.

This means that now the simplifications will be applied on the already
flattened AST.

Some basic transformations have been left in the `RestructureCFG` pass,
to avoid having an AST of poor quality as output of the pass.
2019-03-14 18:03:36 +01:00
Pietro Fezzardi bc6e2fcb01 Add MarkForSerialization MonotoneFramework 2019-03-14 09:50:14 +01:00