/** ** \file escapes/escapes-visitor.cc ** \brief Implementation for escapes/escapes-visitor.hh. */ #include #include #include namespace escapes { // FIXME DONE: Some code was deleted here. void EscapesVisitor::operator()(ast::SimpleVar& e) { if (depth_map_.at(e.def_get()) < current_depth_) e.def_get()->escape_set(true); } void EscapesVisitor::operator()(ast::VarDec& e) { e.escape_set(false); depth_map_.insert_or_assign(&e, current_depth_); super_type::operator()(e); } void EscapesVisitor::operator()(ast::FunctionDec& e) { current_depth_++; super_type::operator()(e); current_depth_--; } } // namespace escapes