[Decompile] connect, text-h, settings-h, capture, memory-usage-h (#410)

* decompile stuff

* temp

* temp2

* fix

* temp

* preparing for merge

* working

* fix stupid format

* fix codacy
This commit is contained in:
water111
2021-05-05 17:38:16 -04:00
committed by GitHub
parent 8d99bee88c
commit 0a6602e320
41 changed files with 4626 additions and 369 deletions
+14 -2
View File
@@ -1855,6 +1855,10 @@ void FunctionCallElement::update_from_stack(const Env& env,
fmt::format("Inconsistent types in method call: {} and {}", type_1, type_2));
}
if (type_2 == "array") {
type_2 = "boxed-array";
}
auto quoted_type = pool.alloc_single_element_form<SimpleAtomElement>(
nullptr, SimpleAtom::make_sym_ptr(type_2));
@@ -2052,13 +2056,15 @@ void CondNoElseElement::push_to_stack(const Env& env, FormPool& pool, FormStack&
x->push_to_stack(env, pool, stack);
}
bool first = true;
for (auto& entry : entries) {
for (auto form : {entry.condition, entry.body}) {
if (form == first_condition) {
form->clear();
form->push_back(stack.pop_back(pool));
} else {
FormStack temp_stack(false);
FormStack temp_stack(first && stack.is_root());
first = false;
for (auto& elt : form->elts()) {
elt->push_to_stack(env, pool, temp_stack);
}
@@ -3161,7 +3167,13 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool,
///////////////////////////
void StackSpillStoreElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) {
mark_popped();
auto src = pop_to_forms({m_value}, env, pool, stack, true).at(0);
Form* src;
if (m_value.is_var()) {
src = pop_to_forms({m_value.var()}, env, pool, stack, true).at(0);
} else {
src = pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_value);
}
auto dst = pool.alloc_single_element_form<ConstantTokenElement>(
nullptr, env.get_spill_slot_var_name(m_stack_offset));
if (m_cast_type) {