[Compiler] Add reset-here option to colored and constrained rlet vars (#169)

* add reset-here to clear coloring at entry to rlet

* update doc
This commit is contained in:
water111
2020-12-27 14:21:48 -05:00
committed by GitHub
parent 25301a8bbc
commit c811778d00
11 changed files with 54 additions and 69 deletions
+7 -6
View File
@@ -25,12 +25,6 @@ bool Function::build_expression(LinkedObjectFile& file) {
// or more complicated analysis to do as good as possible on outer begins.
auto all_children = ir->get_all_ir(file);
std::vector<IR_Begin*> all_begins;
for (auto i = all_children.size(); i-- > 0;) {
auto as_begin = dynamic_cast<IR_Begin*>(all_children.at(i).get());
if (as_begin) {
all_begins.push_back(as_begin);
}
}
// the top level may also be a begin
auto as_begin = dynamic_cast<IR_Begin*>(ir.get());
@@ -38,6 +32,13 @@ bool Function::build_expression(LinkedObjectFile& file) {
all_begins.push_back(as_begin);
}
for (auto& i : all_children) {
auto child_as_begin = dynamic_cast<IR_Begin*>(i.get());
if (child_as_begin) {
all_begins.push_back(child_as_begin);
}
}
// turn each begin into an expression
for (auto b : all_begins) {
if (!expressionize_begin(b, file)) {