-ec754ff4617d564d3dc377121ea9ac5e55f6535a
+70ceba5e95716653b9f829a457a44a829175d4da
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
this->location());
}
+ bool
+ do_must_eval_in_order() const
+ { return true; }
+
bool
do_is_addressable() const
{ return true; }
this->traverse(&order_eval);
}
+// Order evaluations in a block.
+
+void
+Gogo::order_block(Block* block)
+{
+ Order_eval order_eval(this);
+ block->traverse(&order_eval);
+}
+
// A traversal class used to find a single shortcut operator within an
// expression.
this->traverse(&shortcuts);
}
+// Turn shortcut operators into explicit if statements in a block.
+
+void
+Gogo::remove_shortcuts_in_block(Block* block)
+{
+ Shortcuts shortcuts(this);
+ block->traverse(&shortcuts);
+}
+
// Traversal to flatten parse tree after order of evaluation rules are applied.
class Flatten : public Traverse
void
remove_shortcuts();
+ // Turn short-cut operators into explicit if statements in a block.
+ void
+ remove_shortcuts_in_block(Block*);
+
// Use temporary variables to force order of evaluation.
void
order_evaluations();
+ // Order evaluations in a block.
+ void
+ order_block(Block*);
+
// Add write barriers as needed.
void
add_write_barriers();
Block* b = gogo->finish_block(bloc);
gogo->add_block(b, bloc);
gogo->lower_block(hash_fn, b);
+ gogo->order_block(b);
+ gogo->remove_shortcuts_in_block(b);
gogo->finish_function(bloc);
Named_object *equal_fn = gogo->start_function(equal_name, equal_fntype,
b = gogo->finish_block(bloc);
gogo->add_block(b, bloc);
gogo->lower_block(equal_fn, b);
+ gogo->order_block(b);
+ gogo->remove_shortcuts_in_block(b);
gogo->finish_function(bloc);
// Build the function descriptors for the type descriptor to refer to.