Add query to determine whether a name was declared at this scope

This will be used to prevent a variable and a function with the same
name from being declared.  As a side effect, the calls to
add_{type,name,function} should never fail.
This commit is contained in:
Ian Romanick 2010-03-19 15:37:01 -07:00
parent 38395c1aad
commit ac4fdc255b
1 changed files with 8 additions and 0 deletions

View File

@ -65,6 +65,14 @@ public:
_mesa_symbol_table_pop_scope(table);
}
/**
* Determine whether a name was declared at the current scope
*/
bool name_declared_this_scope(const char *name)
{
return _mesa_symbol_table_symbol_scope(table, -1, name) == 0;
}
/**
* \name Methods to add symbols to the table
*