mirror of
https://github.com/open-goal/jak-project
synced 2026-06-12 21:45:33 -04:00
[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:
@@ -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)) {
|
||||
|
||||
@@ -1099,11 +1099,14 @@ void ObjectFileDB::analyze_expressions() {
|
||||
(void)segment_id;
|
||||
// register usage
|
||||
func.run_reg_usage();
|
||||
attempts++;
|
||||
if (func.build_expression(data.linked_data)) {
|
||||
success++;
|
||||
} else {
|
||||
func.warnings.append(";; Expression analysis failed.\n");
|
||||
|
||||
if (func.attempted_type_analysis) {
|
||||
attempts++;
|
||||
if (func.build_expression(data.linked_data)) {
|
||||
success++;
|
||||
} else {
|
||||
func.warnings.append(";; Expression analysis failed.\n");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user