Example of a SUIF IR Module
A simple example that
illustrates how to define and generate a simple SUIF IR module from a
Hoof specification.
Files
- test.hoof: Source code of a hoof specification
- Makefile: Make file that produces a
testnodes library in ${NCIHOME}/solib
Generating the definition
# build the library and generate the include files.
hoof> gmake
...
Input File(test.hoof)
module test {
concrete Example : SuifObject
{
int x;
};
}
Output Files
-
A library: ${NCIHOME}/solib/sotestnodes.so
-
Usage: Use import testnodes to import library in suifdriver
-
Header files in ${NCIHOME}/include/testnodes
test_factory.h - Interface for the object factory to
create objects of the class.
test_forwarders.h - Forward declarations for the class.
This is all you need to declare pointers to the class.
Implementation: test.cpp in the source directory