+
+// Mark a variable as used.
+
+void
+Parse::mark_var_used(Named_object* no)
+{
+ if (no->is_variable())
+ {
+ no->var_value()->set_is_used();
+
+ // When a type switch uses := to define a variable, then for
+ // each case with a single type we introduce a new variable with
+ // the appropriate type. When we do, if the newly introduced
+ // variable is used, then the type switch variable is used.
+ Type_switch_vars::iterator p = this->type_switch_vars_.find(no);
+ if (p != this->type_switch_vars_.end())
+ p->second->var_value()->set_is_used();
+ }
+}