[Decompiler] Clean up the output (#245)

* fix parent issue

* fix compiler issue

* update

* add error messages

* fix error

* fix array access, temporary

* more clean

* fix

* rename arg variables better

* fix method name

* fix no return value in decompiler

* many small fixes

* cheat types so it works

* name map

* fix old test'
This commit is contained in:
water111
2021-02-09 20:59:14 -05:00
committed by GitHub
parent fa061ef7eb
commit 6e0ff4c9d0
55 changed files with 2042 additions and 595 deletions
+8 -2
View File
@@ -25,19 +25,21 @@ std::string FormStack::print(const Env& env) {
return result;
}
void FormStack::push_value_to_reg(Variable var, Form* value, bool sequence_point) {
void FormStack::push_value_to_reg(Variable var, Form* value, bool sequence_point, bool is_elim) {
assert(value);
StackEntry entry;
entry.active = true; // by default, we should display everything!
entry.sequence_point = sequence_point;
entry.destination = var;
entry.source = value;
entry.eliminated_as_coloring_move = is_elim;
m_stack.push_back(entry);
}
void FormStack::push_non_seq_reg_to_reg(const Variable& dst,
const Variable& src,
Form* src_as_form) {
Form* src_as_form,
bool is_elim) {
assert(src_as_form);
StackEntry entry;
entry.active = true;
@@ -45,6 +47,7 @@ void FormStack::push_non_seq_reg_to_reg(const Variable& dst,
entry.destination = dst;
entry.non_seq_source = src;
entry.source = src_as_form;
entry.eliminated_as_coloring_move = is_elim;
m_stack.push_back(entry);
}
@@ -150,6 +153,9 @@ std::vector<FormElement*> FormStack::rewrite(FormPool& pool) {
if (e.destination.has_value()) {
auto elt = pool.alloc_element<SetVarElement>(*e.destination, e.source, e.sequence_point);
if (e.eliminated_as_coloring_move) {
elt->eliminate_as_coloring_move();
}
e.source->parent_element = elt;
result.push_back(elt);
} else {