next up previous contents
Next: Generating SUIF Intermediate Representation Up: The Basic SUIF Programming Previous: Passes and Pipelinable Passes   Contents


The Basic Data Structures

The basic SUIF infrastructure uses a set of basic data structures that you might also find useful for your own code. These data structures are defined in the directory nci/suif/suif2b/common.


Table 3: Basic Types
Data Structure Filename Implements
IInteger i_integer.h Infinite precision integer
String MString.h String
LString lstring.h String with pointer equality
list suif_list.h Simple list template
indexed_list suif_indexed_list.h An indexed list containing key and value pairs
suif_hash_map suif_hash_map.h A map function based on a hash table
suif_vector suif_vector.h Vector template
SparseVector sparse_vector.h Sparse vector template

Some of these are similar to STL types and it is intended that they can be replaced by the STL types if so desired. The STL templates have not been used from the beginning because some compilers still have trouble compiling the STL templates and compile time will probably be slower.

Figure 5: Calling a Pass Directly (incomplete)
  int main() {
      SuifEnv* suif = new SuifEnv();
      suif->init();

      init_basicnodes(suif);              // import basicnodes
      init_suifnodes(suif);               // import suifnodes
      suif->read("hello_word.suif");      // load suif file
      init_s2c(suif);
      // TBD: how do we call this?
      //   There seems to be no good interface 
      //   if parameters must be passed
  }


next up previous contents
Next: Generating SUIF Intermediate Representation Up: The Basic SUIF Programming Previous: Passes and Pipelinable Passes   Contents
SUIF Nightly Build
2000-08-14