[Decompiler] Decompile let (#309)

* test

* fix bug

* fix tests for let

* missing formatting fix
This commit is contained in:
water111
2021-03-05 18:48:01 -05:00
committed by GitHub
parent 9168f03289
commit 65ffe83468
20 changed files with 2312 additions and 1655 deletions
+4 -1
View File
@@ -5,6 +5,7 @@
#include "decompiler/analysis/cfg_builder.h"
#include "decompiler/analysis/expression_build.h"
#include "decompiler/analysis/final_output.h"
#include "decompiler/analysis/insert_lets.h"
#include "common/goos/PrettyPrinter.h"
#include "decompiler/IR2/Form.h"
#include "third-party/json.hpp"
@@ -129,7 +130,7 @@ std::unique_ptr<FormRegressionTest::TestData> FormRegressionTest::make_function(
// for now, just test that this can at least be called.
if (test->func.ir2.top_form) {
RegAccessSet vars;
test->func.ir2.top_form->collect_vars(vars);
test->func.ir2.top_form->collect_vars(vars, true);
if (do_expressions) {
bool success = convert_to_expressions(test->func.ir2.top_form, *test->func.ir2.form_pool,
@@ -139,6 +140,8 @@ std::unique_ptr<FormRegressionTest::TestData> FormRegressionTest::make_function(
if (!success) {
return nullptr;
}
insert_lets(test->func, test->func.ir2.env, *test->func.ir2.form_pool,
test->func.ir2.top_form);
}
}