newgen.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define STATEMENT_ORDERING_UNDEFINED   (-1)
 Warning! Do not modify this file that is automatically generated!
#define MAKE_STATEMENT_MAPPING()   (statement_mapping) hash_table_make(hash_pointer, 0)
#define FREE_STATEMENT_MAPPING(map)   (hash_table_free((hash_table) (map)))
#define SET_STATEMENT_MAPPING(map, stat, val)   hash_put((hash_table) (map), (char *)(stat), (char *)(val))
#define GET_STATEMENT_MAPPING(map, stat)   hash_get((hash_table) (map), (char *) (stat))
#define STATEMENT_MAPPING_COUNT(map)   hash_table_entry_count((hash_table) map)
#define STATEMENT_MAPPING_MAP(s, v, code, h)   HASH_MAP(s, v, code, h)
#define DEFINE_CURRENT_MAPPING(name, type)   GENERIC_CURRENT_MAPPING(name, type, statement)
#define MAKE_ENTITY_MAPPING()   ((entity_mapping) hash_table_make(hash_pointer, 0))
#define FREE_ENTITY_MAPPING(map)   (hash_table_free((hash_table) (map)))
#define SET_ENTITY_MAPPING(map, ent, val)   hash_put((hash_table) (map), (char *)(ent), (char *)(val))
#define GET_ENTITY_MAPPING(map, ent)   hash_get((hash_table) (map), (char *)(ent))
#define ENTITY_MAPPING_COUNT(map)   hash_table_entry_count((hash_table) map)
#define ENTITY_MAPPING_MAP(s, v, code, h)   HASH_MAP(s, v, code, h)
#define MAKE_CONTROL_MAPPING()   ((control_mapping) hash_table_make(hash_pointer, 0))
#define FREE_CONTROL_MAPPING(map)   (hash_table_free((hash_table) (map)))
#define SET_CONTROL_MAPPING(map, cont, val)   hash_put((hash_table) (map), (char *)(cont), (char *)(val))
#define GET_CONTROL_MAPPING(map, cont)   hash_get((hash_table) (map), (char *)(cont))
#define CONTROL_MAPPING_COUNT(map)   hash_table_entry_count((hash_table) map)
#define CONTROL_MAPPING_MAP(s, v, code, h)   HASH_MAP(s, v, code, h)

Typedefs

typedef hash_table statement_mapping
 these macros are obsolete! newgen functions (->) should be used instead
typedef hash_table entity_mapping
typedef hash_table control_mapping

Functions

void initialize_newgen (void)
 newgen.c
void vect_gen_write (FILE *, Pvecteur)
 Pvecteur.c.
Pvecteur vect_gen_read (FILE *, int(*)(void))
void vect_gen_free (Pvecteur)
Pvecteur vect_gen_copy_tree (Pvecteur)
int vect_gen_allocated_memory (Pvecteur)
int contrainte_gen_allocated_memory (Pcontrainte)
void monome_gen_write (FILE *, Pmonome)
 Ppolynome.c.
Pmonome monome_gen_read (FILE *, int(*)(void))
void monome_gen_free (Pmonome)
Pmonome monome_gen_copy_tree (Pmonome)
void polynome_gen_write (FILE *, Ppolynome)
Ppolynome polynome_gen_read (FILE *, int(*)(void))
void polynome_gen_free (Ppolynome)
Ppolynome polynome_gen_copy_tree (Ppolynome)
int monome_gen_allocated_memory (Pmonome)
int polynome_gen_allocated_memory (Ppolynome)
void sc_gen_write (FILE *, Psysteme)
 Psc.c.
Psysteme sc_gen_read (FILE *, int(*)(void))
void sc_gen_free (Psysteme)
Psysteme sc_gen_copy_tree (Psysteme)
int sc_gen_allocated_memory (Psysteme)

Define Documentation

#define CONTROL_MAPPING_COUNT ( map   )     hash_table_entry_count((hash_table) map)

Definition at line 97 of file include/newgen.h.

#define CONTROL_MAPPING_MAP ( s,
v,
code,
 )     HASH_MAP(s, v, code, h)

Definition at line 99 of file include/newgen.h.

#define DEFINE_CURRENT_MAPPING ( name,
type   )     GENERIC_CURRENT_MAPPING(name, type, statement)

Definition at line 65 of file include/newgen.h.

#define ENTITY_MAPPING_COUNT ( map   )     hash_table_entry_count((hash_table) map)

Definition at line 80 of file include/newgen.h.

#define ENTITY_MAPPING_MAP ( s,
v,
code,
 )     HASH_MAP(s, v, code, h)

Definition at line 82 of file include/newgen.h.

#define FREE_CONTROL_MAPPING ( map   )     (hash_table_free((hash_table) (map)))

Definition at line 91 of file include/newgen.h.

#define FREE_ENTITY_MAPPING ( map   )     (hash_table_free((hash_table) (map)))

Definition at line 74 of file include/newgen.h.

#define FREE_STATEMENT_MAPPING ( map   )     (hash_table_free((hash_table) (map)))

Definition at line 52 of file include/newgen.h.

#define GET_CONTROL_MAPPING ( map,
cont   )     hash_get((hash_table) (map), (char *)(cont))

Definition at line 95 of file include/newgen.h.

#define GET_ENTITY_MAPPING ( map,
ent   )     hash_get((hash_table) (map), (char *)(ent))

Definition at line 78 of file include/newgen.h.

#define GET_STATEMENT_MAPPING ( map,
stat   )     hash_get((hash_table) (map), (char *) (stat))

Definition at line 56 of file include/newgen.h.

 
#define MAKE_CONTROL_MAPPING (  )     ((control_mapping) hash_table_make(hash_pointer, 0))

Definition at line 89 of file include/newgen.h.

 
#define MAKE_ENTITY_MAPPING (  )     ((entity_mapping) hash_table_make(hash_pointer, 0))

Definition at line 72 of file include/newgen.h.

 
#define MAKE_STATEMENT_MAPPING (  )     (statement_mapping) hash_table_make(hash_pointer, 0)

Definition at line 50 of file include/newgen.h.

#define SET_CONTROL_MAPPING ( map,
cont,
val   )     hash_put((hash_table) (map), (char *)(cont), (char *)(val))

Definition at line 93 of file include/newgen.h.

#define SET_ENTITY_MAPPING ( map,
ent,
val   )     hash_put((hash_table) (map), (char *)(ent), (char *)(val))

Definition at line 76 of file include/newgen.h.

#define SET_STATEMENT_MAPPING ( map,
stat,
val   )     hash_put((hash_table) (map), (char *)(stat), (char *)(val))

Definition at line 54 of file include/newgen.h.

#define STATEMENT_MAPPING_COUNT ( map   )     hash_table_entry_count((hash_table) map)

Definition at line 58 of file include/newgen.h.

#define STATEMENT_MAPPING_MAP ( s,
v,
code,
 )     HASH_MAP(s, v, code, h)

Definition at line 60 of file include/newgen.h.

#define STATEMENT_ORDERING_UNDEFINED   (-1)

Warning! Do not modify this file that is automatically generated!

Modify src/Libs/newgen/newgen-local.h instead, to add your own modifications. header file built by cprotomapping.h inclusion I do that because this file was previously included in genC.h, but the macros defined here use ri types (statement, entity...). three typedef are also included here. ri.h is a prerequisit for mapping.h.

FC, Feb 21, 1994

Definition at line 42 of file include/newgen.h.


Typedef Documentation

Definition at line 88 of file include/newgen.h.

Definition at line 71 of file include/newgen.h.

these macros are obsolete! newgen functions (->) should be used instead

Definition at line 49 of file include/newgen.h.


Function Documentation

int contrainte_gen_allocated_memory ( Pcontrainte   ) 

Definition at line 176 of file Pvecteur.c.

References vect_gen_allocated_memory().

00177 {
00178     int result = 0;
00179     for(; pc; pc=pc->succ)
00180         result += sizeof(Scontrainte) +
00181             vect_gen_allocated_memory(pc->vecteur);
00182     return result;
00183 }

Here is the call graph for this function:

void initialize_newgen ( void   ) 

newgen.c

Read NewGen specification file

Initialise external functions... re-entry in newgen because of the graph stuff...

can't get the size... FC

can't get the size... FC

do nothing!

read

write

free

copy

size

Definition at line 47 of file newgen.c.

References ALL_SPECS, ARC_LABEL_NEWGEN_EXTERNAL, DB_VOID_NEWGEN_EXTERNAL, free(), gen_allocated_memory(), gen_copy_tree_with_sharing(), gen_core(), gen_false(), gen_free(), gen_identity(), gen_init_external(), gen_null(), gen_read(), gen_read_spec(), gen_true(), gen_write(), MATRICE_NEWGEN_EXTERNAL, NULL, polynome_gen_allocated_memory(), polynome_gen_copy_tree(), polynome_gen_free(), polynome_gen_read(), polynome_gen_write(), PPOLYNOME_NEWGEN_EXTERNAL, PSYSTEME_NEWGEN_EXTERNAL, PTSG_NEWGEN_EXTERNAL, PVECTEUR_NEWGEN_EXTERNAL, sc_gen_allocated_memory(), sc_gen_copy_tree(), sc_gen_free(), sc_gen_read(), sc_gen_write(), sg_dup(), sg_rm(), vect_gen_allocated_memory(), vect_gen_copy_tree(), vect_gen_free(), vect_gen_read(), vect_gen_write(), VERTEX_LABEL_NEWGEN_EXTERNAL, and VOID_STAR_NEWGEN_EXTERNAL.

Referenced by atinit(), gpips_main(), pips_main(), tpips_init(), and wpips_main().

00048 {
00049     /* Read NewGen specification file
00050      */
00051     gen_read_spec(ALL_SPECS);
00052       
00053     /* Initialise external functions...
00054      * re-entry in newgen because of the graph stuff...
00055      */  
00056     gen_init_external(ARC_LABEL_NEWGEN_EXTERNAL, 
00057                       (void* (*)(FILE*,int(*)(void))) gen_read, 
00058                       (void (*)(FILE*, void*)) gen_write,
00059                       (void (*)(void*)) gen_free, 
00060                       (void* (*)(void*)) gen_copy_tree_with_sharing,
00061                       (int (*)(void*)) gen_allocated_memory);
00062 
00063     gen_init_external(VERTEX_LABEL_NEWGEN_EXTERNAL, 
00064                       (void* (*)(FILE*,int(*)(void))) gen_read, 
00065                       (void (*)(FILE*, void*)) gen_write,
00066                       (void (*)()) gen_free, 
00067                       (void* (*)()) gen_copy_tree_with_sharing,
00068                       (int (*)()) gen_allocated_memory);
00069 
00070     gen_init_external(PPOLYNOME_NEWGEN_EXTERNAL, 
00071                       (void* (*)()) polynome_gen_read, 
00072                       (void (*)()) polynome_gen_write, 
00073                       (void (*)()) polynome_gen_free,
00074                       (void* (*)()) polynome_gen_copy_tree,
00075                       (int (*)()) polynome_gen_allocated_memory);
00076 
00077     gen_init_external(PVECTEUR_NEWGEN_EXTERNAL, 
00078                       (void* (*)()) vect_gen_read, 
00079                       (void (*)()) vect_gen_write, 
00080                       (void (*)()) vect_gen_free,
00081                       (void* (*)()) vect_gen_copy_tree,
00082                       (int (*)()) vect_gen_allocated_memory);
00083 
00084     gen_init_external(PSYSTEME_NEWGEN_EXTERNAL, 
00085                       (void* (*)()) sc_gen_read, 
00086                       (void (*)()) sc_gen_write, 
00087                       (void (*)()) sc_gen_free,
00088                       (void* (*)()) sc_gen_copy_tree,
00089                       (int (*)()) sc_gen_allocated_memory);
00090 
00091     gen_init_external(MATRICE_NEWGEN_EXTERNAL, 
00092                       (void* (*)()) gen_core,
00093                       (void (*)()) gen_core, 
00094                       (void (*)()) free,
00095                       (void* (*)()) gen_core,
00096                       (int (*)()) NULL); /* can't get the size... FC */
00097 
00098     gen_init_external(PTSG_NEWGEN_EXTERNAL,
00099                       (void* (*)()) gen_core,
00100                       (void (*)()) gen_core, 
00101                       (void (*)()) sg_rm,
00102                       (void* (*)()) sg_dup,
00103                       (int (*)()) NULL); /* can't get the size... FC */
00104 
00105     gen_init_external(VOID_STAR_NEWGEN_EXTERNAL,
00106                       (void* (*)()) gen_core,
00107                       (void (*)()) gen_core, 
00108                       (void (*)()) gen_null,
00109                       (void* (*)()) gen_identity,
00110                       (int (*)()) gen_false);
00111 
00112     /* do nothing! */
00113     gen_init_external(DB_VOID_NEWGEN_EXTERNAL,
00114                       (void* (*)()) gen_false, /* read */
00115                       (void (*)()) gen_null, /* write */
00116                       (void (*)()) gen_null, /* free */
00117                       (void* (*)()) gen_false, /* copy */
00118                       (int (*)()) gen_true); /* size */
00119 }

Here is the call graph for this function:

Here is the caller graph for this function:

int monome_gen_allocated_memory ( Pmonome   ) 

Definition at line 165 of file Ppolynome.c.

References Smonome::term, and vect_gen_allocated_memory().

00167 {
00168     return sizeof(Smonome) + vect_gen_allocated_memory(m->term);
00169 }

Here is the call graph for this function:

Pmonome monome_gen_copy_tree ( Pmonome   ) 

Definition at line 95 of file Ppolynome.c.

References monome_dup().

00097 {
00098     return(monome_dup(pm));
00099 }

Here is the call graph for this function:

void monome_gen_free ( Pmonome   ) 

Definition at line 89 of file Ppolynome.c.

References monome_rm().

00091 {
00092     monome_rm(&pm);
00093 }

Here is the call graph for this function:

Pmonome monome_gen_read ( FILE *  ,
int(*)(void)   
)
void monome_gen_write ( FILE *  ,
Pmonome   
)

Ppolynome.c.

Definition at line 44 of file Ppolynome.c.

References fprintf(), monome_coeff, monome_term, MONOME_UNDEFINED_P, pips_assert, and vect_gen_write().

00045 {
00046     pips_assert("monome_gen_write", !MONOME_UNDEFINED_P(pm));
00047 
00048     fprintf(fd, "{%f< ", monome_coeff(pm));
00049     vect_gen_write(fd, monome_term(pm));
00050     fprintf(fd, ">}");
00051 }

Here is the call graph for this function:

int polynome_gen_allocated_memory ( Ppolynome   ) 

Definition at line 172 of file Ppolynome.c.

References monome_gen_allocated_memory().

00174 {
00175     int result = 0;
00176     for(; p; p=p->succ)
00177         result += monome_gen_allocated_memory(p->monome) + sizeof(Spolynome);
00178     return result;
00179 }

Here is the call graph for this function:

Ppolynome polynome_gen_copy_tree ( Ppolynome   ) 

Definition at line 158 of file Ppolynome.c.

References polynome_dup().

00160 {
00161     return(polynome_dup(pp));
00162 }

Here is the call graph for this function:

void polynome_gen_free ( Ppolynome   ) 

Definition at line 152 of file Ppolynome.c.

References polynome_rm().

00154 {
00155     polynome_rm(&pp);
00156 }

Here is the call graph for this function:

Ppolynome polynome_gen_read ( FILE *  ,
int(*)(void)   
)
void polynome_gen_write ( FILE *  ,
Ppolynome   
)

Definition at line 101 of file Ppolynome.c.

References fprintf(), monome_gen_write(), pips_assert, polynome_monome, POLYNOME_NUL_P, polynome_succ, and POLYNOME_UNDEFINED_P.

00104 {
00105     Ppolynome p;
00106 
00107     pips_assert("polynome_gen_write", !POLYNOME_UNDEFINED_P(pp));
00108 
00109     fprintf(fd, "\n[");
00110 
00111     for(p=pp; !POLYNOME_NUL_P(p); p=polynome_succ(p)) {
00112         Pmonome pm = polynome_monome(p);
00113 
00114         fprintf(fd, " ");
00115         monome_gen_write(fd, pm);
00116     }
00117 
00118     fprintf(fd, "]\n");
00119 }

Here is the call graph for this function:

int sc_gen_allocated_memory ( Psysteme   ) 

Definition at line 211 of file Psc.c.

References contrainte_gen_allocated_memory(), sc_base, sc_egalites, sc_inegalites, and vect_gen_allocated_memory().

Here is the call graph for this function:

Psysteme sc_gen_copy_tree ( Psysteme   ) 

Definition at line 206 of file Psc.c.

References sc_copy().

00207 {
00208     return sc_copy(s);
00209 }

Here is the call graph for this function:

void sc_gen_free ( Psysteme   ) 

Definition at line 201 of file Psc.c.

References sc_rm().

00202 {
00203     sc_rm(s);
00204 }

Here is the call graph for this function:

Psysteme sc_gen_read ( FILE *  ,
int(*)(void)   
)
void sc_gen_write ( FILE *  ,
Psysteme   
)

Psc.c.

FI: we cannot not store SC_UNDEFINED as it is used in regions; we cannot store it like a system with an empty basis, no inequalities and no equalities because it is used to define transformer identity; conclusion: region library has to be changed and to use transformer_undefined as context

Current kludge: SC_UNDEFINED is stored but retrieved as a system with 0 equalities and 0 inequalities over a space of dimension 0

Definition at line 85 of file Psc.c.

References c, NULL, pips_assert, sc_make(), SC_UNDEFINED, SC_UNDEFINED_P, and vect_gen_write().

00086 {
00087     Pcontrainte c;
00088     Psysteme stored_s;
00089     static Psysteme undefined_s = SC_UNDEFINED;
00090 
00091     /* FI: we cannot not store SC_UNDEFINED as it is used in regions;
00092        we cannot store it like a system with an empty basis, no inequalities
00093        and no equalities because it is used to define transformer identity;
00094        conclusion: region library has to be changed and to use 
00095        transformer_undefined as context 
00096 
00097        Current kludge: SC_UNDEFINED is stored but retrieved as a system
00098        with 0 equalities and 0 inequalities over a space of dimension 0
00099        */
00100     if(SC_UNDEFINED_P(s)) {
00101         if(SC_UNDEFINED_P(undefined_s))
00102             undefined_s = sc_make(CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED);
00103         stored_s = undefined_s;
00104     }
00105     else
00106         stored_s = s;
00107 
00108     pips_assert("sc_gen_write",!SC_UNDEFINED_P(stored_s));
00109     
00110     /*
00111       ifdebug(10){
00112       fprintf(stderr, "[sc_gen_write] sys 0x%x\n", (unsigned int) s);
00113       syst_debug(s); }
00114       */
00115 
00116     (void) fputc('(',fd);
00117 
00118     vect_gen_write(fd,stored_s->base);
00119 
00120     (void) fputc('(',fd);
00121 
00122     for (c = stored_s->egalites; c != NULL; c = c->succ) {
00123         (void) fputc(' ', fd);
00124         vect_gen_write(fd,c->vecteur);
00125     }
00126 
00127     (void) fputc(')',fd);
00128 
00129     (void) fputc('(',fd);
00130 
00131     for (c = stored_s->inegalites; c != NULL; c = c->succ) {
00132         (void) fputc(' ', fd);
00133         vect_gen_write(fd, c->vecteur);
00134     }
00135 
00136     (void) fputc(')',fd);
00137 
00138     (void) fputc(')',fd);
00139 
00140 }

Here is the call graph for this function:

int vect_gen_allocated_memory ( Pvecteur   ) 

Definition at line 168 of file Pvecteur.c.

00169 {
00170     int result = 0;
00171     for (; v; v=v->succ)
00172         result += sizeof(Svecteur);
00173     return result;
00174 }

Pvecteur vect_gen_copy_tree ( Pvecteur   ) 

Definition at line 163 of file Pvecteur.c.

References vect_copy().

00164 {
00165     return vect_copy(v);
00166 }

Here is the call graph for this function:

void vect_gen_free ( Pvecteur   ) 

Definition at line 158 of file Pvecteur.c.

References vect_rm().

00159 {
00160     vect_rm(v);
00161 }

Here is the call graph for this function:

Pvecteur vect_gen_read ( FILE *  ,
int(*)(void)   
)
void vect_gen_write ( FILE *  fd,
Pvecteur  v 
)

Pvecteur.c.

Parameters:
fd d

Definition at line 108 of file Pvecteur.c.

References entity_name, fprint_Value(), NULL, print_token(), TCST_NAME, and val_of.

00109 {
00110     Pvecteur p;
00111 
00112     putc('(', fd);
00113     for (p = v; p != NULL; p = p->succ)
00114     {
00115       fprint_Value(fd, val_of(p));
00116       putc(' ', fd);
00117       print_token(fd, (p->var == (Variable) 0) ? TCST_NAME :
00118                   entity_name((entity) p->var));
00119       putc(' ', fd);
00120     }
00121     putc(')', fd);
00122 }

Here is the call graph for this function:

Generated by  doxygen 1.6.2-20100208