Go to the previous, next section.

Name Table Entry

A name_table_entry represents an individual name. Each name has a SUIF variable or a string as the name and an associated name_table_entry_kind.

The name_table_entry_kind describes the properties of the name. Valid kinds are:

nte_none
No kind was assigned.

nte_symconst
The name represents a symbolic constant.
nte_cond
The name represents a conditional variable.
nte_loop
The name represents a loop index variable.
nte_dim
The name represents an array dimension.
nte_summary
The name represents a loop index or a conditional that has been projected away.
nte_aux
An auxiliary variable. For auxiliary variables, there is no SUIF variable or string attached to it. Between systems of inequalities, no two auxiliary variables are equal, and thus do not require a name to identify them.

Even though two different names are of different kinds, they can match up if the names match. For example, name table entries NA and NB both have SUIF variable v as the name. But NA is a symbolic constant and NB is a loop index variable. When aligning, NA and NB will match up and the resulting name will be of loop index kind.

The following are functions and operations available on name_table_entry. In this list of functions, symbols nte, nte1 and nte2 are of the class name_table_entry, symbol knd is a name_table_entry_kind and im is of the class immed.

name_table_entry nte();
nte.init();
Initialize nte as a null entry.

name_table_entry nte(im);
nte.init(im);
Initialize nte using im. If im is a variable name (class var_sym) or character string, the kind will be a symbolic constant; otherwise no name is set and nte will be an auxiliary variable.

name_table_entry nte(knd, im);
nte.init(knd, im);
The name is extracted from im and the kind is set to knd. If knd is of auxiliary variable type, im is disregarded.

name_table_entry nte(nte1);
nte.init(nte1);
A copy of nte1 is made.

im = nte.name();
char * str = nte.string();
var_sym * vs = nte.var();
Get the name of the entry. While name() and string() will work for both character strings and SUIF variable symbols, var() can be used only on entries with SUIF variable symbol names. If the name table entry is of auxiliary variable kind, none of the above functions are applicable.

nte.set_name(im);
Set the name of the entry.

knd = nte.kind();
Get the name table entry kind.

nte.mark_sym();
nte.mark_cond();
nte.mark_loop();
nte.mark_dim();
nte.mark_summary();
nte.mark_aux();
Change the name table entry kind. If the kind is set to auxiliary variable, the name will be deleted.

nte1 == nte2
nte1 != nte2
Check if two entries are identical (both the name and the kind).

FILE * fp;
nte.print(fp);
Print the name table entry.

Go to the previous, next section.