next up previous contents external
Next: Avoiding global variables Up: Using the PIPS data Previous: Loading and storing resources

Creating new resources

Our dead code elimination phase is a simple code transformation example and in fact all the needed resources already exist in PIPS and we do not produce some new resources . However, if we try to add some new semantical analyses, some new languages features, etc. some new resources to store these information is necessary. This new resource creation process is explained in the PIPS development environment guide [8].

To avoid conflicts with already defined data structures in the PIPS sources, a resource resource is named internally DBR_RESOURCE with big caps.

Since we do not use dynamic linking and UNIX nlist() for portability reasons, adding a new resource with the related methods require a recompilation of PIPS . But since adding a new resource does not occur very often and implies that a new phase is also added or at least modified to use it and that it requires also a recompilation, it is not a big deal.

The new resources must be added in the $PIPS_DIR/Validation/Libs/pipsdbm library that is the core of PIPSDBM . The methods to be used for loading, unloading, freeing and verifying are added in the method_map[] array of the file method_io.c. The file module.c must be modified to reflect the unloading order of the resource hierarchy. For file resources (used for example for prettyprinters ), the file disk.c need also to be updated. After this modification, the PIPSDBM library must be installed and PIPS recompiled (with make-pips -r). Further explanation are found in the development environment guide [8].


next up previous contents external
Next: Avoiding global variables Up: Using the PIPS data Previous: Loading and storing resources

Ronan KERYELL
vendredi, 20 décembre 1996, 16:25:47 MET