PIPS
genClib.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdlib.h>
#include <setjmp.h>
#include "genC.h"
#include "newgen_include.h"
#include "newgen_hash.h"
#include "genread.h"
+ Include dependency graph for genClib.c:

Go to the source code of this file.

Data Structures

struct  driver
 The DRIVER structure is used to monitor the general function which traverses objects. More...
 
struct  gen_trav_env
 
struct  gtt_t
 translation tables type... More...
 
struct  multi_recurse
 the current data needed for a multi recursion are stored in a multi recurse struct. More...
 

Macros

#define GO   (1)
 
#define gen_alloc_component(dp, cp, ap, gen_check_p)
 gen_alloc_component updates the gen_chunk CP from the arg list AP according to the domain DP. More...
 
#define CHECK_NULL(obj, bp, dr)    if((obj)==gen_chunk_undefined) {(*(dr)->null)(bp) ; return ;}
 To be called on any object pointer. More...
 
#define MAX_SHARED_OBJECTS   10000
 These functions computes an hash table of object pointers (to be used to manage sharing when dealing with objects). More...
 
#define FIRST_SEEN(s)   ((s)>=first_seen && (s)<first_seen+MAX_SHARED_OBJECTS)
 
#define MAX_GEN_TRAV_ENV   100
 GEN_TRAV_ENVS are stacked to allow recursive calls to GEN_TRAV_OBJ (cf. More...
 
#define COPYABLE_DOMAIN(d)
 COPY_OBJ_OUT achieves to update the new object (copy of the old one) once all sub-domains have been recursively copied. More...
 
#define decision_table_undefined   ((char)25)
 GLOBAL VARIABLES: to deal with decision tables. More...
 

Typedefs

typedef struct gtt_tgtt_p
 
typedef char GenDecisionTableType[MAX_DOMAIN]
 
typedef GenDecisionTableType gen_tables[MAX_DOMAIN]
 
typedef bool(* GenFilterType) ()
 
typedef void(* GenRewriteType) ()
 
typedef GenFilterType GenFilterTableType[MAX_DOMAIN]
 
typedef GenRewriteType GenRewriteTableType[MAX_DOMAIN]
 

Functions

void newgen_start_lexer (FILE *)
 starting the scanner. More...
 
int gen_type (gen_chunk *obj)
 GEN_TYPE returns the domain number for the object in argument. More...
 
string gen_domain_name (int t)
 GEN_DOMAIN_NAME returns the domain name, and may be used for debug purposes. More...
 
int newgen_domain_index (gen_chunk *obj)
 DOMAIN_INDEX returns the index in the Domain table for object OBJ. More...
 
static void fprintf_spaces (fd, number)
 FPRINTF_SPACES prints NUMBER spaces on the FD file descriptor. More...
 
static int array_size (dim)
 ARRAY_SIZE returns the number of elements in the array whose dimension list is DIM. More...
 
static gen_chunkinit_array (union domain *dp)
 INIT_ARRAY returns a freshly allocated array initialized according to the information in its domain DP. More...
 
static int array_own_allocated_memory (union domain *dp)
 
static void gen_alloc_constructed (va_list ap, struct gen_binding *bp, union domain *dp, gen_chunk *cp, int data, int gen_check_p)
 GEN_ALLOC allocates SIZE bytes to implement an object whose TYPE is the index in the Domains table. More...
 
gen_chunkgen_alloc (int size, int gen_check_p, int dom,...)
 allocates something in newgen. More...
 
static void gen_trav_obj ()
 
static void gen_trav_leaf (struct gen_binding *bp, gen_chunk *obj, struct driver *dr)
 set to true to stop... More...
 
static void gen_trav_simple (union domain *dp, gen_chunk *obj, struct driver *dr)
 GEN_TRAV_SIMPLE traverses a simple OBJ (which is a (CONS *) for a list or points to the first element of an array) of type DP according to the driver DR. More...
 
static void gen_array_leaf (struct gen_binding *bp, int i, gen_chunk *obj, struct driver *dr)
 GEN_ARRAY_LEAF is the default recursive call to gen_trav_leaf. More...
 
static void gen_trav_obj_constructed (gen_chunk *obj, __attribute__((unused)) struct gen_binding *bp, union domain *dp, int data, struct driver *dr)
 GEN_TRAV_OBJ (the root function) traverses the object OBJ according to the driver DR. More...
 
static void gen_trav_obj (gen_chunk *obj, struct driver *dr)
 "driver" driven recursion in newgen data structures. More...
 
static int tabulated_leaf_in (gen_chunk *obj, struct gen_binding *bp)
 
int current_shared_obj_table_size (void)
 returns the number of byte allocated for obj_table. More...
 
static int shared_obj_in (gen_chunk *obj, struct driver *dr)
 SHARED_OBJ_IN introduces an object OBJ in the OBJ_TABLE. More...
 
static int shared_simple_in (obj, dp)
 
static void shared_pointers (obj, keep)
 SHARED_POINTERS creates (in OBJ_TABLE) the association between objects and their numbers (!= 0 if sharing). More...
 
static int shared_obj (obj, void(*first)(), void(*others)())
 SHARED_OBJ manages the OBJect modulo sharing (the OBJ_TABLE has to be set first, see above). More...
 
static void push_gen_trav_env ()
 
static void pop_gen_trav_env ()
 
static bool free_already_seen_p (gen_chunk *obj)
 
static int free_leaf_in (gen_chunk *obj, struct gen_binding *bp)
 A tabulated domain BP prohibits its OBJ to be recursively freed. More...
 
static void free_leaf_out (obj, bp)
 FREE_LEAF_OUT manages external types. More...
 
static void free_simple_out (gen_chunk *obj, union domain *dp)
 FREE_SIMPLE_OUT frees the spine of the list OBJ or the whole array (according to the type DP). More...
 
static void free_obj_out (gen_chunk *obj, struct gen_binding *bp, struct driver *dr)
 FREE_OBJ_OUT just frees the object OBJ. More...
 
static int persistant_simple_in (obj, dp)
 GEN_LOCAL_FREE frees the object OBJ with or without KEEPing the sharing. More...
 
static int free_obj_in (gen_chunk *obj, struct driver *dr)
 
void gen_free (gen_chunk *obj)
 version without shared_pointers. More...
 
void gen_full_free_list (list l)
 
static gen_chunkcopy_hsearch (gen_chunk *key)
 maps an object on its copy More...
 
static void copy_hput (hash_table t, char *k, char *v)
 
static int copy_obj_in (gen_chunk *obj, __attribute__((unused)) struct driver *dr)
 COPY_OBJ_IN duplicates an object if it has not already been seen (this migth happen with shared objects). More...
 
static int copy_simple_in (gen_chunk *obj, union domain *dp)
 Just check for defined simple domains. More...
 
static void copy_leaf_out (obj, bp)
 COPY_LEAF_OUT manages external sub-domains. More...
 
static list gen_copy_list (list old_l, union domain *dp)
 GEN_COPY_LIST duplicates cons cells. More...
 
static gen_chunkgen_copy_array (gen_chunk *old_a, dp)
 GEN_COPY_ARRAY duplicates an array. More...
 
static set gen_copy_set (set old_s, dp)
 GEN_COPY_SET duplicates a set. More...
 
static void copy_simple_out (obj, dp)
 COPY_SIMPLE_OUT copies the spine of the list OBJ or the whole array (according to the type DP). More...
 
static void copy_obj_out_constructed (gen_chunk *obj, struct gen_binding *bp, dp, data, new_obj, dr)
 
static void copy_obj_out (obj, bp, dr)
 
static gen_chunkgen_local_copy_tree (gen_chunk *obj, bool keep)
 GEN_COPY_TREE makes a copy of the object OBJ. More...
 
gen_chunkgen_copy_tree (gen_chunk *obj)
 
gen_chunkgen_copy_tree_with_sharing (gen_chunk *obj)
 for re-entry only in gen_copy_tree... More...
 
int gen_free_tabulated (int domain)
 free tabulated elements of this domain. More...
 
static void fputi (int i, FILE *f)
 
static void fputci (char c, int i, FILE *f)
 
static void write_define_shared_node (int n)
 WRITE_DEFINE_SHARED_NODE defines the node whose number is N. More...
 
static void write_shared_node (int n)
 WRITE_SHARED_NODE references a shared node N. More...
 
static void write_null (struct gen_binding *bp)
 
static int write_obj_in (gen_chunk *obj, struct driver *dr)
 WRITE_OBJ_IN writes the OBJect of type BP. More...
 
static void write_obj_out (gen_chunk *obj, struct gen_binding *bp, struct driver *dr)
 WRITE_OBJ_OUT is done when the OBJect (of type BP) has been printed. More...
 
static void write_string (string init, string s, string end, string ifnull, string ifundefined)
 
static int write_leaf_in (gen_chunk *obj, struct gen_binding *bp)
 WRITE_LEAF_IN prints the OBJect of type BP. More...
 
static int write_simple_in (obj, dp)
 WRITE_SIMPLE_IN is done before printing a simple OBJect of type DP. More...
 
static void write_array_leaf (struct gen_binding *bp, int i, gen_chunk *obj, struct driver *dr)
 WRITE_ARRAY_LEAF only writes non-null elements, in a sparse way. More...
 
static void write_simple_out (gen_chunk *obj, union domain *dp)
 WRITE_LEAF_OUT prints the closing parenthesis of (non-basis) simple OBJect of type DP. More...
 
void gen_write (FILE *fd, gen_chunk *obj)
 GEN_WRITE writes the OBJect on the stream FD. More...
 
void gen_write_without_sharing (fd, obj)
 GEN_WRITE_WITHOUT_SHARING writes the OBJect on the stream FD. More...
 
static int write_tabulated_leaf_in (gen_chunk *obj, struct gen_binding *bp)
 WRITE_TABULATED_LEAF_IN prints the OBJect of type BP. More...
 
static void write_this_tabulated (gen_chunk *o)
 
static void change_sign (gen_chunk *o)
 
int gen_write_tabulated (FILE *fd, int domain)
 GEN_WRITE_TABULATED writes the tabulated object TABLE on FD. More...
 
string gen_read_string (FILE *file, char upto)
 returns the allocated line read, whatever its length. More...
 
static gtt_p gtt_make (void)
 returns an allocated and initialized translation table... More...
 
static void gtt_table_init (gtt_p table)
 
static void gtt_table_identity (gtt_p table)
 
static int get_domain_number (string name, int i)
 == simplified lookup? returns the index of domain name if found, looking up from i. More...
 
static int first_available (int t[MAX_DOMAIN])
 
static gtt_p gtt_read (string filename)
 read and setup a table from a file More...
 
static void gtt_write (string filename, gtt_p table)
 writes what the previous reads... More...
 
int gen_type_translation_old_to_actual (int n)
 forwards conversion More...
 
int gen_type_translation_actual_to_old (int n)
 backwards conversion More...
 
void gen_type_translation_reset (void)
 
void gen_type_translation_default (void)
 
void gen_type_translation_read (string filename)
 set current type translation table according to file More...
 
void gen_type_translation_write (string filename)
 
static void init_gen_quick_recurse_tables (void)
 GEN_READ_SPEC reads the specifications. More...
 
void genspec_set_string_to_parse (char *)
 
void genspec_reset_string_to_parse (void)
 
void genspec_lex_destroy ()
 
void gen_read_spec (char *spec,...)
 
void gen_init_external (int which, void *(*read)(FILE *, int(*)(void)), void(*write)(FILE *, void *), void(*free)(void *), void *(*copy)(void *), int(*allocated_memory)(void *))
 GEN_INIT_EXTERNAL defines entry points for free, read and write functions of external types. More...
 
gen_chunkgen_make_array (num)
 GEN_MAKE_ARRAY allocates an initialized array of NUM gen_chunks. More...
 
gen_chunkgen_read (FILE *file)
 GEN_READ reads any object from the FILE stream. More...
 
int gen_read_tabulated (FILE *file, int create_p)
 GEN_READ_TABULATED reads FILE to update the Gen_tabulated_ table. More...
 
gen_chunkgen_check (gen_chunk *obj, int t)
 GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE. More...
 
static void open_black_hole ()
 
int gen_consistent_p (gen_chunk *obj)
 GEN_CONSISTENT_P dynamically checks the type correctness of OBJ. More...
 
static void void_gen_consistent_p (gen_chunk *obj)
 for side effects only More...
 
int gen_tabulated_consistent_p (int domain)
 
static void defined_null (struct gen_binding *bp)
 GEN_DEFINED_P checks that the OBJect is fully defined. More...
 
int gen_defined_p (gen_chunk *obj)
 
static bool check_sharing (char *p, char *type)
 
static int sharing_obj_in (gen_chunk *obj, struct driver *dr)
 
static int sharing_simple_in (gen_chunk *obj, union domain *dp)
 
bool gen_sharing_p (gen_chunk *obj1, gen_chunk *obj2)
 
static bool allocated_memory_already_seen_p (gen_chunk *obj)
 true if obj was already seen in this recursion, and put it at true More...
 
static int allocated_memory_leaf_in (obj, bp)
 manages EXTERNALS and INLINABLES More...
 
static int allocated_memory_obj_in (gen_chunk *obj, struct driver *dr)
 manages newgen objects and strings... More...
 
static int allocated_memory_simple_in (gen_chunk *obj, union domain *dp)
 manages newgen simples (list, set, array) More...
 
int gen_allocated_memory (gen_chunk *obj)
 re-entry is automatic for this function. More...
 
void gen_null (__attribute__((unused)) void *unused)
 Ignore the argument. More...
 
void gen_null2 (__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
 idem with 2 args, to please overpeaky compiler checks More...
 
void * gen_NULL (__attribute__((unused)) void *unused)
 idem with a void* return More...
 
void * gen_NULL2 (__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
 idem with 2 args, to please overpeaky compiler checks More...
 
bool gen_true (__attribute__((unused)) gen_chunk *unused)
 Return true and ignore the argument. More...
 
bool gen_true2 (__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
 
bool gen_false (__attribute__((unused)) gen_chunk *unused)
 Return false and ignore the argument. More...
 
bool gen_false2 (__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
 
void * gen_identity (const void *x)
 Just return the argument. More...
 
void * gen_chunk_identity (gen_chunk x)
 
void gen_core (__attribute__((unused)) void *p)
 Abort when called. More...
 
void * gen_core_NULL (__attribute__((unused)) void *p)
 
static void print_decision_table (GenDecisionTableType t)
 
static void initialize_domain_DecisionTables (int domain)
 demand driven computation of the decision table to scan domain. More...
 
static void initialize_domain_DirectDomainsTable (int target, union domain *dp)
 walks thru the domain to tag all types for target. More...
 
static void initialize_DirectDomainsTable (void)
 
static void initialize_DecisionTables ()
 
static GenDecisionTableTypeget_decision_table (int domain)
 returns a decision table for the given domain. More...
 
static bool quick_multi_already_seen_p (gen_chunk *obj)
 true if obj was already seen in this recursion. More...
 
static int quick_multi_recurse_obj_in (gen_chunk *obj, __attribute__((unused)) struct driver *dr)
 
static void quick_multi_recurse_obj_out (gen_chunk *obj, __attribute__((unused)) struct gen_binding *bp, __attribute__((unused)) struct driver *dr)
 
static int quick_multi_recurse_simple_in (gen_chunk *obj, union domain *dp)
 
void gen_recurse_stop (void *obj)
 Tells the recursion not to go in this object. More...
 
static void gen_internal_context_multi_recurse (void *o, void *context, bool gointabs, va_list pvar)
 Multi recursion generic visitor function. More...
 
void gen_context_multi_recurse (void *o, void *context,...)
 Multi-recursion with context function visitor. More...
 
void gen_full_recurse (void *o, void *context,...)
 Full multi-recursion with context function visitor. More...
 
void gen_multi_recurse (void *o,...)
 Multi recursion visitor function. More...
 
void gen_recurse (void *obj, int domain, bool(*filter)(void *encountered), void(*rewrite)(void *encountered_object))
 Visit all the objects from a given types found in an object. More...
 
void gen_context_recurse (void *obj, void *context, int domain, bool(*filter)(void *encountered_object, void *context), void(*rewrite)(void *encountered_object, void *context))
 Visit all the objects from a given types found in an object with a context. More...
 
gen_chunkgen_get_recurse_previous_visited_object (void)
 Get the previously visited object. More...
 
gen_chunkgen_get_recurse_current_ancestor (void)
 Get the ancestor of the current object. More...
 
gen_chunkgen_get_recurse_ancestor (const void *object)
 Get the first ancestor object encountered during the recursion for the given object. More...
 
gen_chunkgen_get_ancestor (int type, const void *obj)
 return the first ancestor object found of the given type. More...
 
gen_chunkgen_get_current_object (void)
 return the current visited object, or NULL if not in a recursion. More...
 
gen_chunkgen_get_current_ancestor (int type)
 Return current object of that type... More...
 

Variables

FILE * genspec_in
 lex files More...
 
FILE * genspec_out
 
struct gen_bindingTabulated_bp
 pointer to tabulated domain hack More...
 
int Read_spec_mode
 extern int Current_first ; More...
 
static bool Read_spec_performed = false
 
int gen_debug = 0
 The debug flag can be changed by the user to check genClib code. More...
 
static int gen_debug_indent = 0
 
static int disallow_undefined_tabulated = true
 Default option in GEN_WRITE. More...
 
static bool gen_trav_stop_recursion = false
 
static char * first_seen = (char *)NULL
 
static char * seen_once = (char *)NULL
 
static hash_table obj_table = (hash_table)NULL
 The OBJ_TABLE maps objects to addresses within the arrays FIRST_SEEN and SEEN_ONCE. More...
 
static int shared_number = 0
 The running counter of shared objects number. More...
 
static int gen_trav_env_top = 0
 
struct gen_trav_env gen_trav_envs [MAX_GEN_TRAV_ENV]
 
static __thread hash_table free_already_seen = (hash_table) NULL
 These functions are used to implement the freeing of objects. More...
 
static hash_table copy_table = NULL
 These functions are used to implement the copying of objects. More...
 
static FILE * user_file
 These functions implements the writing of objects. More...
 
static struct gen_bindingwtt_bp = NULL
 
static struct driverwtt_dr = NULL
 
static gtt_p gtt_current_table = NULL
 global translation table. More...
 
int error_seen
 Have we seen a user error somewhere ? More...
 
static FILE * black_hole = NULL
 used for consistence checking... More...
 
static bool cumulated_error_seen
 
static hash_table pointers = (hash_table)NULL
 GEN_SHARING_P checks whether OBJ1 uses objects (except tabulated) or CONS cells that appear in OBJ2. More...
 
static jmp_buf env
 
static int current_size
 returns the number of bytes allocated for a given structure may need additional fonctions for externals... More...
 
static hash_table already_seen_objects = NULL
 
static int number_of_domains = -1
 
static gen_tables DirectDomainsTable
 
static gen_tables DecisionTables
 
static struct multi_recursecurrent_mrc = (struct multi_recurse *) NULL
 the current multi recurse driver. More...
 

Macro Definition Documentation

◆ CHECK_NULL

#define CHECK_NULL (   obj,
  bp,
  dr 
)     if((obj)==gen_chunk_undefined) {(*(dr)->null)(bp) ; return ;}

To be called on any object pointer.

Definition at line 380 of file genClib.c.

◆ COPYABLE_DOMAIN

#define COPYABLE_DOMAIN (   d)
Value:
( d->ba.type != BASIS_DT || \
(!(IS_INLINABLE(d->ba.constructand) && (*d->ba.constructand->name!='s')) && \
!IS_TABULATED( d->ba.constructand )))
#define IS_INLINABLE(bp)
Different kinds of BINDING structure pointers.
@ BASIS_DT
#define IS_TABULATED(bp)

COPY_OBJ_OUT achieves to update the new object (copy of the old one) once all sub-domains have been recursively copied.

Definition at line 1299 of file genClib.c.

◆ decision_table_undefined

#define decision_table_undefined   ((char)25)

GLOBAL VARIABLES: to deal with decision tables.

number_of_domains: the number of domains managed by newgen, max is MAX_DOMAIN.

DirectDomainsTable: DirectDomainsTable[domain_1, domain_2] is true if domain_2 may contains directly a domain_1 field.

DecisionTables: DecisionTables[domain] is the decision table to scan domain. They are to be computed/set up after specifications' load. A demand driven approach is implemented.

Definition at line 2853 of file genClib.c.

◆ FIRST_SEEN

#define FIRST_SEEN (   s)    ((s)>=first_seen && (s)<first_seen+MAX_SHARED_OBJECTS)

Definition at line 637 of file genClib.c.

◆ gen_alloc_component

#define gen_alloc_component (   dp,
  cp,
  ap,
  gen_check_p 
)

gen_alloc_component updates the gen_chunk CP from the arg list AP according to the domain DP.

It is now a macro to be able to update the va_list ap from gen_alloc_constructed and respect the C norm. It should work both on x86 and x86_64...

static void gen_alloc_component(union domain * dp, gen_chunk * cp, va_list ap, int gen_check_p)

Definition at line 198 of file genClib.c.

◆ GO

#define GO   (1)

Definition at line 48 of file genClib.c.

◆ MAX_GEN_TRAV_ENV

#define MAX_GEN_TRAV_ENV   100

GEN_TRAV_ENVS are stacked to allow recursive calls to GEN_TRAV_OBJ (cf.

GEN_RECURSE)

Definition at line 797 of file genClib.c.

◆ MAX_SHARED_OBJECTS

#define MAX_SHARED_OBJECTS   10000

These functions computes an hash table of object pointers (to be used to manage sharing when dealing with objects).

Definition at line 632 of file genClib.c.

Typedef Documentation

◆ gen_tables

typedef GenDecisionTableType gen_tables[MAX_DOMAIN]

Definition at line 2855 of file genClib.c.

◆ GenDecisionTableType

typedef char GenDecisionTableType[MAX_DOMAIN]

Definition at line 2854 of file genClib.c.

◆ GenFilterTableType

typedef GenFilterType GenFilterTableType[MAX_DOMAIN]

Definition at line 3084 of file genClib.c.

◆ GenFilterType

typedef bool(* GenFilterType) ()

Definition at line 3081 of file genClib.c.

◆ GenRewriteTableType

typedef GenRewriteType GenRewriteTableType[MAX_DOMAIN]

Definition at line 3085 of file genClib.c.

◆ GenRewriteType

typedef void(* GenRewriteType) ()

Definition at line 3082 of file genClib.c.

◆ gtt_p

typedef struct gtt_t * gtt_p

Function Documentation

◆ allocated_memory_already_seen_p()

static bool allocated_memory_already_seen_p ( gen_chunk obj)
static

true if obj was already seen in this recursion, and put it at true

Definition at line 2567 of file genClib.c.

2569 {
2570  if (hash_get(already_seen_objects, (char *)obj)==(char*)true)
2571  return true;
2572  hash_put(already_seen_objects, (char *)obj, (char *) true);
2573  return false;
2574 }
static hash_table already_seen_objects
Definition: genClib.c:2562
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364

References already_seen_objects, hash_get(), and hash_put().

Referenced by allocated_memory_leaf_in(), and allocated_memory_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allocated_memory_leaf_in()

static int allocated_memory_leaf_in ( obj  ,
bp   
)
static

manages EXTERNALS and INLINABLES

under approximation!

Definition at line 2579 of file genClib.c.

2582 {
2583  if (IS_INLINABLE(bp))
2584  {
2585  if (*bp->name=='s' && obj->s && !string_undefined_p(obj->s) &&
2587  current_size += strlen(obj->s) + 1; /* under approximation! */
2588 
2589  return !GO;
2590  }
2591 
2593  return false;
2594 
2595  if (IS_EXTERNAL(bp))
2596  {
2597  if (bp->domain->ex.allocated_memory)
2598  current_size += (*(bp->domain->ex.allocated_memory))(obj->s);
2599  else
2600  user("[gen_allocated_memory] warning: "
2601  "external with no allocated memory function\n");
2602 
2603  return false;
2604  }
2605 
2606  return true;
2607 }
#define GO
Definition: genClib.c:48
static bool allocated_memory_already_seen_p(gen_chunk *obj)
true if obj was already seen in this recursion, and put it at true
Definition: genClib.c:2567
static int current_size
returns the number of bytes allocated for a given structure may need additional fonctions for externa...
Definition: genClib.c:2561
#define IS_EXTERNAL(bp)
void user(char *,...)
External routines.
#define string_undefined_p(s)
Definition: newgen_types.h:41

References domain::allocated_memory, allocated_memory_already_seen_p(), current_size, gen_binding::domain, domain::ex, GO, IS_EXTERNAL, IS_INLINABLE, IS_TABULATED, gen_binding::name, gen_chunk::p, gen_chunk::s, string_undefined_p, and user().

Referenced by gen_allocated_memory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allocated_memory_obj_in()

static int allocated_memory_obj_in ( gen_chunk obj,
struct driver dr 
)
static

manages newgen objects and strings...

gen size is quite slow. should precompute sizes...

Definition at line 2612 of file genClib.c.

2615 {
2616  struct gen_binding *bp = &Domains[quick_domain_index(obj)];
2617 
2618  message_assert("argument not used", dr==dr);
2619 
2621  IS_TABULATED(bp) || IS_INLINABLE(bp))
2622  return !GO;
2623 
2624  /* gen size is quite slow. should precompute sizes...
2625  */
2626  current_size += sizeof(gen_chunk*)*gen_size(bp-Domains);
2627 
2628  return GO;
2629 }
int gen_size(int domain)
GEN_SIZE returns the size (in gen_chunks) of an object of type defined by the BP type.
Definition: genC.c:71
struct gen_binding Domains[MAX_DOMAIN]
in build.c
Definition: genspec_yacc.c:114
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
#define quick_domain_index(obj)
inlined version of domain_index.
A gen_chunk is used to store every object.
Definition: genC.h:58

References allocated_memory_already_seen_p(), current_size, Domains, gen_size(), GO, IS_INLINABLE, IS_TABULATED, message_assert, and quick_domain_index.

Referenced by gen_allocated_memory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allocated_memory_simple_in()

static int allocated_memory_simple_in ( gen_chunk obj,
union domain dp 
)
static

manages newgen simples (list, set, array)

!GO ???

just to avoid a gcc warning

Definition at line 2634 of file genClib.c.

2637 {
2638  if (dp->ba.persistant) return false;
2639 
2640  switch( dp->ba.type ) {
2641  case BASIS_DT:
2642  return( GO) ; /* !GO ??? */
2643  case LIST_DT:
2644  {
2645  list l = obj->l;
2646 
2647  if (l && !list_undefined_p(l))
2648  {
2650  return true;
2651  }
2652  else
2653  return false;
2654  }
2655  case SET_DT:
2656  {
2657  set s = obj->t;
2658 
2659  if (!set_undefined_p(s))
2660  {
2662  return true;
2663  }
2664  else
2665  return false;
2666  }
2667  case ARRAY_DT:
2668  {
2669  gen_chunk *p = obj->p;
2670 
2671  if (!array_undefined_p(p))
2672  {
2674  return true;
2675  }
2676  else
2677  return false;
2678  }
2679  default:
2680  break;
2681  }
2682 
2683  fatal("allocated_memory_simple_in: unknown type %s\n", i2a(dp->ba.type));
2684  return -1; /* just to avoid a gcc warning */
2685 }
static int array_own_allocated_memory(union domain *dp)
Definition: genClib.c:181
#define list_undefined_p(c)
Return if a list is undefined.
Definition: newgen_list.h:75
size_t list_own_allocated_memory(const list l)
Definition: list.c:158
char * i2a(int)
I2A (Integer TO Ascii) yields a string for a given Integer.
Definition: string.c:121
@ SET_DT
@ ARRAY_DT
@ LIST_DT
void fatal(char *,...)
int set_own_allocated_memory(const set)
Definition: set.c:423
#define set_undefined_p(s)
Definition: newgen_set.h:49
#define array_undefined_p(a)
Definition: newgen_types.h:104
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
int persistant
int type
EXTERNAL.
struct domain::@3 ba
struct cons * l
A pointer to a list element.
Definition: genC.h:66
set t
Definition: genC.h:67
union gen_chunk * p
Definition: genC.h:69

References ARRAY_DT, array_own_allocated_memory(), array_undefined_p, domain::ba, BASIS_DT, current_size, fatal(), GO, i2a(), gen_chunk::l, LIST_DT, list_own_allocated_memory(), list_undefined_p, gen_chunk::p, domain::persistant, SET_DT, set_own_allocated_memory(), set_undefined_p, gen_chunk::t, and domain::type.

Referenced by gen_allocated_memory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_own_allocated_memory()

static int array_own_allocated_memory ( union domain dp)
static

Definition at line 181 of file genClib.c.

182 {
183  return sizeof(gen_chunk)*array_size(dp->ar.dimensions);
184 }
union gen_chunk gen_chunk
A gen_chunk is used to store every object.
static int array_size(dim)
ARRAY_SIZE returns the number of elements in the array whose dimension list is DIM.
Definition: genClib.c:155
struct intlist * dimensions
struct domain::@6 ar

References domain::ar, array_size(), and domain::dimensions.

Referenced by allocated_memory_simple_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_size()

static int array_size ( dim  )
static

ARRAY_SIZE returns the number of elements in the array whose dimension list is DIM.

Definition at line 155 of file genClib.c.

157 {
158  int sz = 1 ;
159 
160  for( ; dim != NULL ; dim = dim->cdr )
161  sz *= dim->val ;
162 
163  return( sz ) ;
164 }

Referenced by array_own_allocated_memory(), common_region_translation(), dump_common_layout(), gen_copy_array(), gen_trav_simple(), gfc2pips_namespace(), init_array(), print_common_layout(), write_simple_in(), and zeroing_multiple_edges().

+ Here is the caller graph for this function:

◆ change_sign()

static void change_sign ( gen_chunk o)
static

Definition at line 1858 of file genClib.c.

1859 {
1860  if ((o+1)->i < 0) (o+1)->i = -((o+1)->i);
1861 }

Referenced by gen_write_tabulated().

+ Here is the caller graph for this function:

◆ check_sharing()

static bool check_sharing ( char *  p,
char *  type 
)
static

NOTREACHED

Definition at line 2475 of file genClib.c.

2476 {
2477  if (hash_get(pointers, p) != HASH_UNDEFINED_VALUE) {
2478  user("Sharing of %s detected on %p", type, p ) ;
2479  longjmp( env, 1 ) ;
2480  /* NOTREACHED*/
2481  }
2482  return( false ) ;
2483 }
static hash_table pointers
GEN_SHARING_P checks whether OBJ1 uses objects (except tabulated) or CONS cells that appear in OBJ2.
Definition: genClib.c:2472
static jmp_buf env
Definition: genClib.c:2473
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
Definition: newgen_hash.h:56

References env, hash_get(), HASH_UNDEFINED_VALUE, pointers, and user().

Referenced by sharing_obj_in(), and sharing_simple_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_hput()

static void copy_hput ( hash_table  t,
char *  k,
char *  v 
)
static

Definition at line 1070 of file genClib.c.

1074 {
1075  if( k != (char *) HASH_UNDEFINED_VALUE && k != (char *) NULL)
1076  hash_put(t, k, v) ;
1077 }

References hash_put(), and HASH_UNDEFINED_VALUE.

Referenced by copy_leaf_out(), copy_obj_in(), copy_simple_in(), and copy_simple_out().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_hsearch()

static gen_chunk* copy_hsearch ( gen_chunk key)
static

maps an object on its copy

special cases...

Definition at line 1053 of file genClib.c.

1054 {
1055  gen_chunk *p ;
1056 
1057  /* special cases... */
1058  if(!key || string_undefined_p((char*)key) ||
1059  key == (gen_chunk *)HASH_UNDEFINED_VALUE)
1060  return key;
1061 
1062  if ((p=(gen_chunk *)hash_get( copy_table, (char *)key ))==
1064  fatal( "[copy_hsearch] bad key: %p\n", key );
1065  }
1066  return(p);
1067 }
static hash_table copy_table
These functions are used to implement the copying of objects.
Definition: genClib.c:1050

References copy_table, fatal(), hash_get(), HASH_UNDEFINED_VALUE, and string_undefined_p.

Referenced by copy_obj_out(), copy_obj_out_constructed(), gen_copy_array(), gen_copy_list(), gen_copy_set(), and gen_local_copy_tree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_leaf_out()

static void copy_leaf_out ( obj  ,
bp   
)
static

COPY_LEAF_OUT manages external sub-domains.

warning: the test IS_EXTERNAL cannot be applied on an inlined sub-domain

Definition at line 1149 of file genClib.c.

1152 {
1153  if (IS_INLINABLE(bp))
1154  {
1155  if (*bp->name=='s' && obj->s && !string_undefined_p(obj->s) &&
1156  !hash_defined_p(copy_table, obj->s))
1157  copy_hput(copy_table, obj->s, strdup(obj->s));
1158 
1159  return;
1160  }
1161 
1162  if (IS_EXTERNAL(bp)) {
1163  if (bp->domain->ex.copy == NULL) {
1164  user("gen_copy_tree: uninitialized external type %s\n",
1165  bp->name) ;
1166  return ;
1167  }
1168  copy_hput(copy_table, obj->s, (*(bp->domain->ex.copy))(obj->s)) ;
1169  }
1170 }
static void copy_hput(hash_table t, char *k, char *v)
Definition: genClib.c:1070
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
Definition: hash.c:484
char * strdup()
return(s1)

References domain::copy, copy_hput(), copy_table, gen_binding::domain, domain::ex, hash_defined_p(), IS_EXTERNAL, IS_INLINABLE, gen_binding::name, return(), gen_chunk::s, strdup(), string_undefined_p, and user().

Referenced by gen_local_copy_tree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_obj_in()

static int copy_obj_in ( gen_chunk obj,
__attribute__((unused)) struct driver dr 
)
static

COPY_OBJ_IN duplicates an object if it has not already been seen (this migth happen with shared objects).

inlined sub-domains are copied by the call to memcpy. remaining sub-domains require further processing

if (shared_obj( obj, gen_null, gen_null )) return 0;

memory is allocated to duplicate the object referenced by obj

thus content is copied, thus no probleme with inlined and so and newgen domain number.

hash table copy_table is updated

Definition at line 1086 of file genClib.c.

1087 {
1088  struct gen_binding *bp = &Domains[quick_domain_index( obj ) ] ;
1089 
1090  /* if (shared_obj( obj, gen_null, gen_null )) return 0;*/
1091 
1092  if (!hash_defined_p(copy_table, (char*) obj))
1093  {
1094  /* memory is allocated to duplicate the object referenced by obj
1095  */
1096  gen_chunk *new_obj;
1097  int size = gen_size(bp-Domains)*sizeof(gen_chunk);
1098  new_obj = (gen_chunk *)alloc(size);
1099 
1100  /* thus content is copied, thus no probleme with inlined and so
1101  * and newgen domain number.
1102  */
1103  (void) memcpy((char *) new_obj, (char *) obj, size);
1104 
1105  /* hash table copy_table is updated
1106  */
1107  copy_hput(copy_table, (char *)obj, (char *)new_obj);
1108  return true;
1109  }
1110 
1111  return false;
1112 }
char * alloc(int size)
ALLOC is an "iron-clad" version of malloc(3).
Definition: build.c:501

References alloc(), copy_hput(), copy_table, Domains, gen_size(), hash_defined_p(), quick_domain_index, and gen_binding::size.

Referenced by gen_local_copy_tree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_obj_out()

static void copy_obj_out ( obj  ,
bp  ,
dr   
)
static

Definition at line 1361 of file genClib.c.

1365 {
1366  union domain *dp = bp->domain ;
1367  int data = 1+IS_TABULATED( bp ) ;
1368  gen_chunk *new_obj = copy_hsearch(obj) ;
1369 
1370  switch( dp->ba.type ) {
1371  case LIST_DT:
1372  case SET_DT:
1373  case ARRAY_DT:
1374  (new_obj+data)->p = copy_hsearch((obj+data)->p);
1375  break ;
1376  case CONSTRUCTED_DT:
1377  copy_obj_out_constructed( obj, bp, dp, data, new_obj, dr ) ;
1378  break ;
1379  default:
1380  fatal( "[copy_obj_out] Unknown type %s\n", i2a( dp->ba.type )) ;
1381  }
1382 }
static void copy_obj_out_constructed(gen_chunk *obj, struct gen_binding *bp, dp, data, new_obj, dr)
Definition: genClib.c:1305
static gen_chunk * copy_hsearch(gen_chunk *key)
maps an object on its copy
Definition: genClib.c:1053
@ CONSTRUCTED_DT
struct _newgen_struct_data_ * data
A DOMAIN union describes the structure of a user type.

References ARRAY_DT, domain::ba, CONSTRUCTED_DT, copy_hsearch(), copy_obj_out_constructed(), gen_binding::domain, fatal(), i2a(), IS_TABULATED, LIST_DT, SET_DT, and domain::type.

Referenced by gen_local_copy_tree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_obj_out_constructed()

static void copy_obj_out_constructed ( gen_chunk obj,
struct gen_binding bp,
dp  ,
data  ,
new_obj  ,
dr   
)
static

Definition at line 1305 of file genClib.c.

1312 {
1313  struct domainlist *dlp = dp->co.components ;
1314 
1315  message_assert("arguments not used", bp==bp && dr==dr);
1316 
1317  switch( dp->co.op ) {
1318  case AND_OP: {
1319  gen_chunk *cp ;
1320 
1321  for( cp = obj+data ; dlp != NULL ; cp++, dlp = dlp->cdr ) {
1322  if(COPYABLE_DOMAIN( dlp->domain)) {
1323  (new_obj+(cp-obj))->p = copy_hsearch(cp->p);
1324  }
1325  }
1326  break ;
1327  }
1328  case OR_OP: {
1329  int which = (obj+data)->i - dp->co.first ;
1330 
1331  for( ; dlp!=NULL && which ; which--,dlp=dlp->cdr ) {
1332  ;
1333  }
1334  if( dlp == NULL ){
1335  fatal("[copy_obj_out] Unknown tag %s\n", i2a( (obj+data)->i )) ;
1336  }
1337  if( COPYABLE_DOMAIN( dlp->domain )) {
1338  (new_obj+data+1)->p = copy_hsearch((obj+data+1)->p);
1339  }
1340  break ;
1341  }
1342  case ARROW_OP: {
1343  bool cp_domain = (COPYABLE_DOMAIN( dlp->domain )) ;
1344  bool cp_codomain = (COPYABLE_DOMAIN( dlp->cdr->domain )) ;
1345 
1346  (new_obj+data)->h = hash_table_make(hash_table_type((obj+data)->h), 0);
1347 
1348  HASH_MAP( k, v, {
1349  k = (cp_domain ? (char *)copy_hsearch( (gen_chunk *)k ) : k) ;
1350  v = (cp_codomain ? (char *)copy_hsearch( (gen_chunk *)v ) : v) ;
1351  hash_put((new_obj+data)->h, k, v ) ;
1352  }, (obj+data)->h ) ;
1353  break ;
1354  }
1355  default:
1356  fatal( "[copy_obj_out] Unknown op %s\n", i2a( dp->co.op )) ;
1357  }
1358 }
#define COPYABLE_DOMAIN(d)
COPY_OBJ_OUT achieves to update the new object (copy of the old one) once all sub-domains have been r...
Definition: genClib.c:1299
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
hash_key_type hash_table_type(hash_table htp)
returns the type of the hash_table.
Definition: hash.c:832
#define HASH_MAP(k, v, code, ht)
Definition: newgen_hash.h:60
@ ARROW_OP
@ OR_OP
@ AND_OP
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
Definition: sc_read.c:87

References AND_OP, ARROW_OP, domain::co, domain::components, copy_hsearch(), COPYABLE_DOMAIN, cp, fatal(), domain::first, HASH_MAP, hash_put(), hash_table_make(), hash_table_type(), i2a(), message_assert, domain::op, and OR_OP.

Referenced by copy_obj_out().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_simple_in()

static int copy_simple_in ( gen_chunk obj,
union domain dp 
)
static

Just check for defined simple domains.

persistent arcs are put as copy of themself...

just to avoid a gcc warning

Definition at line 1117 of file genClib.c.

1120 {
1121  bool persistence = dp->ba.persistant;
1122 
1123  /* persistent arcs are put as copy of themself...
1124  */
1125  if (persistence)
1126  copy_hput(copy_table, (char *) obj->p, (char *) obj->p);
1127 
1128  switch(dp->ba.type) {
1129  case BASIS_DT:
1130  return(!persistence);
1131  case LIST_DT:
1132  return(!persistence && obj->l!=list_undefined);
1133  case SET_DT:
1134  return(!persistence && obj->t!=set_undefined);
1135  case ARRAY_DT:
1136  return(!persistence && obj->p!=array_undefined);
1137  default:
1138  break;
1139  }
1140  fatal("copy_simple_in: unknown type %s\n", i2a(dp->ba.type));
1141 
1142  return(-1); /* just to avoid a gcc warning */
1143 }
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
#define set_undefined
Definition: newgen_set.h:48
#define array_undefined
ARRAY.
Definition: newgen_types.h:103

References ARRAY_DT, array_undefined, domain::ba, BASIS_DT, copy_hput(), copy_table, fatal(), i2a(), gen_chunk::l, LIST_DT, list_undefined, gen_chunk::p, domain::persistant, SET_DT, set_undefined, gen_chunk::t, and domain::type.

Referenced by gen_local_copy_tree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_simple_out()

static void copy_simple_out ( obj  ,
dp   
)
static

COPY_SIMPLE_OUT copies the spine of the list OBJ or the whole array (according to the type DP).

The components are copied by the recursive traversal functions

spine of the list is duplicated and hash table copy_table is updated

array is duplicated and hash table copy_table is updated

Definition at line 1271 of file genClib.c.

1274 {
1275  switch (dp->ba.type) {
1276  case LIST_DT:
1277  /* spine of the list is duplicated and hash table copy_table
1278  is updated */
1279  copy_hput(copy_table, (char *) (obj->l),
1280  (char *) gen_copy_list(obj->l, dp));
1281  break ;
1282  case SET_DT:
1283  copy_hput(copy_table, (char *) (obj->t),
1284  (char *) gen_copy_set(obj->t, dp));
1285  break ;
1286  case ARRAY_DT:
1287  /* array is duplicated and hash table copy_table is updated */
1288  copy_hput(copy_table, (char *)obj->p,
1289  (char *)gen_copy_array(obj->p, dp));
1290  break ;
1291  default:
1292  break;
1293  }
1294 }
static gen_chunk * gen_copy_array(gen_chunk *old_a, dp)
GEN_COPY_ARRAY duplicates an array.
Definition: genClib.c:1222
static list gen_copy_list(list old_l, union domain *dp)
GEN_COPY_LIST duplicates cons cells.
Definition: genClib.c:1179
static set gen_copy_set(set old_s, dp)
GEN_COPY_SET duplicates a set.
Definition: genClib.c:1247

References ARRAY_DT, domain::ba, copy_hput(), copy_table, gen_copy_array(), gen_copy_list(), gen_copy_set(), gen_chunk::l, LIST_DT, gen_chunk::p, SET_DT, gen_chunk::t, and domain::type.

Referenced by gen_local_copy_tree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ current_shared_obj_table_size()

int current_shared_obj_table_size ( void  )

returns the number of byte allocated for obj_table.

for debug

for FI and debugging purposes... FC

Definition at line 654 of file genClib.c.

655 {
657 }
static hash_table obj_table
The OBJ_TABLE maps objects to addresses within the arrays FIRST_SEEN and SEEN_ONCE.
Definition: genClib.c:648
int hash_table_own_allocated_memory(hash_table htp)
Definition: hash.c:869

References hash_table_own_allocated_memory(), and obj_table.

Referenced by rice_dependence_graph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defined_null()

static void defined_null ( struct gen_binding bp)
static

GEN_DEFINED_P checks that the OBJect is fully defined.

Definition at line 2429 of file genClib.c.

2430 {
2431  union domain *dp = bp->domain ;
2432  user( "", (char *)NULL ) ;
2433  (void) fprintf( stderr, "gen_defined_p: Undefined object of type < " );
2434  print_domain( stderr, dp ) ;
2435  (void) fprintf( stderr, "> found\n" ) ;
2436 }
void print_domain(FILE *out, union domain *dp)
PRINT_DOMAIN prints on the OUT stream a domain denoted by the DP pointer.
Definition: build.c:294
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
union domain * domain

References gen_binding::domain, fprintf(), print_domain(), and user().

Referenced by gen_defined_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ first_available()

static int first_available ( int  t[MAX_DOMAIN])
static

Definition at line 2007 of file genClib.c.

2008 {
2009  int i;
2010  for (i=0; i<MAX_DOMAIN; i++)
2011  if (t[i] == -1) return i;
2012  return -1;
2013 }
#define MAX_DOMAIN
MAX_DOMAIN is the maximum number of entries in the DOMAINS table.

References MAX_DOMAIN.

Referenced by gtt_read().

+ Here is the caller graph for this function:

◆ fprintf_spaces()

static void fprintf_spaces ( fd  ,
number   
)
static

FPRINTF_SPACES prints NUMBER spaces on the FD file descriptor.

`

limited indentation

Definition at line 118 of file genClib.c.

121 {
122  number = number<0 ? 0 : number;
123  number = number<40 ? number : 40; /* limited indentation */
124  for(; number ; number-- )
125  (void) fprintf( fd, " " ) ;
126 }

References fprintf().

Referenced by gen_trav_leaf(), gen_trav_obj(), and gen_trav_simple().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fputci()

static void fputci ( char  c,
int  i,
FILE *  f 
)
static

Definition at line 1492 of file genClib.c.

1493 {
1494  putc(c, f);
1495  fputi(i, f);
1496 }
static void fputi(int i, FILE *f)
Definition: genClib.c:1487
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15

References f(), and fputi().

Referenced by write_define_shared_node(), write_leaf_in(), write_obj_in(), write_shared_node(), and write_simple_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fputi()

static void fputi ( int  i,
FILE *  f 
)
static

Definition at line 1487 of file genClib.c.

1488 {
1489  fprintf(f, "%d ", i);
1490 }

References f(), and fprintf().

Referenced by fputci(), gen_write(), gen_write_tabulated(), write_array_leaf(), write_leaf_in(), and write_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_already_seen_p()

static bool free_already_seen_p ( gen_chunk obj)
static

else seen for next time !

Definition at line 851 of file genClib.c.

853 {
854  message_assert("hash_table defined", free_already_seen);
855 
856  if (hash_get(free_already_seen, (char *)obj)==(char*)true)
857  return true;
858  /* else seen for next time !
859  */
860  hash_put(free_already_seen, (char *)obj, (char *) true);
861  return false;
862 }
static __thread hash_table free_already_seen
These functions are used to implement the freeing of objects.
Definition: genClib.c:848

References free_already_seen, hash_get(), hash_put(), and message_assert.

Referenced by free_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_leaf_in()

static int free_leaf_in ( gen_chunk obj,
struct gen_binding bp 
)
static

A tabulated domain BP prohibits its OBJ to be recursively freed.

&& !free_already_seen_p(obj)

???

Definition at line 867 of file genClib.c.

868 {
869  message_assert("argument not used", obj==obj);
870  return !IS_TABULATED(bp)/* && !free_already_seen_p(obj) */; /* ??? */
871 }

References IS_TABULATED, and message_assert.

Referenced by gen_free().

+ Here is the caller graph for this function:

◆ free_leaf_out()

static void free_leaf_out ( obj  ,
bp   
)
static

FREE_LEAF_OUT manages external types.

is it a string with some allocated value?

Definition at line 876 of file genClib.c.

879 {
880  if( IS_INLINABLE(bp )) {
881  /* is it a string with some allocated value? */
882  if( *bp->name == 's' && obj->s && !string_undefined_p(obj->s))
883  newgen_free(obj->s);
884  return ;
885  }
886  else
887  if( IS_EXTERNAL( bp )) {
888  if( bp->domain->ex.free == NULL ) {
889  user( "gen_free: uninitialized external type %s\n",
890  bp->name ) ;
891  return ;
892  }
893  (*(bp->domain->ex.free))( obj->s ) ;
894  }
895 }
#define newgen_free(p)

References gen_binding::domain, domain::ex, domain::free, IS_EXTERNAL, IS_INLINABLE, gen_binding::name, newgen_free, return(), gen_chunk::s, string_undefined_p, and user().

Referenced by gen_free().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_obj_in()

static int free_obj_in ( gen_chunk obj,
struct driver dr 
)
static

Definition at line 971 of file genClib.c.

972 {
973  int notseen = !free_already_seen_p(obj);
974 
975  message_assert("argument not used", dr==dr);
976 
977  if (notseen)
978  {
979  struct gen_binding * bp = Domains+obj->i;
980  if (IS_TABULATED(bp))
981  {
983  }
984  }
985 
986  return notseen;
987 }
static bool free_already_seen_p(gen_chunk *obj)
Definition: genClib.c:851
void gen_clear_tabulated_element(gen_chunk *obj)
GEN_CLEAR_TABULATED_ELEMENT only clears the entry for object OBJ in the gen_tabulated_ and gen_tabula...
Definition: tabulated.c:251
_int i
Definition: genC.h:62

References Domains, free_already_seen_p(), gen_clear_tabulated_element(), gen_chunk::i, IS_TABULATED, and message_assert.

Referenced by gen_free().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_obj_out()

static void free_obj_out ( gen_chunk obj,
struct gen_binding bp,
struct driver dr 
)
static

FREE_OBJ_OUT just frees the object OBJ.

static gen_chunk freed_gen_chunk ;

shouldn't this be done by hash_table_free ?

gen_free_area(obj->p, SIZE NOT DIRECTLY AVAILABLE);

Definition at line 922 of file genClib.c.

926 {
927  union domain *dp ;
928 
929  message_assert("argument not used", dr==dr);
930 
931  if((dp=bp->domain)->ba.type == CONSTRUCTED_DT && dp->co.op == ARROW_OP) {
932  hash_table h = (obj+1 + IS_TABULATED( bp ))->h ;
933 
934  /* shouldn't this be done by hash_table_free ? */
935  HASH_MAP( k, v, {
936  newgen_free( (void *)k ) ;
937  newgen_free( (void *)v ) ;
938  }, h ) ;
939  hash_table_free( h ) ;
940  }
941 
942  obj->p = NEWGEN_FREED;
943  /* gen_free_area(obj->p, SIZE NOT DIRECTLY AVAILABLE); */
944  newgen_free((void *) obj) ;
945 }
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
Definition: hash.c:327
#define NEWGEN_FREED
enum domain_operator op
struct domain::@7 co

References ARROW_OP, domain::co, CONSTRUCTED_DT, gen_binding::domain, HASH_MAP, hash_table_free(), IS_TABULATED, message_assert, newgen_free, NEWGEN_FREED, domain::op, and gen_chunk::p.

Referenced by gen_free().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_simple_out()

static void free_simple_out ( gen_chunk obj,
union domain dp 
)
static

FREE_SIMPLE_OUT frees the spine of the list OBJ or the whole array (according to the type DP).

The components are (obviously ?) freed by the recursive traversal functions (I said it once ... and for all).

??? where is the size of the array?

Definition at line 901 of file genClib.c.

902 {
903  switch( dp->ba.type ) {
904  case LIST_DT:
905  gen_free_list( obj->l ) ;
906  break ;
907  case SET_DT:
908  set_free( obj->t ) ;
909  break ;
910  case ARRAY_DT:
911  /* ??? where is the size of the array? */
912  newgen_free( (char *) obj->p ) ;
913  break ;
914  default:
915  break;
916  }
917 }
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
void set_free(set)
Definition: set.c:332

References ARRAY_DT, domain::ba, gen_free_list(), gen_chunk::l, LIST_DT, newgen_free, gen_chunk::p, SET_DT, set_free(), gen_chunk::t, and domain::type.

Referenced by gen_free().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_alloc()

gen_chunk* gen_alloc ( int  size,
int  gen_check_p,
int  dom,
  ... 
)

allocates something in newgen.

Definition at line 298 of file genClib.c.

299 {
300  va_list ap;
301  union domain * dp;
302  struct gen_binding * bp;
303  gen_chunk * cp;
304  int data;
305 
306  message_assert("gen_check_p parameter value ok",
307  gen_check_p==0 || gen_check_p==1);
308 
310 
311  va_start(ap, dom);
312 
313  cp = (gen_chunk *) alloc(size) ;
314  message_assert("allocated pointer", cp);
315 
316  // zero all bytes...
317  // I guess it must be an integral number of pointers, but just in case...
318  char * p = (char *) cp;
319  int i;
320  for (i=0; i<size; i++)
321  p[i] = '\0';
322 
323  // now initialize contents
324  cp->i = dom;
325 
326  bp = &Domains[dom];
327  data = 1 + IS_TABULATED( bp );
328 
329  switch( (dp = bp->domain)->ba.type ) {
330  case LIST_DT:
331  (cp+data)->l = va_arg( ap, cons *) ;
332  break ;
333  case SET_DT:
334  (cp+data)->t = va_arg( ap, set) ;
335  break ;
336  case ARRAY_DT:
337  if( ((cp+data)->p = va_arg( ap, gen_chunk *)) == NULL ) {
338  (cp+data)->p = init_array( dp ) ;
339  }
340  break ;
341  case CONSTRUCTED_DT:
342  gen_alloc_constructed( ap, bp, dp, cp, data, gen_check_p ) ;
343  break ;
344  default:
345  fatal( "gen_alloc: Unknown type %s\n", i2a( dp->ba.type )) ;
346  }
347 
348  if (IS_TABULATED(bp))
349  gen_enter_tabulated(dom, (cp+HASH_OFFSET)->s, cp, false);
350 
351  va_end( ap ) ;
352 
353  return cp;
354 }
static gen_chunk * init_array(union domain *dp)
INIT_ARRAY returns a freshly allocated array initialized according to the information in its domain D...
Definition: genClib.c:169
static void gen_alloc_constructed(va_list ap, struct gen_binding *bp, union domain *dp, gen_chunk *cp, int data, int gen_check_p)
GEN_ALLOC allocates SIZE bytes to implement an object whose TYPE is the index in the Domains table.
Definition: genClib.c:249
#define check_read_spec_performed()
#define HASH_OFFSET
For tabulated objects, the offset HASH_OFFSET of the hashed subdomain.
gen_chunk * gen_enter_tabulated(int, char *, gen_chunk *, bool)
ENTER_TABULATED_DEF enters a new definition (previous refs are allowed if ALLOW_REF) in the INDEX tab...
Definition: tabulated.c:279

References alloc(), ARRAY_DT, domain::ba, check_read_spec_performed, CONSTRUCTED_DT, cp, gen_binding::domain, Domains, fatal(), gen_alloc_constructed(), gen_enter_tabulated(), HASH_OFFSET, i2a(), init_array(), IS_TABULATED, LIST_DT, message_assert, SET_DT, gen_binding::size, and domain::type.

Referenced by make_abc_checked(), make_action(), make_action_kind(), make_alias_association(), make_alias_associations(), make_align(), make_alignmap(), make_alignment(), make_application(), make_approximation(), make_area(), make_array_dimension_checked(), make_assignment(), make_atom(), make_attachee(), make_attachment(), make_attachments(), make_basic(), make_bdt(), make_bound_pair(), make_c_parser_context(), make_call(), make_call_site(), make_callees(), make_cast(), make_cell(), make_cell_interpretation(), make_cell_relation(), make_cell_relations(), make_chain(), make_clone_context(), make_code(), make_communication(), make_comp_desc(), make_comp_desc_set(), make_comp_sec(), make_complexity(), make_conditional(), make_cone(), make_conflict(), make_constant(), make_context_info(), make_control(), make_controlmap(), make_dad_struct(), make_dag(), make_dagvtx(), make_data(), make_data_status(), make_database(), make_dataflow(), make_dataval(), make_datavar(), make_db_owned_resources(), make_db_resource(), make_db_resources(), make_db_status(), make_db_symbol(), make_descriptor(), make_dfg_arc_label(), make_dfg_vertex_label(), make_dg_arc_label(), make_dg_vertex_label(), make_dimension(), make_dimension_checked(), make_distribute(), make_distributemap(), make_distribution(), make_dummy(), make_dynamic_check(), make_dynamic_status(), make_effect(), make_effects(), make_effects_classes(), make_entities(), make_entity(), make_entity_effects(), make_entity_entities(), make_entity_int(), make_entity_status(), make_entity_task_buffers(), make_entity_to_entity(), make_entitymap(), make_equivalences(), make_evaluation(), make_execution(), make_expression(), make_expressionwithlevel(), make_extension(), make_extensions(), make_forloop(), make_formal(), make_function(), make_functional(), make_gap(), make_gexpression(), make_graph(), make_hpf_newdecl(), make_hpf_newdecls(), make_hpfc_reductions(), make_hpfc_status(), make_ifcount(), make_instruction(), make_interpreted_cell(), make_interval_vertex_label(), make_language(), make_leaf_label(), make_lexpressionwithlevel(), make_lisp_expression(), make_loop(), make_makefile(), make_map_effect_bool(), make_map_effect_step_point(), make_map_entity_int(), make_match(), make_matchTree(), make_matchTreeSons(), make_memory_mapping(), make_message(), make_mode(), make_multitest(), make_newdeclmap(), make_normalized(), make_numbers_status(), make_opcode(), make_opcodeClass(), make_operator_id_tree(), make_overlap(), make_overlapsmap(), make_owner(), make_parameter(), make_path_selector(), make_path_selectors(), make_pattern(), make_patternArg(), make_patternx(), make_persistant_expression_to_effects(), make_persistant_expression_to_entity(), make_persistant_statement_to_cluster(), make_persistant_statement_to_control(), make_persistant_statement_to_int(), make_persistant_statement_to_statement(), make_placement(), make_plc(), make_points_to(), make_points_to_graph(), make_points_to_list(), make_pragma(), make_predicate(), make_preference(), make_property(), make_pstatement(), make_pstatement_reductions(), make_qualifier(), make_quast(), make_quast_leaf(), make_quast_value(), make_ram(), make_range(), make_rangecount(), make_real_resource(), make_recursive_selector(), make_reduced_loops(), make_reduction(), make_reduction_operator(), make_reductionInfo(), make_reductions(), make_ref_temp(), make_reference(), make_remapping(), make_renaming(), make_resource(), make_rtype(), make_rule(), make_scc(), make_sccflags(), make_sccs(), make_schedule(), make_sentence(), make_sequence(), make_sesam_buffers_processing_context(), make_sexpression(), make_simdstatement(), make_simple_section(), make_sizeofexpression(), make_statement(), make_statement_cell_relations(), make_statement_effects(), make_statement_entities(), make_statement_points_to(), make_statement_renamings(), make_statement_task(), make_static_control(), make_status(), make_step_clause(), make_step_comm(), make_step_directive(), make_step_directives(), make_step_point(), make_storage(), make_style(), make_subscript(), make_successor(), make_symbolic(), make_synchronization(), make_syntax(), make_task(), make_task_buffers(), make_test(), make_text(), make_tiling(), make_transformation(), make_transformer(), make_type(), make_ubs(), make_ubs_check(), make_unformatted(), make_unstructured(), make_value(), make_var_val(), make_varcount(), make_variable(), make_vertex(), make_virtual_resource(), make_vtxcontent(), make_whileloop(), make_word_to_attachments(), and pipsdbm_read_statement_function().

+ Here is the call graph for this function:

◆ gen_alloc_constructed()

static void gen_alloc_constructed ( va_list  ap,
struct gen_binding bp,
union domain dp,
gen_chunk cp,
int  data,
int  gen_check_p 
)
static

GEN_ALLOC allocates SIZE bytes to implement an object whose TYPE is the index in the Domains table.

A fairly sophisticated initialization process is run, namely arrays are filled with undefineds.

Definition at line 249 of file genClib.c.

255 {
256  struct domainlist * dlp;
257 
258  message_assert("gen_check_p parameter value ok",
259  gen_check_p==0 || gen_check_p==1);
260 
261  switch( dp->co.op ) {
262  case AND_OP : {
263  gen_chunk *cpp ;
264 
265  for( dlp=dp->co.components, cpp=cp+data ;
266  dlp != NULL ;
267  dlp=dlp->cdr, cpp++ ) {
268  gen_alloc_component( dlp->domain, cpp, ap, gen_check_p ) ;
269  }
270  break ;
271  }
272  case OR_OP: {
273  int which ;
274 
275  (cp+data)->i = va_arg( ap, int ) ;
276  which = (cp+data)->i - dp->co.first ;
277 
278  for( dlp=dp->co.components; dlp!=NULL && which ;dlp=dlp->cdr ){
279  which-- ;
280  }
281  if( dlp == NULL ) {
282  user( "gen_alloc: unknown tag for type %s\n", bp->name ) ;
283  }
284  gen_alloc_component( dlp->domain, cp+data+1, ap, gen_check_p ) ;
285  break ;
286  }
287  case ARROW_OP: {
288  (cp+data)->h = hash_table_make( hash_chunk, 0 ) ;
289  break ;
290  }
291  default:
292  fatal( "gen_alloc: Unknown op %s\n", i2a( dp->co.op )) ;
293  }
294 }
#define gen_alloc_component(dp, cp, ap, gen_check_p)
gen_alloc_component updates the gen_chunk CP from the arg list AP according to the domain DP.
Definition: genClib.c:198
@ hash_chunk
Definition: newgen_hash.h:32
struct domainlist * components

References AND_OP, ARROW_OP, domain::co, domain::components, cp, fatal(), domain::first, gen_alloc_component, hash_chunk, hash_table_make(), i2a(), message_assert, gen_binding::name, domain::op, OR_OP, and user().

Referenced by gen_alloc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_allocated_memory()

int gen_allocated_memory ( gen_chunk obj)

re-entry is automatic for this function.

in bytes

save current status

build driver for gen_trav...

recursion from obj

restores status and returns result

Definition at line 2690 of file genClib.c.

2692 {
2693  bool first_on_stack = (already_seen_objects==NULL);
2694  int result, saved_size;
2695  struct driver dr;
2696 
2697  /* save current status
2698  */
2699  saved_size = current_size;
2700  current_size = 0;
2701  if (first_on_stack)
2703 
2704  /* build driver for gen_trav...
2705  */
2706  dr.null = gen_null,
2707  dr.leaf_in = allocated_memory_leaf_in,
2708  dr.leaf_out = gen_null,
2709  dr.simple_in = allocated_memory_simple_in,
2710  dr.array_leaf = gen_array_leaf,
2711  dr.simple_out = gen_null,
2712  dr.obj_in = allocated_memory_obj_in,
2713  dr.obj_out = gen_null;
2714 
2715  /* recursion from obj
2716  */
2717  gen_trav_obj(obj, &dr);
2718 
2719  /* restores status and returns result
2720  */
2721  result = current_size;
2722  current_size = saved_size;
2723  if (first_on_stack)
2724  {
2726  already_seen_objects = NULL;
2727  }
2728 
2729  return result;
2730 }
static int allocated_memory_simple_in(gen_chunk *obj, union domain *dp)
manages newgen simples (list, set, array)
Definition: genClib.c:2634
static void gen_array_leaf(struct gen_binding *bp, int i, gen_chunk *obj, struct driver *dr)
GEN_ARRAY_LEAF is the default recursive call to gen_trav_leaf.
Definition: genClib.c:494
static int allocated_memory_obj_in(gen_chunk *obj, struct driver *dr)
manages newgen objects and strings...
Definition: genClib.c:2612
static int allocated_memory_leaf_in(obj, bp)
manages EXTERNALS and INLINABLES
Definition: genClib.c:2579
static void gen_trav_obj()
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
@ hash_pointer
Definition: newgen_hash.h:32
The DRIVER structure is used to monitor the general function which traverses objects.
Definition: genClib.c:365

References allocated_memory_leaf_in(), allocated_memory_obj_in(), allocated_memory_simple_in(), already_seen_objects, driver::array_leaf, current_size, gen_array_leaf(), gen_null(), gen_trav_obj(), hash_pointer, hash_table_free(), hash_table_make(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, driver::simple_in, and driver::simple_out.

Referenced by initialize_newgen(), and rice_dependence_graph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_array_leaf()

static void gen_array_leaf ( struct gen_binding bp,
int  i,
gen_chunk obj,
struct driver dr 
)
static

GEN_ARRAY_LEAF is the default recursive call to gen_trav_leaf.

Definition at line 494 of file genClib.c.

499 {
500  if (gen_trav_stop_recursion) return;
501  message_assert("argument not used", i==i);
502  gen_trav_leaf( bp, obj, dr ) ;
503 }
static bool gen_trav_stop_recursion
Definition: genClib.c:384
static void gen_trav_leaf(struct gen_binding *bp, gen_chunk *obj, struct driver *dr)
set to true to stop...
Definition: genClib.c:390

References gen_trav_leaf(), gen_trav_stop_recursion, and message_assert.

Referenced by gen_allocated_memory(), gen_defined_p(), gen_free(), gen_internal_context_multi_recurse(), gen_local_copy_tree(), gen_sharing_p(), gen_write_without_sharing(), and shared_pointers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_check()

gen_chunk* gen_check ( gen_chunk obj,
int  t 
)

GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE.

Definition at line 2356 of file genClib.c.

2359 {
2360  extern int max_domain_index() ;
2361  int max_index ;
2362 
2363  if( obj == NULL ) {
2364  (void) user("gen_check: NULL pointer, expecting type %s\n",
2365  Domains[ t ].name);
2366  abort() ;
2367  }
2368  max_index = max_domain_index() ;
2369  message_assert("valid max domain index", max_index >= 0 ) ;
2370 
2371  if( obj != gen_chunk_undefined && t != obj->i ) {
2372  user("gen_check: Type clash (expecting %s, getting %s)\n",
2373  Domains[ t ].name,
2374  (obj->i >= 0 && obj->i<=max_index )? Domains[ obj->i ].name : "???") ;
2375  abort() ;
2376  }
2377  return obj;
2378 }
int max_domain_index()
Definition: build.c:181
#define gen_chunk_undefined
Definition: genC.h:74
#define abort()
Definition: misc-local.h:53

References abort, Domains, gen_chunk_undefined, gen_chunk::i, max_domain_index(), message_assert, gen_binding::name, and user().

Referenced by check_abc_checked(), check_action(), check_action_kind(), check_alias_association(), check_alias_associations(), check_align(), check_alignmap(), check_alignment(), check_application(), check_approximation(), check_area(), check_array_dimension_checked(), check_assignment(), check_atom(), check_attachee(), check_attachment(), check_attachments(), check_basic(), check_bdt(), check_bound_pair(), check_c_parser_context(), check_call(), check_call_site(), check_callees(), check_cast(), check_cell(), check_cell_interpretation(), check_cell_relation(), check_cell_relations(), check_chain(), check_clone_context(), check_code(), check_communication(), check_comp_desc(), check_comp_desc_set(), check_comp_sec(), check_complexity(), check_conditional(), check_cone(), check_conflict(), check_constant(), check_context_info(), check_control(), check_controlmap(), check_dad_struct(), check_dag(), check_dagvtx(), check_data(), check_data_status(), check_database(), check_dataflow(), check_dataval(), check_datavar(), check_db_owned_resources(), check_db_resource(), check_db_resources(), check_db_status(), check_db_symbol(), check_descriptor(), check_dfg_arc_label(), check_dfg_vertex_label(), check_dg_arc_label(), check_dg_vertex_label(), check_dimension(), check_dimension_checked(), check_distribute(), check_distributemap(), check_distribution(), check_dummy(), check_dynamic_check(), check_dynamic_status(), check_effect(), check_effects(), check_effects_classes(), check_entities(), check_entity(), check_entity_effects(), check_entity_entities(), check_entity_int(), check_entity_status(), check_entity_task_buffers(), check_entity_to_entity(), check_entitymap(), check_equivalences(), check_evaluation(), check_execution(), check_expression(), check_expressionwithlevel(), check_extension(), check_extensions(), check_forloop(), check_formal(), check_function(), check_functional(), check_gap(), check_gexpression(), check_graph(), check_hpf_newdecl(), check_hpf_newdecls(), check_hpfc_reductions(), check_hpfc_status(), check_ifcount(), check_instruction(), check_interpreted_cell(), check_interval_vertex_label(), check_language(), check_leaf_label(), check_lexpressionwithlevel(), check_lisp_expression(), check_loop(), check_makefile(), check_map_effect_bool(), check_map_effect_step_point(), check_map_entity_int(), check_match(), check_matchTree(), check_matchTreeSons(), check_memory_mapping(), check_message(), check_mode(), check_multitest(), check_newdeclmap(), check_normalized(), check_numbers_status(), check_opcode(), check_opcodeClass(), check_operator_id_tree(), check_overlap(), check_overlapsmap(), check_owner(), check_parameter(), check_path_selector(), check_path_selectors(), check_pattern(), check_patternArg(), check_patternx(), check_persistant_expression_to_effects(), check_persistant_expression_to_entity(), check_persistant_statement_to_cluster(), check_persistant_statement_to_control(), check_persistant_statement_to_int(), check_persistant_statement_to_statement(), check_placement(), check_plc(), check_points_to(), check_points_to_graph(), check_points_to_list(), check_pragma(), check_predicate(), check_preference(), check_property(), check_pstatement(), check_pstatement_reductions(), check_qualifier(), check_quast(), check_quast_leaf(), check_quast_value(), check_ram(), check_range(), check_rangecount(), check_real_resource(), check_recursive_selector(), check_reduced_loops(), check_reduction(), check_reduction_operator(), check_reductionInfo(), check_reductions(), check_ref_temp(), check_reference(), check_remapping(), check_renaming(), check_resource(), check_rtype(), check_rule(), check_scc(), check_sccflags(), check_sccs(), check_schedule(), check_sentence(), check_sequence(), check_sesam_buffers_processing_context(), check_sexpression(), check_simdstatement(), check_simple_section(), check_sizeofexpression(), check_statement(), check_statement_cell_relations(), check_statement_effects(), check_statement_entities(), check_statement_points_to(), check_statement_renamings(), check_statement_task(), check_static_control(), check_status(), check_step_clause(), check_step_comm(), check_step_directive(), check_step_directives(), check_step_point(), check_storage(), check_style(), check_subscript(), check_successor(), check_symbolic(), check_synchronization(), check_syntax(), check_task(), check_task_buffers(), check_test(), check_text(), check_tiling(), check_transformation(), check_transformer(), check_type(), check_ubs(), check_ubs_check(), check_unformatted(), check_unstructured(), check_value(), check_var_val(), check_varcount(), check_variable(), check_vertex(), check_virtual_resource(), check_vtxcontent(), check_whileloop(), check_word_to_attachments(), gen_trav_leaf(), generic_value_name(), and pips_user_value_name().

+ Here is the call graph for this function:

◆ gen_consistent_p()

int gen_consistent_p ( gen_chunk obj)

GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.

Definition at line 2398 of file genClib.c.

2399 {
2400  int old_gen_debug = gen_debug;
2402  open_black_hole();
2403 
2404  error_seen = 0 ;
2406 
2407  gen_write(black_hole, obj);
2408 
2409  gen_debug = old_gen_debug;
2411  return !error_seen;
2412 }
#define GEN_DBG_CHECK
Definition: genC.h:200
static FILE * black_hole
used for consistence checking...
Definition: genClib.c:2386
int error_seen
Have we seen a user error somewhere ?
Definition: build.c:76
int gen_debug
The debug flag can be changed by the user to check genClib code.
Definition: genClib.c:69
static void open_black_hole()
Definition: genClib.c:2387
static bool cumulated_error_seen
Definition: genClib.c:2394
void gen_write(FILE *fd, gen_chunk *obj)
GEN_WRITE writes the OBJect on the stream FD.
Definition: genClib.c:1745

References black_hole, check_read_spec_performed, cumulated_error_seen, error_seen, GEN_DBG_CHECK, gen_debug, gen_write(), and open_black_hole().

Referenced by abc_checked_consistent_p(), action_consistent_p(), action_kind_consistent_p(), alias_association_consistent_p(), alias_associations_consistent_p(), align_consistent_p(), alignmap_consistent_p(), alignment_consistent_p(), application_consistent_p(), approximation_consistent_p(), area_consistent_p(), array_dimension_checked_consistent_p(), assignment_consistent_p(), atom_consistent_p(), attachee_consistent_p(), attachment_consistent_p(), attachments_consistent_p(), basic_consistent_p(), bdsc_code_instrumentation(), bdt_consistent_p(), bound_pair_consistent_p(), c_parser_context_consistent_p(), call_consistent_p(), call_site_consistent_p(), callees_consistent_p(), cast_consistent_p(), cell_consistent_p(), cell_interpretation_consistent_p(), cell_relation_consistent_p(), cell_relations_consistent_p(), chain_consistent_p(), clone_context_consistent_p(), cluster_stage_spire(), cluster_stage_spire_generation(), code_consistent_p(), communication_consistent_p(), communications_construction(), comp_desc_consistent_p(), comp_desc_set_consistent_p(), comp_sec_consistent_p(), complexity_consistent_p(), conditional_consistent_p(), cone_consistent_p(), conflict_consistent_p(), constant_consistent_p(), context_info_consistent_p(), control_consistent_p(), controlmap_consistent_p(), dad_struct_consistent_p(), dag_consistent_p(), dagvtx_consistent_p(), data_consistent_p(), data_status_consistent_p(), database_consistent_p(), dataflow_consistent_p(), dataval_consistent_p(), datavar_consistent_p(), db_owned_resources_consistent_p(), db_resource_consistent_p(), db_resources_consistent_p(), db_status_consistent_p(), db_symbol_consistent_p(), descriptor_consistent_p(), dfg_arc_label_consistent_p(), dfg_vertex_label_consistent_p(), dg_arc_label_consistent_p(), dg_vertex_label_consistent_p(), dimension_checked_consistent_p(), dimension_consistent_p(), distribute_code(), distribute_consistent_p(), distributemap_consistent_p(), distribution_consistent_p(), dummy_consistent_p(), dynamic_check_consistent_p(), dynamic_status_consistent_p(), effect_consistent_p(), effects_classes_consistent_p(), effects_consistent_p(), entities_consistent_p(), entity_consistent_p(), entity_effects_consistent_p(), entity_entities_consistent_p(), entity_int_consistent_p(), entity_status_consistent_p(), entity_task_buffers_consistent_p(), entity_to_entity_consistent_p(), entitymap_consistent_p(), equivalences_consistent_p(), evaluation_consistent_p(), execution_consistent_p(), expression_consistent_p(), expressionwithlevel_consistent_p(), extension_consistent_p(), extensions_consistent_p(), forloop_consistent_p(), formal_consistent_p(), function_consistent_p(), functional_consistent_p(), gap_consistent_p(), gexpression_consistent_p(), graph_consistent_p(), hbdsc_parallelization(), hpf_newdecl_consistent_p(), hpf_newdecls_consistent_p(), hpfc_reductions_consistent_p(), hpfc_status_consistent_p(), ifcount_consistent_p(), instruction_consistent_p(), interpreted_cell_consistent_p(), interval_vertex_label_consistent_p(), language_consistent_p(), leaf_label_consistent_p(), lexpressionwithlevel_consistent_p(), lisp_expression_consistent_p(), loop_consistent_p(), makefile_consistent_p(), map_effect_bool_consistent_p(), map_effect_step_point_consistent_p(), map_entity_int_consistent_p(), match_consistent_p(), matchTree_consistent_p(), matchTreeSons_consistent_p(), memory_mapping_consistent_p(), message_consistent_p(), mode_consistent_p(), mpi_initialize(), mpi_task_generation(), multitest_consistent_p(), newdeclmap_consistent_p(), normalized_consistent_p(), numbers_status_consistent_p(), opcode_consistent_p(), opcodeClass_consistent_p(), operator_id_tree_consistent_p(), overlap_consistent_p(), overlapsmap_consistent_p(), owner_consistent_p(), parameter_consistent_p(), path_selector_consistent_p(), path_selectors_consistent_p(), pattern_consistent_p(), patternArg_consistent_p(), patternx_consistent_p(), persistant_expression_to_effects_consistent_p(), persistant_expression_to_entity_consistent_p(), persistant_statement_to_cluster_consistent_p(), persistant_statement_to_control_consistent_p(), persistant_statement_to_int_consistent_p(), persistant_statement_to_statement_consistent_p(), phrase_comEngine_distributor(), phrase_distributor(), phrase_distributor_control_code(), phrase_distributor_init(), pipsdbm_check_statement_mapping(), pipsdbm_consistent_statement_function(), placement_consistent_p(), plc_consistent_p(), points_to_consistent_p(), points_to_graph_consistent_p(), points_to_list_consistent_p(), pragma_consistent_p(), predicate_consistent_p(), preference_consistent_p(), property_consistent_p(), pstatement_consistent_p(), pstatement_reductions_consistent_p(), qualifier_consistent_p(), quast_consistent_p(), quast_leaf_consistent_p(), quast_value_consistent_p(), ram_consistent_p(), range_consistent_p(), rangecount_consistent_p(), real_resource_consistent_p(), recursive_selector_consistent_p(), reduced_loops_consistent_p(), reduction_consistent_p(), reduction_operator_consistent_p(), reductionInfo_consistent_p(), reductions_consistent_p(), ref_temp_consistent_p(), reference_consistent_p(), remapping_consistent_p(), renaming_consistent_p(), resource_consistent_p(), rtype_consistent_p(), rule_consistent_p(), safescale_distributor(), safescale_distributor_init(), scc_consistent_p(), sccflags_consistent_p(), sccs_consistent_p(), schedule_consistent_p(), sentence_consistent_p(), sequence_consistent_p(), sesam_buffers_processing_context_consistent_p(), sexpression_consistent_p(), simdstatement_consistent_p(), simple_section_consistent_p(), sizeofexpression_consistent_p(), spire_shared_unstructured_to_structured(), statement_cell_relations_consistent_p(), statement_consistent_p(), statement_effects_consistent_p(), statement_entities_consistent_p(), statement_points_to_consistent_p(), statement_renamings_consistent_p(), statement_task_consistent_p(), static_control_consistent_p(), status_consistent_p(), step_clause_consistent_p(), step_comm_consistent_p(), step_directive_consistent_p(), step_directives_consistent_p(), step_point_consistent_p(), storage_consistent_p(), style_consistent_p(), subscript_consistent_p(), successor_consistent_p(), symbolic_consistent_p(), synchronization_consistent_p(), syntax_consistent_p(), task_buffers_consistent_p(), task_consistent_p(), task_time_polynome(), test_consistent_p(), text_consistent_p(), tiling_consistent_p(), transformation_consistent_p(), transformer_consistent_p(), type_consistent_p(), ubs_check_consistent_p(), ubs_consistent_p(), unformatted_consistent_p(), unstructured_consistent_p(), value_consistent_p(), var_val_consistent_p(), varcount_consistent_p(), variable_consistent_p(), vertex_consistent_p(), virtual_resource_consistent_p(), void_gen_consistent_p(), vtxcontent_consistent_p(), whileloop_consistent_p(), and word_to_attachments_consistent_p().

+ Here is the call graph for this function:

◆ gen_copy_array()

static gen_chunk* gen_copy_array ( gen_chunk old_a,
dp   
)
static

GEN_COPY_ARRAY duplicates an array.

if array elements are inlinable, the old array is copied into the new one. if not, the new array must contain the objects that copy_table provides for the old objects contained in the old array. the second argument is the domain pointer of the old array

Definition at line 1222 of file genClib.c.

1225 {
1226  int i, size, inlinable;
1227  gen_chunk *new_a;
1228 
1229  size = array_size(dp->ar.dimensions);
1230  inlinable = IS_INLINABLE(dp->ar.element);
1231  new_a = (gen_chunk *) alloc( sizeof(gen_chunk)*size ) ;
1232 
1233  if (inlinable) {
1234  (void) memcpy((char *) new_a, (char *) old_a, size*sizeof(gen_chunk));
1235  }
1236  else {
1237  for (i = 0; i < size; i++) {
1238  new_a[i].p = copy_hsearch( old_a[i].p ) ;
1239  }
1240  }
1241  return(new_a);
1242 }
INLINE[] gives, for each inlinable (i.e., unboxed) type, its NAME, its initial VALUE and its printing...
Definition: build.c:45

References alloc(), domain::ar, array_size(), copy_hsearch(), domain::dimensions, domain::element, IS_INLINABLE, and gen_chunk::p.

Referenced by copy_simple_out().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_copy_list()

static list gen_copy_list ( list  old_l,
union domain dp 
)
static

GEN_COPY_LIST duplicates cons cells.

if list elements are inlinable, the old cell CARs are copied into the new ones. if not, the new cells must contain the objects that copy_table provides for the old objects contained in old cells. the second argument is the domain pointer of old list

else the items must also be copied

pc is linked to the new list

Definition at line 1179 of file genClib.c.

1182 {
1183  list old_p, new_p = NIL, new_l, pc;
1184  bool inlinable, persistant, tabulated;
1185 
1187  tabulated = IS_TABULATED(dp->li.element);
1188  persistant = dp->li.persistant;
1189  new_l = NIL;
1190 
1191  if (inlinable || persistant || tabulated)
1192  return gen_copy_seq(old_l);
1193 
1194  /* else the items must also be copied
1195  */
1196  for (old_p = old_l ; old_p != NIL ; old_p = old_p->cdr)
1197  {
1198  pc = (list)alloc(sizeof(struct cons)) ;
1199 
1200  pc->car.p = copy_hsearch(old_p->car.p) ;
1201  pc->cdr = NIL;
1202 
1203  /* pc is linked to the new list
1204  */
1205  if (new_l == NIL)
1206  new_l = pc;
1207  else
1208  new_p->cdr = pc;
1209  new_p = pc;
1210  }
1211 
1212  return new_l;
1213 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
struct cons * list
Definition: newgen_types.h:106
struct cons * cdr
The pointer to the next element.
Definition: newgen_list.h:43
gen_chunk car
The data payload of a list element.
Definition: newgen_list.h:42
struct gen_binding * element
struct domain::@4 li

References alloc(), cons::car, cons::cdr, copy_hsearch(), domain::element, gen_copy_seq(), IS_INLINABLE, IS_TABULATED, domain::li, NIL, gen_chunk::p, domain::persistant, and gen_binding::tabulated.

Referenced by copy_simple_out().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_copy_set()

static set gen_copy_set ( set  old_s,
dp   
)
static

GEN_COPY_SET duplicates a set.

Definition at line 1247 of file genClib.c.

1250 {
1251  set new_s = set_make( dp->se.what ) ;
1252 
1253  if( IS_INLINABLE( dp->se.element )) {
1254  set_assign( new_s, old_s ) ;
1255  }
1256  else {
1257  SET_MAP( elt, {
1258  gen_chunk *new = copy_hsearch( (gen_chunk *)elt );
1259 
1260  set_add_element( new_s, new_s, (char *)new ) ;
1261  }, old_s ) ;
1262  }
1263  return( new_s );
1264 }
#define SET_MAP(element, code, the_set)
Definition: newgen_set.h:54
set set_assign(set, const set)
Assign a set with the content of another set.
Definition: set.c:129
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152

References copy_hsearch(), domain::element, IS_INLINABLE, domain::se, set_add_element(), set_assign(), set_make(), SET_MAP, and domain::what.

Referenced by copy_simple_out().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_copy_tree()

gen_chunk* gen_copy_tree ( gen_chunk obj)

Definition at line 1429 of file genClib.c.

1431 {
1432  if (gen_chunk_undefined_p(obj))
1433  return gen_chunk_undefined;
1434  else
1435  return gen_local_copy_tree(obj, false);
1436 }
#define gen_chunk_undefined_p(c)
Definition: genC.h:75
static gen_chunk * gen_local_copy_tree(gen_chunk *obj, bool keep)
GEN_COPY_TREE makes a copy of the object OBJ.
Definition: genClib.c:1387

References gen_chunk_undefined, gen_chunk_undefined_p, and gen_local_copy_tree().

Referenced by copy_abc_checked(), copy_action(), copy_action_kind(), copy_alias_association(), copy_alias_associations(), copy_align(), copy_alignmap(), copy_alignment(), copy_application(), copy_approximation(), copy_area(), copy_array_dimension_checked(), copy_assignment(), copy_atom(), copy_attachee(), copy_attachment(), copy_attachments(), copy_basic(), copy_bdt(), copy_bound_pair(), copy_c_parser_context(), copy_call(), copy_call_site(), copy_callees(), copy_cast(), copy_cell(), copy_cell_interpretation(), copy_cell_relation(), copy_cell_relations(), copy_chain(), copy_clone_context(), copy_code(), copy_communication(), copy_comp_desc(), copy_comp_desc_set(), copy_comp_sec(), copy_complexity(), copy_conditional(), copy_cone(), copy_conflict(), copy_constant(), copy_context_info(), copy_control(), copy_controlmap(), copy_dad_struct(), copy_dag(), copy_dagvtx(), copy_data(), copy_data_status(), copy_database(), copy_dataflow(), copy_dataval(), copy_datavar(), copy_db_owned_resources(), copy_db_resource(), copy_db_resources(), copy_db_status(), copy_db_symbol(), copy_descriptor(), copy_dfg_arc_label(), copy_dfg_vertex_label(), copy_dg_arc_label(), copy_dg_vertex_label(), copy_dimension(), copy_dimension_checked(), copy_distribute(), copy_distributemap(), copy_distribution(), copy_dummy(), copy_dynamic_check(), copy_dynamic_status(), copy_effect(), copy_effects(), copy_effects_classes(), copy_entities(), copy_entity(), copy_entity_effects(), copy_entity_entities(), copy_entity_int(), copy_entity_status(), copy_entity_task_buffers(), copy_entity_to_entity(), copy_entitymap(), copy_equivalences(), copy_evaluation(), copy_execution(), copy_expression(), copy_expressionwithlevel(), copy_extension(), copy_extensions(), copy_forloop(), copy_formal(), copy_function(), copy_functional(), copy_gap(), copy_gexpression(), copy_graph(), copy_hpf_newdecl(), copy_hpf_newdecls(), copy_hpfc_reductions(), copy_hpfc_status(), copy_ifcount(), copy_instruction(), copy_interpreted_cell(), copy_interval_vertex_label(), copy_language(), copy_leaf_label(), copy_lexpressionwithlevel(), copy_lisp_expression(), copy_loop(), copy_makefile(), copy_map_effect_bool(), copy_map_effect_step_point(), copy_map_entity_int(), copy_match(), copy_matchTree(), copy_matchTreeSons(), copy_memory_mapping(), copy_message(), copy_mode(), copy_multitest(), copy_newdeclmap(), copy_normalized(), copy_numbers_status(), copy_opcode(), copy_opcodeClass(), copy_operator_id_tree(), copy_overlap(), copy_overlapsmap(), copy_owner(), copy_parameter(), copy_path_selector(), copy_path_selectors(), copy_pattern(), copy_patternArg(), copy_patternx(), copy_persistant_expression_to_effects(), copy_persistant_expression_to_entity(), copy_persistant_statement_to_cluster(), copy_persistant_statement_to_control(), copy_persistant_statement_to_int(), copy_persistant_statement_to_statement(), copy_placement(), copy_plc(), copy_points_to(), copy_points_to_graph(), copy_points_to_list(), copy_pragma(), copy_predicate(), copy_preference(), copy_property(), copy_pstatement(), copy_pstatement_reductions(), copy_qualifier(), copy_quast(), copy_quast_leaf(), copy_quast_value(), copy_ram(), copy_range(), copy_rangecount(), copy_real_resource(), copy_recursive_selector(), copy_reduced_loops(), copy_reduction(), copy_reduction_operator(), copy_reductionInfo(), copy_reductions(), copy_ref_temp(), copy_reference(), copy_remapping(), copy_renaming(), copy_resource(), copy_rtype(), copy_rule(), copy_scc(), copy_sccflags(), copy_sccs(), copy_schedule(), copy_sentence(), copy_sequence(), copy_sesam_buffers_processing_context(), copy_sexpression(), copy_simdstatement(), copy_simple_section(), copy_sizeofexpression(), copy_statement(), copy_statement_cell_relations(), copy_statement_effects(), copy_statement_entities(), copy_statement_points_to(), copy_statement_renamings(), copy_statement_task(), copy_static_control(), copy_status(), copy_step_clause(), copy_step_comm(), copy_step_directive(), copy_step_directives(), copy_step_point(), copy_storage(), copy_style(), copy_subscript(), copy_successor(), copy_symbolic(), copy_synchronization(), copy_syntax(), copy_task(), copy_task_buffers(), copy_test(), copy_text(), copy_tiling(), copy_transformation(), copy_transformer(), copy_type(), copy_ubs(), copy_ubs_check(), copy_unformatted(), copy_unstructured(), copy_value(), copy_var_val(), copy_varcount(), copy_variable(), copy_vertex(), copy_virtual_resource(), copy_vtxcontent(), copy_whileloop(), copy_word_to_attachments(), gen_full_copy_list(), and gfc2pips_code2instruction_().

+ Here is the call graph for this function:

◆ gen_copy_tree_with_sharing()

gen_chunk* gen_copy_tree_with_sharing ( gen_chunk obj)

for re-entry only in gen_copy_tree...

??? because externals are internals... FC.

Definition at line 1442 of file genClib.c.

1444 {
1445  return gen_local_copy_tree(obj, true);
1446 }

References gen_local_copy_tree().

Referenced by initialize_newgen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_defined_p()

int gen_defined_p ( gen_chunk obj)

Definition at line 2438 of file genClib.c.

2439 {
2440  struct driver dr ;
2441 
2443  open_black_hole();
2444 
2445  if (gen_chunk_undefined_p(obj))
2446  return false;
2447 
2448  error_seen = 0 ;
2449  dr.null = defined_null ;
2450  dr.leaf_out = gen_null ;
2451  dr.leaf_in = write_leaf_in ;
2452  dr.simple_in = write_simple_in ;
2453  dr.array_leaf = gen_array_leaf ;
2454  dr.simple_out = write_simple_out ;
2455  dr.obj_in = write_obj_in ;
2456  dr.obj_out = write_obj_out ;
2457  user_file = black_hole ;
2458 
2459  push_gen_trav_env() ;
2460 
2461  shared_pointers( obj, false ) ;
2462  gen_trav_obj( obj, &dr ) ;
2463 
2464  pop_gen_trav_env() ;
2465 
2466  return error_seen == 0;
2467 }
static void write_obj_out(gen_chunk *obj, struct gen_binding *bp, struct driver *dr)
WRITE_OBJ_OUT is done when the OBJect (of type BP) has been printed.
Definition: genClib.c:1560
static FILE * user_file
These functions implements the writing of objects.
Definition: genClib.c:1485
static int write_obj_in(gen_chunk *obj, struct driver *dr)
WRITE_OBJ_IN writes the OBJect of type BP.
Definition: genClib.c:1522
static int write_simple_in(obj, dp)
WRITE_SIMPLE_IN is done before printing a simple OBJect of type DP.
Definition: genClib.c:1668
static int write_leaf_in(gen_chunk *obj, struct gen_binding *bp)
WRITE_LEAF_IN prints the OBJect of type BP.
Definition: genClib.c:1612
static void push_gen_trav_env()
Definition: genClib.c:808
static void write_simple_out(gen_chunk *obj, union domain *dp)
WRITE_LEAF_OUT prints the closing parenthesis of (non-basis) simple OBJect of type DP.
Definition: genClib.c:1724
static void shared_pointers(obj, keep)
SHARED_POINTERS creates (in OBJ_TABLE) the association between objects and their numbers (!...
Definition: genClib.c:734
static void defined_null(struct gen_binding *bp)
GEN_DEFINED_P checks that the OBJect is fully defined.
Definition: genClib.c:2429
static void pop_gen_trav_env()
Definition: genClib.c:827

References driver::array_leaf, black_hole, check_read_spec_performed, defined_null(), error_seen, gen_array_leaf(), gen_chunk_undefined_p, gen_null(), gen_trav_obj(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, open_black_hole(), pop_gen_trav_env(), push_gen_trav_env(), shared_pointers(), driver::simple_in, driver::simple_out, user_file, write_leaf_in(), write_obj_in(), write_obj_out(), write_simple_in(), and write_simple_out().

Referenced by abc_checked_defined_p(), action_defined_p(), action_kind_defined_p(), alias_association_defined_p(), alias_associations_defined_p(), align_defined_p(), alignmap_defined_p(), alignment_defined_p(), application_defined_p(), approximation_defined_p(), area_defined_p(), array_dimension_checked_defined_p(), assignment_defined_p(), atom_defined_p(), attachee_defined_p(), attachment_defined_p(), attachments_defined_p(), basic_defined_p(), bdt_defined_p(), bound_pair_defined_p(), c_parser_context_defined_p(), call_defined_p(), call_site_defined_p(), callees_defined_p(), cast_defined_p(), cell_defined_p(), cell_interpretation_defined_p(), cell_relation_defined_p(), cell_relations_defined_p(), chain_defined_p(), clone_context_defined_p(), code_defined_p(), communication_defined_p(), comp_desc_defined_p(), comp_desc_set_defined_p(), comp_sec_defined_p(), complexity_defined_p(), conditional_defined_p(), cone_defined_p(), conflict_defined_p(), constant_defined_p(), context_info_defined_p(), control_defined_p(), controlmap_defined_p(), dad_struct_defined_p(), dag_defined_p(), dagvtx_defined_p(), data_defined_p(), data_status_defined_p(), database_defined_p(), dataflow_defined_p(), dataval_defined_p(), datavar_defined_p(), db_owned_resources_defined_p(), db_resource_defined_p(), db_resources_defined_p(), db_status_defined_p(), db_symbol_defined_p(), descriptor_defined_p(), dfg_arc_label_defined_p(), dfg_vertex_label_defined_p(), dg_arc_label_defined_p(), dg_vertex_label_defined_p(), dimension_checked_defined_p(), dimension_defined_p(), distribute_defined_p(), distributemap_defined_p(), distribution_defined_p(), dummy_defined_p(), dynamic_check_defined_p(), dynamic_status_defined_p(), effect_defined_p(), effects_classes_defined_p(), effects_defined_p(), entities_defined_p(), entity_defined_p(), entity_effects_defined_p(), entity_entities_defined_p(), entity_int_defined_p(), entity_status_defined_p(), entity_task_buffers_defined_p(), entity_to_entity_defined_p(), entitymap_defined_p(), equivalences_defined_p(), evaluation_defined_p(), execution_defined_p(), expression_defined_p(), expressionwithlevel_defined_p(), extension_defined_p(), extensions_defined_p(), forloop_defined_p(), formal_defined_p(), function_defined_p(), functional_defined_p(), gap_defined_p(), gexpression_defined_p(), graph_defined_p(), hpf_newdecl_defined_p(), hpf_newdecls_defined_p(), hpfc_reductions_defined_p(), hpfc_status_defined_p(), ifcount_defined_p(), instruction_defined_p(), interpreted_cell_defined_p(), interval_vertex_label_defined_p(), language_defined_p(), leaf_label_defined_p(), lexpressionwithlevel_defined_p(), lisp_expression_defined_p(), loop_defined_p(), makefile_defined_p(), map_effect_bool_defined_p(), map_effect_step_point_defined_p(), map_entity_int_defined_p(), match_defined_p(), matchTree_defined_p(), matchTreeSons_defined_p(), memory_mapping_defined_p(), message_defined_p(), mode_defined_p(), multitest_defined_p(), newdeclmap_defined_p(), normalized_defined_p(), numbers_status_defined_p(), opcode_defined_p(), opcodeClass_defined_p(), operator_id_tree_defined_p(), overlap_defined_p(), overlapsmap_defined_p(), owner_defined_p(), parameter_defined_p(), path_selector_defined_p(), path_selectors_defined_p(), pattern_defined_p(), patternArg_defined_p(), patternx_defined_p(), persistant_expression_to_effects_defined_p(), persistant_expression_to_entity_defined_p(), persistant_statement_to_cluster_defined_p(), persistant_statement_to_control_defined_p(), persistant_statement_to_int_defined_p(), persistant_statement_to_statement_defined_p(), placement_defined_p(), plc_defined_p(), points_to_defined_p(), points_to_graph_defined_p(), points_to_list_defined_p(), pragma_defined_p(), predicate_defined_p(), preference_defined_p(), property_defined_p(), pstatement_defined_p(), pstatement_reductions_defined_p(), qualifier_defined_p(), quast_defined_p(), quast_leaf_defined_p(), quast_value_defined_p(), ram_defined_p(), range_defined_p(), rangecount_defined_p(), real_resource_defined_p(), recursive_selector_defined_p(), reduced_loops_defined_p(), reduction_defined_p(), reduction_operator_defined_p(), reductionInfo_defined_p(), reductions_defined_p(), ref_temp_defined_p(), reference_defined_p(), remapping_defined_p(), renaming_defined_p(), resource_defined_p(), rtype_defined_p(), rule_defined_p(), scc_defined_p(), sccflags_defined_p(), sccs_defined_p(), schedule_defined_p(), sentence_defined_p(), sequence_defined_p(), sesam_buffers_processing_context_defined_p(), sexpression_defined_p(), simdstatement_defined_p(), simple_section_defined_p(), sizeofexpression_defined_p(), statement_cell_relations_defined_p(), statement_defined_p(), statement_effects_defined_p(), statement_entities_defined_p(), statement_points_to_defined_p(), statement_renamings_defined_p(), statement_task_defined_p(), static_control_defined_p(), status_defined_p(), step_clause_defined_p(), step_comm_defined_p(), step_directive_defined_p(), step_directives_defined_p(), step_point_defined_p(), storage_defined_p(), style_defined_p(), subscript_defined_p(), successor_defined_p(), symbolic_defined_p(), synchronization_defined_p(), syntax_defined_p(), task_buffers_defined_p(), task_defined_p(), test_defined_p(), text_defined_p(), tiling_defined_p(), transformation_defined_p(), transformer_defined_p(), type_defined_p(), ubs_check_defined_p(), ubs_defined_p(), unformatted_defined_p(), unstructured_defined_p(), value_defined_p(), var_val_defined_p(), varcount_defined_p(), variable_defined_p(), vertex_defined_p(), virtual_resource_defined_p(), vtxcontent_defined_p(), whileloop_defined_p(), and word_to_attachments_defined_p().

+ Here is the call graph for this function:

◆ gen_domain_name()

string gen_domain_name ( int  t)

GEN_DOMAIN_NAME returns the domain name, and may be used for debug purposes.

It should be a valid domain name.

FC 29/12/94

Definition at line 97 of file genClib.c.

98 {
99  check_domain(t);
100  return Domains[t].name;
101 }
#define check_domain(dom)

References check_domain, Domains, and gen_binding::name.

Referenced by set_glopriv(), and update_object_for_module().

+ Here is the caller graph for this function:

◆ gen_free()

void gen_free ( gen_chunk obj)

version without shared_pointers.

automatic re-entry allowed. FC.

reentry or not: whether the already_seen table is initialized or not...

Definition at line 992 of file genClib.c.

993 {
994  /* reentry or not: whether the already_seen table is initialized or not...
995  */
996  bool first_in_stack = (free_already_seen==(hash_table)NULL);
997  struct driver dr ;
998 
1000 
1001  dr.null = gen_null ;
1002  dr.leaf_out = free_leaf_out ;
1003  dr.leaf_in = free_leaf_in ;
1004  dr.obj_in = free_obj_in ;
1005  dr.simple_in = persistant_simple_in ;
1006  dr.array_leaf = gen_array_leaf ;
1007  dr.simple_out = free_simple_out ;
1008  dr.obj_out = free_obj_out ;
1009 
1010  if (first_in_stack)
1012 
1013  gen_trav_obj( obj, &dr ) ;
1014 
1015  if (first_in_stack)
1016  {
1018  free_already_seen = NULL;
1019  }
1020 }
static int free_leaf_in(gen_chunk *obj, struct gen_binding *bp)
A tabulated domain BP prohibits its OBJ to be recursively freed.
Definition: genClib.c:867
static void free_simple_out(gen_chunk *obj, union domain *dp)
FREE_SIMPLE_OUT frees the spine of the list OBJ or the whole array (according to the type DP).
Definition: genClib.c:901
static void free_obj_out(gen_chunk *obj, struct gen_binding *bp, struct driver *dr)
FREE_OBJ_OUT just frees the object OBJ.
Definition: genClib.c:922
static int free_obj_in(gen_chunk *obj, struct driver *dr)
Definition: genClib.c:971
static int persistant_simple_in(obj, dp)
GEN_LOCAL_FREE frees the object OBJ with or without KEEPing the sharing.
Definition: genClib.c:950
static void free_leaf_out(obj, bp)
FREE_LEAF_OUT manages external types.
Definition: genClib.c:876
struct __hash_table * hash_table
Define hash_table structure which is hidden.
Definition: newgen_hash.h:43

References driver::array_leaf, check_read_spec_performed, free_already_seen, free_leaf_in(), free_leaf_out(), free_obj_in(), free_obj_out(), free_simple_out(), gen_array_leaf(), gen_null(), gen_trav_obj(), hash_pointer, hash_table_free(), hash_table_make(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, persistant_simple_in(), driver::simple_in, and driver::simple_out.

Referenced by EvalBinaryOp(), EvalUnaryOp(), free_abc_checked(), free_action(), free_action_kind(), free_alias_association(), free_alias_associations(), free_align(), free_alignmap(), free_alignment(), free_application(), free_approximation(), free_area(), free_array_dimension_checked(), free_assignment(), free_atom(), free_attachee(), free_attachment(), free_attachments(), free_basic(), free_bdt(), free_bound_pair(), free_c_parser_context(), free_call(), free_call_site(), free_callees(), free_cast(), free_cell(), free_cell_interpretation(), free_cell_relation(), free_cell_relations(), free_chain(), free_clone_context(), free_code(), free_communication(), free_comp_desc(), free_comp_desc_set(), free_comp_sec(), free_complexity(), free_conditional(), free_cone(), free_conflict(), free_constant(), free_context_info(), free_control(), free_controlmap(), free_dad_struct(), free_dag(), free_dagvtx(), free_data(), free_data_status(), free_database(), free_dataflow(), free_dataval(), free_datavar(), free_db_owned_resources(), free_db_resource(), free_db_resources(), free_db_status(), free_db_symbol(), free_descriptor(), free_dfg_arc_label(), free_dfg_vertex_label(), free_dg_arc_label(), free_dg_vertex_label(), free_dimension(), free_dimension_checked(), free_distribute(), free_distributemap(), free_distribution(), free_dummy(), free_dynamic_check(), free_dynamic_status(), free_effect(), free_effects(), free_effects_classes(), free_entities(), free_entity(), free_entity_effects(), free_entity_entities(), free_entity_int(), free_entity_status(), free_entity_task_buffers(), free_entity_to_entity(), free_entitymap(), free_equivalences(), free_evaluation(), free_execution(), free_expression(), free_expressionwithlevel(), free_extension(), free_extensions(), free_forloop(), free_formal(), free_function(), free_functional(), free_gap(), free_gexpression(), free_graph(), free_hpf_newdecl(), free_hpf_newdecls(), free_hpfc_reductions(), free_hpfc_status(), free_ifcount(), free_instruction(), free_interpreted_cell(), free_interval_vertex_label(), free_language(), free_leaf_label(), free_lexpressionwithlevel(), free_lisp_expression(), free_loop(), free_makefile(), free_map_effect_bool(), free_map_effect_step_point(), free_map_entity_int(), free_match(), free_matchTree(), free_matchTreeSons(), free_memory_mapping(), free_message(), free_mode(), free_multitest(), free_newdeclmap(), free_normalized(), free_numbers_status(), free_opcode(), free_opcodeClass(), free_operator_id_tree(), free_overlap(), free_overlapsmap(), free_owner(), free_parameter(), free_path_selector(), free_path_selectors(), free_pattern(), free_patternArg(), free_patternx(), free_persistant_expression_to_effects(), free_persistant_expression_to_entity(), free_persistant_statement_to_cluster(), free_persistant_statement_to_control(), free_persistant_statement_to_int(), free_persistant_statement_to_statement(), free_placement(), free_plc(), free_points_to(), free_points_to_graph(), free_points_to_list(), free_pragma(), free_predicate(), free_preference(), free_property(), free_pstatement(), free_pstatement_reductions(), free_qualifier(), free_quast(), free_quast_leaf(), free_quast_value(), free_ram(), free_range(), free_rangecount(), free_real_resource(), free_recursive_selector(), free_reduced_loops(), free_reduction(), free_reduction_operator(), free_reductionInfo(), free_reductions(), free_ref_temp(), free_reference(), free_remapping(), free_renaming(), free_resource(), free_rtype(), free_rule(), free_scc(), free_sccflags(), free_sccs(), free_schedule(), free_sentence(), free_sequence(), free_sesam_buffers_processing_context(), free_sexpression(), free_simdstatement(), free_simple_section(), free_sizeofexpression(), free_statement(), free_statement_cell_relations(), free_statement_effects(), free_statement_entities(), free_statement_points_to(), free_statement_renamings(), free_statement_task(), free_static_control(), free_static_control_mapping(), free_status(), free_step_clause(), free_step_comm(), free_step_directive(), free_step_directives(), free_step_point(), free_storage(), free_style(), free_subscript(), free_successor(), free_symbolic(), free_synchronization(), free_syntax(), free_task(), free_task_buffers(), free_test(), free_text(), free_tiling(), free_transformation(), free_transformer(), free_type(), free_ubs(), free_ubs_check(), free_unformatted(), free_unstructured(), free_value(), free_var_val(), free_varcount(), free_variable(), free_vertex(), free_virtual_resource(), free_vtxcontent(), free_whileloop(), free_word_to_attachments(), gen_free_tabulated(), gen_full_free_list(), hpf_remapping(), initialize_newgen(), NStackPop(), pipsdbm_free_statement_mapping(), regenerate_renamings(), summary_to_proper_reference(), and translate_reduction().

+ Here is the call graph for this function:

◆ gen_free_tabulated()

int gen_free_tabulated ( int  domain)

free tabulated elements of this domain.

since gen_free is reentrant and manages sharing globally with the following table, we just call it for each object and everything is fine. Well, I hope so. FC

Definition at line 1461 of file genClib.c.

1462 {
1464 
1465  /* since gen_free is reentrant and manages sharing globally
1466  * with the following table, we just call it for each object
1467  * and everything is fine. Well, I hope so. FC
1468  */
1469  message_assert("not initialized", !free_already_seen);
1471 
1473 
1475  free_already_seen = NULL;
1476 
1477  return domain;
1478 }
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992
void gen_mapc_tabulated(void(*)(gen_chunk *), int)
apply fp to domain...
Definition: tabulated.c:127

References check_read_spec_performed, free_already_seen, gen_free(), gen_mapc_tabulated(), hash_pointer, hash_table_free(), hash_table_make(), and message_assert.

Referenced by pipsdbm_free_entities(), and save_meta_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_full_free_list()

void gen_full_free_list ( list  l)

Definition at line 1023 of file genClib.c.

1024 {
1025  list p, nextp ;
1026  bool first_in_stack = (free_already_seen==(hash_table)NULL);
1027 
1028  if (first_in_stack)
1030 
1031  for (p = l; p ; p=nextp)
1032  {
1033  nextp = p->cdr;
1034  gen_free(CAR(p).p);
1035  newgen_free(p);
1036  }
1037 
1038  if (first_in_stack)
1039  {
1041  free_already_seen = NULL;
1042  }
1043 }
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92

References CAR, cons::cdr, free_already_seen, gen_free(), hash_pointer, hash_table_free(), hash_table_make(), and newgen_free.

Referenced by __attribute__(), add_prettyprint_control_list_to_declaration_statement(), add_values_for_simple_effects_of_statement(), any_basic_update_operation_to_transformer(), apply_a_rule(), binary_arithmetic_operator_to_post_pv(), binary_intrinsic_call_to_points_to_sinks(), block_to_transformer_list(), c_convex_effects_on_actual_parameter_forward_translation(), c_convex_effects_on_formal_parameter_backward_translation(), c_text_entity(), call_flt(), cells_to_read_or_write_effects(), check_physical_resource_up_to_date(), check_proper_reductions(), clean_up_sequences_rewrite(), clean_up_transformer_list(), compute_recv_regions(), compute_send_regions(), condition_to_transformer(), conditional_operator_to_post_pv(), constant_reference_to_normalized_constant_reference(), convex_cell_reference_preceding_p(), dimensions_to_dma(), do_array_expansion(), do_atomize_call(), do_brace_expression_to_statements(), do_grouping_replace_reference_by_expression_walker(), do_linearize_array_init(), do_linearize_array_reference(), do_linearize_type(), do_loop_nest_unswitching(), do_outliner_smart_replacment(), do_resource_usage_check(), effects_to_dma(), eval_cell_with_points_to(), expr_level_of(), expression_effects_to_transformer(), expression_to_points_to(), expression_to_post_pv(), external_call_to_post_pv(), forloop_to_post_pv(), free_pv_results_paths(), free_to_post_pv(), freed_pointer_to_points_to(), generic_c_words_simplified_entity(), generic_effect_find_aliases_with_simple_pointer_values(), heap_intrinsic_to_post_pv(), hwac_replace_statement(), intrinsic_call_to_type(), invalidate_expressions_in_statement(), kill_pointer_values(), list_of_compatible_reductions(), live_in_paths_of_loop(), live_out_paths_from_loop_to_body(), logical_operator_to_post_pv(), loop_annotate(), loop_to_post_pv(), make_required(), module_initial_parameter_pv(), multiple_pointer_assignment_to_post_pv(), new_array_elements_backward_substitution_in_transformer(), opencl_generate_special_kernel_ops(), other_cool_enough_for_a_last_substitution(), outliner_smart_references_computation(), pointer_values_remove_var(), points_to_cell_to_upper_bound_points_to_cells(), print_qualifiers(), prune_singleton(), reductions_rewrite(), region_to_minimal_dimensions(), remove_interval_predecessors(), replace_field_by_reference_walker(), rmake(), safe_any_expression_to_transformer(), safe_expression_to_transformer(), safe_intrinsic_to_post_pv(), seq_flt(), simd_check_argType(), single_pointer_assignment_to_post_pv(), statement_clean_declarations_helper(), statement_insertion_fix_access(), statement_insertion_fix_access_in_callers(), statement_remove_extensions(), struct_variable_to_pointer_locations(), subscript_to_points_to_sinks(), subscripted_type_to_type(), successor_only_has_rr_conflict_p(), symbolic_tiling(), transformer_list_closure_to_precondition_depth_two(), transformer_list_closure_to_precondition_max_depth(), transformer_list_multiple_closure_to_precondition(), try_reorder_expressions(), two_addresses_code_generator(), undo_rename_reference(), unstructured_to_post_pv(), update_operator_to_post_pv(), update_preserved_resources(), whileloop_to_post_pv(), whileloop_to_postcondition(), and words_points_to_list().

+ Here is the call graph for this function:

◆ gen_init_external()

void gen_init_external ( int  which,
void *(*)(FILE *, int(*)(void))  read,
void(*)(FILE *, void *)  write,
void(*)(void *)  free,
void *(*)(void *)  copy,
int(*)(void *)  allocated_memory 
)

GEN_INIT_EXTERNAL defines entry points for free, read and write functions of external types.

Definition at line 2276 of file genClib.c.

2282 {
2283  struct gen_binding *bp = &Domains[ which ] ;
2284  union domain *dp = bp->domain ;
2285 
2286  if( dp->ba.type != EXTERNAL_DT ) {
2287  user( "gen_init_external: %s isn't external\n", bp->name ) ;
2288  return ;
2289  }
2290  if( dp->ex.read != NULL ) {
2291  user( "gen_init_external: redefinition of %s skipped\n",
2292  bp->name ) ;
2293  return ;
2294  }
2295  dp->ex.read = read ;
2296  dp->ex.write = write ;
2297  dp->ex.free = free ;
2298  dp->ex.copy = copy ;
2300 }
void free(void *)
@ EXTERNAL_DT
int(* allocated_memory)(void *)
struct domain::@2 ex
void *(* read)(FILE *, int(*)(void))
void *(* copy)(void *)
void(* free)(void *)
void(* write)(FILE *, void *)

References domain::allocated_memory, domain::ba, domain::copy, gen_binding::domain, Domains, domain::ex, EXTERNAL_DT, free(), domain::free, gen_binding::name, domain::read, return(), domain::type, user(), and domain::write.

Referenced by initialize_newgen(), main(), and pips_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_local_copy_tree()

static gen_chunk* gen_local_copy_tree ( gen_chunk obj,
bool  keep 
)
static

GEN_COPY_TREE makes a copy of the object OBJ.

whether to keep the copy tables...

Save the old copy_table if required...

restore copy environment if needed

Definition at line 1387 of file genClib.c.

1390 {
1391  gen_chunk *copy;
1392  struct driver dr ;
1393  hash_table old_copy_table = hash_table_undefined;
1394 
1396 
1397  dr.null = gen_null ;
1398  dr.leaf_out = copy_leaf_out ;
1399  dr.leaf_in = tabulated_leaf_in ;
1400  dr.obj_in = copy_obj_in ;
1401  dr.simple_in = copy_simple_in ;
1402  dr.array_leaf = gen_array_leaf ;
1403  dr.simple_out = copy_simple_out ;
1404  dr.obj_out = copy_obj_out;
1405 
1406  /* Save the old copy_table if required...
1407  */
1408  if (!keep)
1409  {
1410  old_copy_table = copy_table;
1412  }
1413 
1414  gen_trav_obj(obj, &dr) ;
1415  copy = copy_hsearch(obj) ;
1416 
1417  /* restore copy environment if needed
1418  */
1419  if (!keep)
1420  {
1422  copy_table = old_copy_table;
1423  }
1424 
1425  return copy;
1426 }
static int copy_obj_in(gen_chunk *obj, __attribute__((unused)) struct driver *dr)
COPY_OBJ_IN duplicates an object if it has not already been seen (this migth happen with shared objec...
Definition: genClib.c:1086
static int tabulated_leaf_in(gen_chunk *obj, struct gen_binding *bp)
Definition: genClib.c:620
static void copy_obj_out(obj, bp, dr)
Definition: genClib.c:1361
static int copy_simple_in(gen_chunk *obj, union domain *dp)
Just check for defined simple domains.
Definition: genClib.c:1117
static void copy_leaf_out(obj, bp)
COPY_LEAF_OUT manages external sub-domains.
Definition: genClib.c:1149
static void copy_simple_out(obj, dp)
COPY_SIMPLE_OUT copies the spine of the list OBJ or the whole array (according to the type DP).
Definition: genClib.c:1271
#define hash_table_undefined
Value of an undefined hash_table.
Definition: newgen_hash.h:49
@ keep
bj > b1 -> h1/hj = h1
Definition: union-local.h:61

References driver::array_leaf, check_read_spec_performed, domain::copy, copy_hsearch(), copy_leaf_out(), copy_obj_in(), copy_obj_out(), copy_simple_in(), copy_simple_out(), copy_table, gen_array_leaf(), gen_null(), gen_trav_obj(), hash_pointer, hash_table_free(), hash_table_make(), hash_table_undefined, keep, driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, driver::simple_in, driver::simple_out, and tabulated_leaf_in().

Referenced by gen_copy_tree(), and gen_copy_tree_with_sharing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_make_array()

gen_chunk* gen_make_array ( num  )

GEN_MAKE_ARRAY allocates an initialized array of NUM gen_chunks.

OSTRICT

Definition at line 2307 of file genClib.c.

2309 {
2310  int i ;
2311  /*NOSTRICT*/
2312  gen_chunk *ar = (gen_chunk *)alloc( sizeof( gen_chunk )) ;
2313 
2314  for( i=0 ; i<num ; i++ )
2315  ar[ i ].p = gen_chunk_undefined ;
2316 
2317  return( ar ) ;
2318 }
static int num
Definition: bourdoncle.c:137

References alloc(), domain::ar, gen_chunk_undefined, and num.

+ Here is the call graph for this function:

◆ gen_read()

gen_chunk* gen_read ( FILE *  file)

GEN_READ reads any object from the FILE stream.

Sharing is restored.

Definition at line 2323 of file genClib.c.

2324 {
2326  newgen_start_lexer(file);
2327  genread_parse() ;
2328  return Read_chunk;
2329 }
void newgen_start_lexer(FILE *)
starting the scanner.
Definition: genread_lex.c:822
int genread_parse(void)
gen_chunk * Read_chunk
Where the root will be.
Definition: genread_yacc.c:134

References gen_chunk_undefined, genread_parse(), newgen_start_lexer(), and Read_chunk.

Referenced by initialize_newgen(), pipsdbm_read_statement_function(), pipsdbm_read_statement_mapping(), process_user_file(), read_abc_checked(), read_action(), read_action_kind(), read_alias_association(), read_alias_associations(), read_align(), read_alignmap(), read_alignment(), read_application(), read_approximation(), read_area(), read_array_dimension_checked(), read_assignment(), read_atom(), read_attachee(), read_attachment(), read_attachments(), read_basic(), read_bdt(), read_bound_pair(), read_c_parser_context(), read_call(), read_call_site(), read_callees(), read_cast(), read_cell(), read_cell_interpretation(), read_cell_relation(), read_cell_relations(), read_chain(), read_clone_context(), read_code(), read_communication(), read_comp_desc(), read_comp_desc_set(), read_comp_sec(), read_complexity(), read_conditional(), read_cone(), read_conflict(), read_constant(), read_context_info(), read_control(), read_controlmap(), read_dad_struct(), read_dag(), read_dagvtx(), read_data(), read_data_status(), read_database(), read_dataflow(), read_dataval(), read_datavar(), read_db_owned_resources(), read_db_resource(), read_db_resources(), read_db_status(), read_descriptor(), read_dfg_arc_label(), read_dfg_vertex_label(), read_dg_arc_label(), read_dg_vertex_label(), read_dimension(), read_dimension_checked(), read_distribute(), read_distributemap(), read_distribution(), read_dummy(), read_dynamic_check(), read_dynamic_status(), read_effect(), read_effects(), read_effects_classes(), read_entities(), read_entity_effects(), read_entity_entities(), read_entity_int(), read_entity_status(), read_entity_task_buffers(), read_entity_to_entity(), read_entitymap(), read_equivalences(), read_evaluation(), read_execution(), read_expression(), read_expressionwithlevel(), read_extension(), read_extensions(), read_forloop(), read_formal(), read_function(), read_functional(), read_gap(), read_gexpression(), read_graph(), read_hpf_newdecl(), read_hpf_newdecls(), read_hpfc_reductions(), read_hpfc_status(), read_ifcount(), read_instruction(), read_interpreted_cell(), read_interval_vertex_label(), read_language(), read_leaf_label(), read_lexpressionwithlevel(), read_lisp_expression(), read_loop(), read_makefile(), read_map_effect_bool(), read_map_effect_step_point(), read_map_entity_int(), read_match(), read_matchTree(), read_matchTreeSons(), read_memory_mapping(), read_message(), read_mode(), read_multitest(), read_newdeclmap(), read_normalized(), read_numbers_status(), read_opcode(), read_operator_id_tree(), read_overlap(), read_overlapsmap(), read_owner(), read_parameter(), read_path_selector(), read_path_selectors(), read_pattern(), read_patternArg(), read_patternx(), read_persistant_expression_to_effects(), read_persistant_expression_to_entity(), read_persistant_statement_to_cluster(), read_persistant_statement_to_control(), read_persistant_statement_to_int(), read_persistant_statement_to_statement(), read_placement(), read_plc(), read_points_to(), read_points_to_graph(), read_points_to_list(), read_pragma(), read_predicate(), read_preference(), read_property(), read_pstatement(), read_pstatement_reductions(), read_qualifier(), read_quast(), read_quast_leaf(), read_quast_value(), read_ram(), read_range(), read_rangecount(), read_real_resource(), read_recursive_selector(), read_reduced_loops(), read_reduction(), read_reduction_operator(), read_reductionInfo(), read_reductions(), read_ref_temp(), read_reference(), read_remapping(), read_renaming(), read_resource(), read_rtype(), read_rule(), read_scc(), read_sccflags(), read_sccs(), read_schedule(), read_sentence(), read_sequence(), read_sesam_buffers_processing_context(), read_sexpression(), read_simdstatement(), read_simple_section(), read_sizeofexpression(), read_statement(), read_statement_cell_relations(), read_statement_effects(), read_statement_entities(), read_statement_points_to(), read_statement_renamings(), read_statement_task(), read_static_control(), read_status(), read_step_clause(), read_step_comm(), read_step_directive(), read_step_directives(), read_step_point(), read_storage(), read_style(), read_subscript(), read_successor(), read_symbolic(), read_synchronization(), read_syntax(), read_task(), read_task_buffers(), read_test(), read_text(), read_tiling(), read_transformation(), read_transformer(), read_type(), read_ubs(), read_ubs_check(), read_unformatted(), read_unstructured(), read_value(), read_var_val(), read_varcount(), read_variable(), read_vertex(), read_virtual_resource(), read_vtxcontent(), read_whileloop(), and read_word_to_attachments().

+ Here is the call graph for this function:

◆ gen_read_spec()

void gen_read_spec ( char *  spec,
  ... 
)

default initialization of newgen lexers files:

now let's read the spec strings...

quick recurse decision tables initializations

set identity type translation tables

Definition at line 2218 of file genClib.c.

2219 {
2220  va_list ap;
2221  struct gen_binding * bp;
2222  extern int unlink();
2223 
2224  /* default initialization of newgen lexers files:
2225  */
2226  newgen_start_lexer(stdin);
2227  genspec_in = stdin;
2228  genspec_out = stdout;
2229 
2230  /* now let's read the spec strings...
2231  */
2232  va_start(ap, spec) ;
2233 
2234  init() ;
2235  Read_spec_mode = 1 ;
2236 
2237  while(spec)
2238  {
2240  genspec_parse() ;
2242 
2243  spec = va_arg( ap, char *);
2244  }
2246 
2247  compile() ;
2248 
2249  for (bp=Domains ; bp<&Domains[MAX_DOMAIN]; bp++)
2250  {
2251  if(bp->name && !IS_INLINABLE(bp) && !IS_EXTERNAL(bp) &&
2252  bp->domain->ba.type == IMPORT_DT) {
2253  user( "Cannot run with imported domains: %s\n", bp->name ) ;
2254  va_end(ap);
2255  return ;
2256  }
2257  }
2258 
2259  Read_spec_mode = 0 ;
2261 
2262  va_end(ap);
2263 
2264  /* quick recurse decision tables initializations
2265  */
2267 
2268  /* set identity type translation tables */
2270 }
void compile(void)
COMPILE reconnects the Domains table (for not compiled types – note that an inlined type is already c...
Definition: build.c:422
FILE * genspec_out
Definition: genClib.c:52
void genspec_set_string_to_parse(char *)
Definition: genspec_lex.c:838
FILE * genspec_in
lex files
static void init_gen_quick_recurse_tables(void)
GEN_READ_SPEC reads the specifications.
Definition: genClib.c:3036
static bool Read_spec_performed
Definition: genClib.c:61
void genspec_reset_string_to_parse(void)
Definition: genspec_lex.c:839
void gen_type_translation_default(void)
Definition: genClib.c:2180
void genspec_lex_destroy()
int Read_spec_mode
extern int Current_first ;
Definition: genClib.c:60
int genspec_parse(void)
@ IMPORT_DT
#define true
Definition: newgen_types.h:81
static int init
Maximal value set for Fortran 77.
Definition: entity.c:320

References domain::ba, compile(), gen_binding::domain, Domains, gen_type_translation_default(), genspec_in, genspec_lex_destroy(), genspec_out, genspec_parse(), genspec_reset_string_to_parse(), genspec_set_string_to_parse(), IMPORT_DT, init, init_gen_quick_recurse_tables(), IS_EXTERNAL, IS_INLINABLE, MAX_DOMAIN, gen_binding::name, newgen_start_lexer(), Read_spec_mode, Read_spec_performed, return(), true, domain::type, and user().

Referenced by initialize_newgen(), main(), and pips_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_read_string()

string gen_read_string ( FILE *  file,
char  upto 
)

returns the allocated line read, whatever its length.

returns NULL on EOF. also some asserts. FC 09/97.

Definition at line 1943 of file genClib.c.

1944 {
1945  int i=0, size = 20, c;
1946  char * buf = (char*) malloc(sizeof(char)*size), * res;
1947  message_assert("malloc ok", buf);
1948  while((c=getc(file)) && c!=EOF && c!=upto)
1949  {
1950  if (i==size-1) // larger for trailing '\0'
1951  {
1952  size+=20;
1953  buf = (char*) realloc((char*) buf, sizeof(char)*size);
1954  // we abort on failure...
1955  message_assert("realloc ok", buf);
1956  }
1957  buf[i++] = (char) c;
1958  }
1959  if (c==EOF && i==0) { res = NULL; free(buf); }
1960  else { buf[i++] = '\0'; res = strdup(buf); free(buf); }
1961 
1962  return res;
1963 }
void * malloc(YYSIZE_T)
static char buf[BSZ]
Definition: split_file.c:157

References buf, free(), malloc(), message_assert, and strdup().

Referenced by gtt_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_read_tabulated()

int gen_read_tabulated ( FILE *  file,
int  create_p 
)

GEN_READ_TABULATED reads FILE to update the Gen_tabulated_ table.

Creates if CREATE_P is true.

Definition at line 2334 of file genClib.c.

2335 {
2336  extern int newgen_allow_forward_ref;
2337  int domain;
2338 
2339  message_assert("argument not used", create_p==create_p);
2340 
2341  newgen_start_lexer(file);
2342 
2343  newgen_allow_forward_ref = true;
2344  genread_parse();
2345  newgen_allow_forward_ref = false;
2346 
2347  domain = Read_chunk->i;
2348  newgen_free((char *) Read_chunk);
2349 
2350  return domain;
2351 }
int newgen_allow_forward_ref
The GEN_TABULATED_NAMES hash table maps ids to index in the table of the tabulated domains.
Definition: genread_yacc.c:151

References genread_parse(), gen_chunk::i, message_assert, newgen_allow_forward_ref, newgen_free, newgen_start_lexer(), and Read_chunk.

Referenced by f95split(), gen_read_and_check_tabulated(), load_entities(), pipsdbm_read_entities(), read_tabulated_db_symbol(), read_tabulated_entity(), and read_tabulated_opcodeClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_sharing_p()

bool gen_sharing_p ( gen_chunk obj1,
gen_chunk obj2 
)

Definition at line 2518 of file genClib.c.

2520 {
2521  struct driver dr ;
2522  bool found ;
2523 
2525 
2526  if( pointers == (hash_table)NULL )
2528  else
2530 
2531  dr.null = dr.leaf_out = dr.simple_out = dr.obj_out = gen_null ;
2532  dr.obj_in = sharing_obj_in ;
2533  dr.simple_in = sharing_simple_in ;
2534  dr.array_leaf = gen_array_leaf ;
2535  dr.leaf_in = tabulated_leaf_in ;
2536 
2537  push_gen_trav_env() ;
2538  shared_pointers(obj2, false );
2539 
2540  HASH_MAP( k, v, {
2541  hash_put( pointers, k, v ) ;
2542  }, obj_table ) ;
2543 
2544  shared_pointers( obj1, false ) ;
2545 
2546  if( (found=setjmp( env )) == 0 )
2547  gen_trav_obj( obj1, &dr ) ;
2548 
2549  pop_gen_trav_env() ;
2550 
2551  return(found) ;
2552 }
static int sharing_obj_in(gen_chunk *obj, struct driver *dr)
Definition: genClib.c:2485
static int sharing_simple_in(gen_chunk *obj, union domain *dp)
Definition: genClib.c:2499
void hash_table_clear(hash_table htp)
Clears all entries of a hash table HTP.
Definition: hash.c:305

References driver::array_leaf, check_read_spec_performed, env, gen_array_leaf(), gen_null(), gen_trav_obj(), HASH_MAP, hash_pointer, hash_put(), hash_table_clear(), hash_table_make(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, obj_table, pointers, pop_gen_trav_env(), push_gen_trav_env(), shared_pointers(), sharing_obj_in(), sharing_simple_in(), driver::simple_in, driver::simple_out, and tabulated_leaf_in().

+ Here is the call graph for this function:

◆ gen_tabulated_consistent_p()

int gen_tabulated_consistent_p ( int  domain)

Definition at line 2420 of file genClib.c.

2421 {
2424  return !cumulated_error_seen;
2425 }
static void void_gen_consistent_p(gen_chunk *obj)
for side effects only
Definition: genClib.c:2415

References cumulated_error_seen, gen_mapc_tabulated(), and void_gen_consistent_p().

+ Here is the call graph for this function:

◆ gen_trav_leaf()

static void gen_trav_leaf ( struct gen_binding bp,
gen_chunk obj,
struct driver dr 
)
static

set to true to stop...

GEN_TRAV_LEAF manages an OBJ value of type BP according to the current driver DR. A leaf is an object (inlined or not).

Definition at line 390 of file genClib.c.

391 {
392  if (gen_trav_stop_recursion) return;
393 
394  CHECK_NULL(obj, bp, dr) ;
395 
397  {
398  fprintf_spaces( stderr, gen_debug_indent++ ) ;
399  (void) fprintf( stderr, "trav_leaf dealing with " ) ;
400 
401  if( IS_INLINABLE( bp ))
402  (void) fprintf( stderr, "inlined %s\n", bp->name ) ;
403  else if( IS_EXTERNAL( bp ))
404  (void) fprintf( stderr, "external %s\n", bp->name ) ;
405  else if( IS_TABULATED( bp ))
406  (void) fprintf( stderr, "tabulated %s\n", bp->name ) ;
407  else (void) fprintf( stderr, "constructed %s\n", bp->name ) ;
408  }
409 
410  if( (*dr->leaf_in)(obj, bp))
411  {
412  if (gen_trav_stop_recursion) return;
413  if( !IS_INLINABLE( bp ) && !IS_EXTERNAL( bp ))
414  {
415  if (gen_debug & GEN_DBG_CHECK)
416  (void) gen_check( obj->p, bp-Domains ) ;
417 
418  CHECK_NULL(obj->p, bp, dr) ;
419  gen_trav_obj( obj->p, dr ) ;
420  }
421  (*dr->leaf_out)(obj, bp) ;
422  }
423 
425 }
#define GEN_DBG_TRAV_LEAF
Definition: genC.h:197
static int gen_debug_indent
Definition: genClib.c:70
gen_chunk * gen_check(gen_chunk *obj, int t)
GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE.
Definition: genClib.c:2356
#define CHECK_NULL(obj, bp, dr)
To be called on any object pointer.
Definition: genClib.c:380
static void fprintf_spaces(fd, number)
FPRINTF_SPACES prints NUMBER spaces on the FD file descriptor.
Definition: genClib.c:118
void(* leaf_out)()
Definition: genClib.c:368
int(* leaf_in)()
Definition: genClib.c:367

References CHECK_NULL, Domains, fprintf(), fprintf_spaces(), gen_check(), GEN_DBG_CHECK, GEN_DBG_TRAV_LEAF, gen_debug, gen_debug_indent, gen_trav_obj(), gen_trav_stop_recursion, IS_EXTERNAL, IS_INLINABLE, IS_TABULATED, driver::leaf_in, driver::leaf_out, gen_binding::name, and gen_chunk::p.

Referenced by gen_array_leaf(), gen_trav_simple(), write_array_leaf(), and write_this_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_trav_obj() [1/2]

◆ gen_trav_obj() [2/2]

static void gen_trav_obj ( gen_chunk obj,
struct driver dr 
)
static

"driver" driven recursion in newgen data structures.

note that we do not know the expected type of the object...

Definition at line 570 of file genClib.c.

573 {
574  if (gen_trav_stop_recursion) return;
575 
576  if (obj == NULL)
577  fatal("unexpected NULL value encountered\n");
578 
579  // this detects undefined values:
580  CHECK_NULL(obj, (struct gen_binding *) NULL, dr);
581 
582  if ((*dr->obj_in)(obj, dr))
583  {
584  struct gen_binding *bp = &Domains[quick_domain_index(obj)] ;
585  union domain *dp = bp->domain ;
586  int data = 1+IS_TABULATED( bp ) ;
587 
588  if (gen_trav_stop_recursion) return;
589 
591  {
592  fprintf_spaces( stderr, gen_debug_indent++ ) ;
593  (void) fprintf( stderr, "trav_obj (%p) ", obj) ;
594  print_domain( stderr, dp ) ;
595  (void) fprintf( stderr, "\n" ) ;
596  }
597 
598  switch( dp->ba.type )
599  {
600  case LIST_DT:
601  case SET_DT:
602  case ARRAY_DT:
603  gen_trav_simple(dp, obj+data, dr);
604  break ;
605  case CONSTRUCTED_DT:
606  gen_trav_obj_constructed(obj, bp, dp, data, dr);
607  break ;
608  default:
609  fatal( "gen_trav_obj: Unknown type %s\n", i2a(dp->ba.type));
610  }
611 
612  if (gen_trav_stop_recursion) return;
613 
614  (*dr->obj_out)(obj, bp, dr);
615  }
617 }
#define GEN_DBG_TRAV_OBJECT
Definition: genC.h:199
static void gen_trav_simple(union domain *dp, gen_chunk *obj, struct driver *dr)
GEN_TRAV_SIMPLE traverses a simple OBJ (which is a (CONS *) for a list or points to the first element...
Definition: genClib.c:431
static void gen_trav_obj_constructed(gen_chunk *obj, __attribute__((unused)) struct gen_binding *bp, union domain *dp, int data, struct driver *dr)
GEN_TRAV_OBJ (the root function) traverses the object OBJ according to the driver DR.
Definition: genClib.c:510
void(* obj_out)()
Definition: genClib.c:373
int(* obj_in)()
Definition: genClib.c:372

References ARRAY_DT, domain::ba, CHECK_NULL, CONSTRUCTED_DT, gen_binding::domain, Domains, fatal(), fprintf(), fprintf_spaces(), GEN_DBG_TRAV_OBJECT, gen_debug, gen_debug_indent, gen_trav_obj_constructed(), gen_trav_simple(), gen_trav_stop_recursion, i2a(), IS_TABULATED, LIST_DT, driver::obj_in, driver::obj_out, print_domain(), quick_domain_index, SET_DT, and domain::type.

+ Here is the call graph for this function:

◆ gen_trav_obj_constructed()

static void gen_trav_obj_constructed ( gen_chunk obj,
__attribute__((unused)) struct gen_binding bp,
union domain dp,
int  data,
struct driver dr 
)
static

GEN_TRAV_OBJ (the root function) traverses the object OBJ according to the driver DR.

Definition at line 510 of file genClib.c.

516 {
517  struct domainlist *dlp;
518 
519  if (gen_trav_stop_recursion) return;
520  dlp = dp->co.components ;
521  switch(dp->co.op)
522  {
523  case AND_OP:
524  {
525  gen_chunk *cp ;
526  for(cp = obj+data ; dlp != NULL ; cp++, dlp = dlp->cdr)
527  {
528  gen_trav_simple(dlp->domain, cp, dr) ;
529  if (gen_trav_stop_recursion) return;
530  }
531  break ;
532  }
533  case OR_OP:
534  {
535  int which = (obj+data)->i - dp->co.first ;
536  for(; dlp!=NULL && which; which--,dlp=dlp->cdr)
537  ;
538  if(dlp == NULL)
539  fatal( "gen_trav_obj: Unknown tag %s\n", i2a( (obj+data)->i )) ;
540  gen_trav_simple(dlp->domain, obj+data+1, dr);
541  break ;
542  }
543  case ARROW_OP:
544  {
545  union domain
546  *dkeyp=dlp->domain,
547  *dvalp=dlp->cdr->domain;
548 
549  HASH_MAP(k, v,
550  {
551  // what if? persistent sg ->
552  // the source & target must be simple newgen objects, not sets/lists...
553  gen_trav_simple(dkeyp, (gen_chunk *) k, dr) ;
554  if (gen_trav_stop_recursion) return;
555  gen_trav_simple(dvalp, (gen_chunk *) v, dr) ;
556  if (gen_trav_stop_recursion) return;
557  },
558  (obj+data)->h ) ;
559  break ;
560  }
561  default:
562  fatal( "gen_trav_obj: Unknown op %s\n", i2a(dp->co.op)) ;
563  }
564 }

References AND_OP, ARROW_OP, domain::co, domain::components, cp, fatal(), domain::first, gen_trav_simple(), gen_trav_stop_recursion, HASH_MAP, i2a(), domain::op, and OR_OP.

Referenced by gen_trav_obj().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_trav_simple()

static void gen_trav_simple ( union domain dp,
gen_chunk obj,
struct driver dr 
)
static

GEN_TRAV_SIMPLE traverses a simple OBJ (which is a (CONS *) for a list or points to the first element of an array) of type DP according to the driver DR.

Definition at line 431 of file genClib.c.

435 {
436  if (gen_trav_stop_recursion) return;
437 
438  CHECK_NULL(obj, (struct gen_binding *) NULL, dr);
439 
441  {
442  fprintf_spaces( stderr, gen_debug_indent++ ) ;
443  (void) fprintf( stderr, "trav_simple dealing with " ) ;
444  print_domain( stderr, dp ) ;
445  (void) fprintf( stderr, "\n" ) ;
446  }
447 
448  if( (*dr->simple_in)(obj, dp))
449  {
450  switch( dp->ba.type )
451  {
452  case BASIS_DT:
453  gen_trav_leaf( dp->ba.constructand, obj, dr ) ;
454  break ;
455  case LIST_DT:
456  {
457  cons *p ;
458  for (p = obj->l ; p != NULL ; p = p->cdr)
459  gen_trav_leaf( dp->li.element, &p->car, dr ) ;
460  break ;
461  }
462  case SET_DT:
463  SET_MAP(elt,
464  {
465  gen_trav_leaf(dp->se.element, (gen_chunk *)&elt, dr);
466  },
467  obj->t) ;
468  break ;
469  case ARRAY_DT:
470  {
471  int i, size = array_size(dp->ar.dimensions);
472  for (i=0 ; i<size; i++)
473  (*dr->array_leaf)(dp->ar.element, i, obj->p+i, dr);
474  break ;
475  }
476  default:
477  fatal("gen_trav_simple: Unknown type %s\n", i2a( dp->ba.type ));
478  }
479 
482  return;
483  }
484  (*dr->simple_out)( obj, dp ) ;
485  }
486 
488 }
#define GEN_DBG_TRAV_SIMPLE
Definition: genC.h:198
void(* simple_out)()
Definition: genClib.c:371
void(* array_leaf)()
Definition: genClib.c:370
int(* simple_in)()
Definition: genClib.c:369
struct domain::@5 se
struct gen_binding * constructand

References domain::ar, ARRAY_DT, driver::array_leaf, array_size(), domain::ba, BASIS_DT, cons::car, cons::cdr, CHECK_NULL, domain::constructand, domain::dimensions, domain::element, fatal(), fprintf(), fprintf_spaces(), GEN_DBG_TRAV_SIMPLE, gen_debug, gen_debug_indent, gen_trav_leaf(), gen_trav_stop_recursion, i2a(), gen_chunk::l, domain::li, LIST_DT, gen_chunk::p, print_domain(), domain::se, SET_DT, SET_MAP, driver::simple_in, driver::simple_out, gen_chunk::t, and domain::type.

Referenced by gen_trav_obj(), and gen_trav_obj_constructed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_type()

int gen_type ( gen_chunk obj)

GEN_TYPE returns the domain number for the object in argument.

FC 29/12/94

Definition at line 82 of file genClib.c.

83 {
84  int dom;
85  message_assert("no domain for NULL object", obj!=(gen_chunk*)NULL);
86  message_assert("no domain for undefined object",
87  !gen_chunk_undefined_p(obj));
88  dom = obj->i; check_domain(dom);
89  return dom;
90 }

References check_domain, gen_chunk_undefined_p, gen_chunk::i, and message_assert.

Referenced by pipsdbm_consistent_statement_function(), and update_object_for_module().

+ Here is the caller graph for this function:

◆ gen_type_translation_actual_to_old()

int gen_type_translation_actual_to_old ( int  n)

backwards conversion

Definition at line 2160 of file genClib.c.

2161 {
2162  int on;
2163  message_assert("valid new type number", n>=0 && n<MAX_DOMAIN);
2164  if (!gtt_current_table) return n;
2166  if (on==-1) fatal("new type number %d not available", n);
2167  message_assert("valid new type number", on>=0 && on<MAX_DOMAIN);
2168  return on;
2169 }
static gtt_p gtt_current_table
global translation table.
Definition: genClib.c:1938
int actual_to_old[MAX_DOMAIN]
forwards translation
Definition: genClib.c:1932

References gtt_t::actual_to_old, fatal(), gtt_current_table, MAX_DOMAIN, and message_assert.

Referenced by gen_write_tabulated(), write_leaf_in(), and write_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_type_translation_default()

void gen_type_translation_default ( void  )

Definition at line 2180 of file genClib.c.

2181 {
2185 }
void gen_type_translation_reset(void)
Definition: genClib.c:2171
static gtt_p gtt_make(void)
returns an allocated and initialized translation table...
Definition: genClib.c:1966
static void gtt_table_identity(gtt_p table)
Definition: genClib.c:1982

References gen_type_translation_reset(), gtt_current_table, gtt_make(), and gtt_table_identity().

Referenced by gen_read_spec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_type_translation_old_to_actual()

int gen_type_translation_old_to_actual ( int  n)

forwards conversion

Definition at line 2147 of file genClib.c.

2148 {
2149  int nn;
2150  message_assert("valid old type number", n>=0 && n<MAX_DOMAIN);
2151  if (!gtt_current_table) return n;
2153  if (nn==-1) fatal("old type number %d not available", n);
2154  message_assert("valid new type number", nn>=0 && nn<MAX_DOMAIN);
2155  return nn;
2156 }
int old_to_actual[MAX_DOMAIN]
whether the translation is nope...
Definition: genClib.c:1931

References fatal(), gtt_current_table, MAX_DOMAIN, message_assert, and gtt_t::old_to_actual.

Referenced by read_external().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_type_translation_read()

void gen_type_translation_read ( string  filename)

set current type translation table according to file

Definition at line 2189 of file genClib.c.

2190 {
2192  gtt_current_table = gtt_read(filename);
2193 }
static gtt_p gtt_read(string filename)
read and setup a table from a file
Definition: genClib.c:2017

References gen_type_translation_reset(), gtt_current_table, and gtt_read().

Referenced by load_meta_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_type_translation_reset()

void gen_type_translation_reset ( void  )

Definition at line 2171 of file genClib.c.

2172 {
2173  if (gtt_current_table)
2174  {
2176  gtt_current_table = NULL;
2177  }
2178 }

References free(), and gtt_current_table.

Referenced by gen_type_translation_default(), and gen_type_translation_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_type_translation_write()

void gen_type_translation_write ( string  filename)

Definition at line 2195 of file genClib.c.

2196 {
2197  message_assert("some type translation table to write", gtt_current_table);
2198  gtt_write(filename, gtt_current_table);
2199 }
static void gtt_write(string filename, gtt_p table)
writes what the previous reads...
Definition: genClib.c:2132

References gtt_current_table, gtt_write(), and message_assert.

Referenced by save_meta_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_write()

void gen_write ( FILE *  fd,
gen_chunk obj 
)

GEN_WRITE writes the OBJect on the stream FD.

Sharing is managed (the number of which is printed before the object.)

Definition at line 1745 of file genClib.c.

1748 {
1749  struct driver dr ;
1750 
1752 
1753  dr.null = write_null ;
1754  dr.leaf_out = gen_null ;
1755  dr.leaf_in = write_leaf_in ;
1756  dr.simple_in = write_simple_in ;
1757  dr.array_leaf = write_array_leaf ;
1758  dr.simple_out = write_simple_out ;
1759  dr.obj_in = write_obj_in ;
1760  dr.obj_out = write_obj_out ;
1761 
1762  user_file = fd ;
1763 
1765 
1766  shared_pointers(obj, false);
1767  fputi(shared_number, fd);
1768  gen_trav_obj( obj, &dr );
1769 
1770  pop_gen_trav_env() ;
1771 }
static void write_null(struct gen_binding *bp)
Definition: genClib.c:1512
static void write_array_leaf(struct gen_binding *bp, int i, gen_chunk *obj, struct driver *dr)
WRITE_ARRAY_LEAF only writes non-null elements, in a sparse way.
Definition: genClib.c:1703
static int shared_number
The running counter of shared objects number.
Definition: genClib.c:662

References driver::array_leaf, check_read_spec_performed, fputi(), gen_null(), gen_trav_obj(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, pop_gen_trav_env(), push_gen_trav_env(), shared_number, shared_pointers(), driver::simple_in, driver::simple_out, user_file, write_array_leaf(), write_leaf_in(), write_null(), write_obj_in(), write_obj_out(), write_simple_in(), and write_simple_out().

Referenced by gen_consistent_p(), gfc2pips_namespace(), initialize_newgen(), pipsdbm_write_statement_function(), pipsdbm_write_statement_mapping(), write_abc_checked(), write_action(), write_action_kind(), write_alias_association(), write_alias_associations(), write_align(), write_alignmap(), write_alignment(), write_application(), write_approximation(), write_area(), write_array_dimension_checked(), write_assignment(), write_atom(), write_attachee(), write_attachment(), write_attachments(), write_basic(), write_bdt(), write_bound_pair(), write_c_parser_context(), write_call(), write_call_site(), write_callees(), write_cast(), write_cell(), write_cell_interpretation(), write_cell_relation(), write_cell_relations(), write_chain(), write_clone_context(), write_code(), write_communication(), write_comp_desc(), write_comp_desc_set(), write_comp_sec(), write_complexity(), write_conditional(), write_cone(), write_conflict(), write_constant(), write_context_info(), write_control(), write_controlmap(), write_dad_struct(), write_dag(), write_dagvtx(), write_data(), write_data_status(), write_database(), write_dataflow(), write_dataval(), write_datavar(), write_db_owned_resources(), write_db_resource(), write_db_resources(), write_db_status(), write_descriptor(), write_dfg_arc_label(), write_dfg_vertex_label(), write_dg_arc_label(), write_dg_vertex_label(), write_dimension(), write_dimension_checked(), write_distribute(), write_distributemap(), write_distribution(), write_dummy(), write_dynamic_check(), write_dynamic_status(), write_effect(), write_effects(), write_effects_classes(), write_entities(), write_entity_effects(), write_entity_entities(), write_entity_int(), write_entity_status(), write_entity_task_buffers(), write_entity_to_entity(), write_entitymap(), write_equivalences(), write_evaluation(), write_execution(), write_expression(), write_expressionwithlevel(), write_extension(), write_extensions(), write_forloop(), write_formal(), write_function(), write_functional(), write_gap(), write_gexpression(), write_graph(), write_hpf_newdecl(), write_hpf_newdecls(), write_hpfc_reductions(), write_hpfc_status(), write_ifcount(), write_instruction(), write_interpreted_cell(), write_interval_vertex_label(), write_language(), write_leaf_label(), write_lexpressionwithlevel(), write_lisp_expression(), write_loop(), write_makefile(), write_map_effect_bool(), write_map_effect_step_point(), write_map_entity_int(), write_match(), write_matchTree(), write_matchTreeSons(), write_memory_mapping(), write_message(), write_mode(), write_multitest(), write_newdeclmap(), write_normalized(), write_numbers_status(), write_opcode(), write_operator_id_tree(), write_overlap(), write_overlapsmap(), write_owner(), write_parameter(), write_path_selector(), write_path_selectors(), write_pattern(), write_patternArg(), write_patternx(), write_persistant_expression_to_effects(), write_persistant_expression_to_entity(), write_persistant_statement_to_cluster(), write_persistant_statement_to_control(), write_persistant_statement_to_int(), write_persistant_statement_to_statement(), write_placement(), write_plc(), write_points_to(), write_points_to_graph(), write_points_to_list(), write_pragma(), write_predicate(), write_preference(), write_property(), write_pstatement(), write_pstatement_reductions(), write_qualifier(), write_quast(), write_quast_leaf(), write_quast_value(), write_ram(), write_range(), write_rangecount(), write_real_resource(), write_recursive_selector(), write_reduced_loops(), write_reduction(), write_reduction_operator(), write_reductionInfo(), write_reductions(), write_ref_temp(), write_reference(), write_remapping(), write_renaming(), write_resource(), write_rtype(), write_rule(), write_scc(), write_sccflags(), write_sccs(), write_schedule(), write_sentence(), write_sequence(), write_sesam_buffers_processing_context(), write_sexpression(), write_simdstatement(), write_simple_section(), write_sizeofexpression(), write_statement(), write_statement_cell_relations(), write_statement_effects(), write_statement_entities(), write_statement_points_to(), write_statement_renamings(), write_statement_task(), write_static_control(), write_status(), write_step_clause(), write_step_comm(), write_step_directive(), write_step_directives(), write_step_point(), write_storage(), write_style(), write_subscript(), write_successor(), write_symbolic(), write_synchronization(), write_syntax(), write_task(), write_task_buffers(), write_test(), write_text(), write_tiling(), write_transformation(), write_transformer(), write_type(), write_ubs(), write_ubs_check(), write_unformatted(), write_unstructured(), write_value(), write_var_val(), write_varcount(), write_variable(), write_vertex(), write_virtual_resource(), write_vtxcontent(), write_whileloop(), and write_word_to_attachments().

+ Here is the call graph for this function:

◆ gen_write_tabulated()

int gen_write_tabulated ( FILE *  fd,
int  domain 
)

GEN_WRITE_TABULATED writes the tabulated object TABLE on FD.

Sharing is managed.

headers: #shared, tag, domain number,

restore the index sign which was changed to tag as seen...

Definition at line 1866 of file genClib.c.

1867 {
1868  struct gen_binding * bp = Domains+domain;
1869  struct driver dr ;
1870  int wdomain;
1871  gen_chunk * fake_obj;
1872 
1874 
1877 
1878  dr.null = write_null;
1879  dr.leaf_out = gen_null ;
1880  dr.leaf_in = write_tabulated_leaf_in ;
1881  dr.simple_in = write_simple_in ;
1882  dr.array_leaf = write_array_leaf ;
1883  dr.simple_out = write_simple_out ;
1884  dr.obj_in = write_obj_in ;
1885  dr.obj_out = write_obj_out ;
1886  user_file = fd ;
1887 
1889  shared_pointers(fake_obj, false);
1890 
1891  /* headers: #shared, tag, domain number,
1892  */
1893  fputi(shared_number, fd);
1894  putc('*', fd);
1895  fputi(wdomain, fd);
1896 
1897  wtt_bp = bp, wtt_dr = &dr;
1899  wtt_bp = NULL, wtt_dr = NULL;
1900 
1901  putc(')', fd);
1902 
1903  pop_gen_trav_env();
1904 
1905  /* restore the index sign which was changed to tag as seen... */
1907 
1908  return domain;
1909 }
static int write_tabulated_leaf_in(gen_chunk *obj, struct gen_binding *bp)
WRITE_TABULATED_LEAF_IN prints the OBJect of type BP.
Definition: genClib.c:1809
static void write_this_tabulated(gen_chunk *o)
Definition: genClib.c:1851
static struct driver * wtt_dr
Definition: genClib.c:1850
static struct gen_binding * wtt_bp
Definition: genClib.c:1849
int gen_type_translation_actual_to_old(int n)
backwards conversion
Definition: genClib.c:2160
static void change_sign(gen_chunk *o)
Definition: genClib.c:1858
gen_chunk * gen_tabulated_fake_object_hack(int)
WARNING: it is not reentrant...
Definition: tabulated.c:107

References driver::array_leaf, change_sign(), check_read_spec_performed, gen_binding::domain, Domains, fputi(), gen_mapc_tabulated(), gen_null(), gen_tabulated_fake_object_hack(), gen_type_translation_actual_to_old(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, pop_gen_trav_env(), push_gen_trav_env(), shared_number, shared_pointers(), driver::simple_in, driver::simple_out, user_file, write_array_leaf(), write_null(), write_obj_in(), write_obj_out(), write_simple_in(), write_simple_out(), write_tabulated_leaf_in(), write_this_tabulated(), wtt_bp, and wtt_dr.

Referenced by f95split(), save_entities(), write_tabulated_db_symbol(), write_tabulated_entity(), and write_tabulated_opcodeClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gen_write_without_sharing()

void gen_write_without_sharing ( fd  ,
obj   
)

GEN_WRITE_WITHOUT_SHARING writes the OBJect on the stream FD.

Sharing is NOT managed.

Definition at line 1777 of file genClib.c.

1780 {
1781  struct driver dr ;
1782 
1784 
1785  dr.null = write_null ;
1786  dr.leaf_out = gen_null ;
1787  dr.leaf_in = write_leaf_in ;
1788  dr.simple_in = write_simple_in ;
1789  dr.array_leaf = gen_array_leaf ;
1790  dr.simple_out = write_simple_out ;
1791  dr.obj_in = write_obj_in ;
1792  dr.obj_out = write_obj_out ;
1793 
1794  user_file = fd ;
1795 
1796  if (obj_table != (hash_table)NULL)
1797  {
1799  obj_table = (hash_table)NULL ;
1800  }
1801 
1802  fputs("0 ", fd);
1803  gen_trav_obj(obj, &dr);
1804 }

References driver::array_leaf, check_read_spec_performed, gen_array_leaf(), gen_null(), gen_trav_obj(), hash_table_free(), driver::leaf_in, driver::leaf_out, driver::null, driver::obj_in, driver::obj_out, obj_table, driver::simple_in, driver::simple_out, user_file, write_leaf_in(), write_null(), write_obj_in(), write_obj_out(), write_simple_in(), and write_simple_out().

+ Here is the call graph for this function:

◆ genspec_lex_destroy()

void genspec_lex_destroy ( )

Referenced by gen_read_spec().

+ Here is the caller graph for this function:

◆ genspec_reset_string_to_parse()

void genspec_reset_string_to_parse ( void  )

Definition at line 839 of file genspec_lex.c.

839 { string_to_parse = (char *) 0;}
static char * string_to_parse
We may parse strings or files...
Definition: genspec_lex.c:819

References string_to_parse.

Referenced by gen_read_spec().

+ Here is the caller graph for this function:

◆ genspec_set_string_to_parse()

void genspec_set_string_to_parse ( char *  s)

Definition at line 838 of file genspec_lex.c.

838 { string_to_parse = s;}

References string_to_parse.

Referenced by gen_read_spec().

+ Here is the caller graph for this function:

◆ get_decision_table()

static GenDecisionTableType* get_decision_table ( int  domain)
static

returns a decision table for the given domain.

demand driven definition of the table.

Definition at line 3062 of file genClib.c.

3064 {
3066 
3069 
3070  return(&DecisionTables[domain]);
3071 }
#define decision_table_undefined
GLOBAL VARIABLES: to deal with decision tables.
Definition: genClib.c:2853
static gen_tables DecisionTables
Definition: genClib.c:2862
static void initialize_domain_DecisionTables(int domain)
demand driven computation of the decision table to scan domain.
Definition: genClib.c:2880

References check_domain, decision_table_undefined, DecisionTables, and initialize_domain_DecisionTables().

Referenced by gen_internal_context_multi_recurse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_domain_number()

static int get_domain_number ( string  name,
int  i 
)
static

== simplified lookup? returns the index of domain name if found, looking up from i.

-1 if not found.

Definition at line 1997 of file genClib.c.

1998 {
1999  for (; i<MAX_DOMAIN; i++)
2000  {
2001  if (Domains[i].name && same_string_p(name, Domains[i].name))
2002  return i;
2003  }
2004  return -1;
2005 }
#define same_string_p(s1, s2)

References Domains, MAX_DOMAIN, and same_string_p.

Referenced by gtt_read().

+ Here is the caller graph for this function:

◆ gtt_make()

static gtt_p gtt_make ( void  )
static

returns an allocated and initialized translation table...

Definition at line 1966 of file genClib.c.

1967 {
1968  return (gtt_p) alloc(sizeof(gtt_t));
1969 }
translation tables type...
Definition: genClib.c:1929

References alloc().

Referenced by gen_type_translation_default(), and gtt_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gtt_read()

static gtt_p gtt_read ( string  filename)
static

read and setup a table from a file

temporary data structure.

set to 0

READ FILE

read data

quick check for identity

identical stuff, ok!

fprintf(stderr, "same table...\n");

else fprintf(stderr, "not same at %d: '%s':%d vs '%s':%d\n", i, items[i].name, items[i].number, Domains[i].name, i);

ELSE build conversion table... order is reversed so that dubbed externals are given the least number.

maybe some domains where not found, give them a new number... if these number are to be used, the table should be saved.

debug

Definition at line 2017 of file genClib.c.

2018 {
2019  gtt_p table;
2020  FILE * file;
2021  bool same;
2022  int i;
2023 
2024  /* temporary data structure. */
2025  struct {
2026  string name;
2027  int number;
2028  string definition;
2029  } items[MAX_DOMAIN];
2030 
2031  /* set to 0 */
2032  for (i=0; i<MAX_DOMAIN; i++)
2033  {
2034  items[i].name = NULL;
2035  items[i].number = -1;
2036  items[i].definition = NULL;
2037  }
2038 
2039  table = gtt_make();
2040 
2041  /* READ FILE */
2042  file = fopen(filename, "r");
2043 
2044  if (!file)
2045  fatal("cannot open type translation file \"%s\"\n", file);
2046 
2047  /* read data */
2048  for (i=0;
2049  i<MAX_DOMAIN &&
2050  (items[i].name = gen_read_string(file, '\t')) &&
2051  fscanf(file, "%d", &items[i].number) &&
2052  (items[i].definition = gen_read_string(file, '\n'));
2053  i++);
2054 
2055  if (i==MAX_DOMAIN && !feof(file))
2056  fatal("file translation too long, extend MAX_DOMAIN");
2057 
2058  fclose(file);
2059 
2060  /* quick check for identity */
2061  for (i=0, same=true; i<MAX_DOMAIN && same; i++)
2062  {
2063  if (items[i].number!=-1 && items[i].name)
2064  same = same_string_p(Domains[i].name, items[i].name) &&
2065  (items[i].number==i);
2066  }
2067 
2068  /* identical stuff, ok! */
2069  if (same)
2070  {
2071  /* fprintf(stderr, "same table...\n"); */
2072  gtt_table_identity(table);
2073  return table;
2074  }
2075  /* else fprintf(stderr, "not same at %d: '%s':%d vs '%s':%d\n",
2076  i, items[i].name, items[i].number, Domains[i].name, i); */
2077 
2078  fprintf(stderr, "warning: newgen compatibility mode\n");
2079  gtt_table_init(table);
2080 
2081  /* ELSE build conversion table...
2082  * order is reversed so that dubbed externals are given the least number.
2083  */
2084  for (i=MAX_DOMAIN-1; i>=0; i--)
2085  {
2086  if (items[i].name && items[i].number!=-1)
2087  {
2088  int index = get_domain_number(items[i].name, 0);
2089  if (index!=-1)
2090  {
2091  table->old_to_actual[items[i].number] = index;
2092  table->actual_to_old[index] = items[i].number;
2093  }
2094  else
2095  {
2096  fprintf(stderr, "warning, domain \"%s\" (%d) not found\n",
2097  items[i].name, items[i].number);
2098  }
2099  }
2100  }
2101 
2102  /* maybe some domains where not found, give them a new number...
2103  * if these number are to be used, the table should be saved.
2104  */
2105  for (i=0; i<MAX_DOMAIN; i++)
2106  {
2107  if (Domains[i].name && table->actual_to_old[i] == -1)
2108  {
2109  int oindex = first_available(table->old_to_actual);
2110  if (oindex==-1)
2111  fatal("too many types to allow translations, extend MAX_DOMAIN...");
2112 
2113  table->old_to_actual[oindex] = i;
2114  table->actual_to_old[i] = oindex;
2115  }
2116  }
2117 
2118  /* debug */
2119  /*
2120  fprintf(stderr, "type translation table:\n");
2121  for (i=0; i<MAX_DOMAIN; i++)
2122  fprintf(stderr, "%s %d <- %d\n",
2123  Domains[i].name? Domains[i].name: "<null>",
2124  i, table->actual_to_old[i]);
2125  */
2126 
2127  return table;
2128 }
static int get_domain_number(string name, int i)
== simplified lookup? returns the index of domain name if found, looking up from i.
Definition: genClib.c:1997
string gen_read_string(FILE *file, char upto)
returns the allocated line read, whatever its length.
Definition: genClib.c:1943
static int first_available(int t[MAX_DOMAIN])
Definition: genClib.c:2007
static void gtt_table_init(gtt_p table)
Definition: genClib.c:1971

References gtt_t::actual_to_old, Domains, fatal(), first_available(), fprintf(), gen_read_string(), get_domain_number(), gtt_make(), gtt_table_identity(), gtt_table_init(), MAX_DOMAIN, gtt_t::old_to_actual, and same_string_p.

Referenced by gen_type_translation_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gtt_table_identity()

static void gtt_table_identity ( gtt_p  table)
static

Definition at line 1982 of file genClib.c.

1983 {
1984  int i;
1985  table->identity = true;
1986  for (i=0; i<MAX_DOMAIN; i++)
1987  {
1988  table->old_to_actual[i] = i;
1989  table->actual_to_old[i] = i;
1990  }
1991 }
bool identity
Definition: genClib.c:1930

References gtt_t::actual_to_old, gtt_t::identity, MAX_DOMAIN, and gtt_t::old_to_actual.

Referenced by gen_type_translation_default(), and gtt_read().

+ Here is the caller graph for this function:

◆ gtt_table_init()

static void gtt_table_init ( gtt_p  table)
static

Definition at line 1971 of file genClib.c.

1972 {
1973  int i;
1974  table->identity = false;
1975  for (i=0; i<MAX_DOMAIN; i++)
1976  {
1977  table->old_to_actual[i] = -1;
1978  table->actual_to_old[i] = -1;
1979  }
1980 }

References gtt_t::actual_to_old, gtt_t::identity, MAX_DOMAIN, and gtt_t::old_to_actual.

Referenced by gtt_read().

+ Here is the caller graph for this function:

◆ gtt_write()

static void gtt_write ( string  filename,
gtt_p  table 
)
static

writes what the previous reads...

Definition at line 2132 of file genClib.c.

2133 {
2134  int i;
2135  FILE * file = fopen(filename, "w");
2136  message_assert("open file", file);
2137 
2138  for (i=0; i<MAX_DOMAIN; i++)
2139  if (table->actual_to_old[i]!=-1 && Domains[i].name)
2140  fprintf(file, "%s\t%d\t*\n", Domains[i].name, table->actual_to_old[i]);
2141 
2142  fclose(file);
2143 }

References gtt_t::actual_to_old, Domains, fprintf(), MAX_DOMAIN, message_assert, and gen_binding::name.

Referenced by gen_type_translation_write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_array()

static gen_chunk* init_array ( union domain dp)
static

INIT_ARRAY returns a freshly allocated array initialized according to the information in its domain DP.

OSTRICT

Definition at line 169 of file genClib.c.

170 {
171  int sizarray = array_size( dp->ar.dimensions ) ;
172  /*NOSTRICT*/
173  gen_chunk *ar = (gen_chunk *)alloc( sizeof( gen_chunk )*sizarray ) ;
174 
175  for( ; sizarray ; sizarray-- )
176  ar[ sizarray-1 ].p = gen_chunk_undefined ;
177 
178  return ar;
179 }

References alloc(), domain::ar, array_size(), domain::dimensions, and gen_chunk_undefined.

Referenced by gen_alloc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_gen_quick_recurse_tables()

static void init_gen_quick_recurse_tables ( void  )
static

GEN_READ_SPEC reads the specifications.

called by gen_read_spec, should be called by a gen_init()

This has to be used – before – any utilization of manipulation functions.

number_of_domains is first set

Definition at line 3036 of file genClib.c.

3037 {
3038  int i;
3039 
3041 
3042  /* number_of_domains is first set
3043  */
3044  for (number_of_domains=-1, i=0; i<MAX_DOMAIN; i++)
3045  if (Domains[i].domain!=NULL && Domains[i].domain->ba.type != UNDEF_DT)
3046  number_of_domains = i;
3048 
3049  if (gen_debug & GEN_DBG_RECURSE)
3050  fprintf(stderr,
3051  "[init_gen_quick_recurse_tables] %d domains\n",
3053 
3056 }
#define GEN_DBG_RECURSE
Definition: genC.h:201
static int number_of_domains
Definition: genClib.c:2858
static void initialize_DirectDomainsTable(void)
Definition: genClib.c:2991
static void initialize_DecisionTables()
Definition: genClib.c:3025
@ UNDEF_DT

References domain::ba, check_read_spec_performed, Domains, fprintf(), GEN_DBG_RECURSE, gen_debug, initialize_DecisionTables(), initialize_DirectDomainsTable(), MAX_DOMAIN, number_of_domains, domain::type, and UNDEF_DT.

Referenced by gen_read_spec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_DecisionTables()

static void initialize_DecisionTables ( )
static

Definition at line 3025 of file genClib.c.

3026 {
3027  int i;
3028 
3029  for(i=0; i<MAX_DOMAIN; i++)
3031 }

References decision_table_undefined, DecisionTables, and MAX_DOMAIN.

Referenced by init_gen_quick_recurse_tables().

+ Here is the caller graph for this function:

◆ initialize_DirectDomainsTable()

static void initialize_DirectDomainsTable ( void  )
static

?

first put falses

Definition at line 2991 of file genClib.c.

2992 {
2993  int i,j;
2994 
2996 
2997  for (i=0; i<number_of_domains; i++)
2998  {
2999  struct gen_binding *bp = &Domains[i];
3000 
3001  if (gen_debug & GEN_DBG_RECURSE)
3002  fprintf(stderr,
3003  "[initialized_DirectDomainsTable] analysing %s\n",
3004  bp->name);
3005 
3006  if( bp->name == NULL || bp == Tabulated_bp ) continue ; /* ? */
3007 
3008  /* first put falses
3009  */
3010  for (j=0; j<number_of_domains; j++)
3011  DirectDomainsTable[j][i]=false;
3012 
3014  }
3015 
3016  if (gen_debug & GEN_DBG_RECURSE)
3017  for (i=0; i<number_of_domains; i++)
3018  fprintf(stderr, "[initialized_DirectDomainsTable] %s (%d)\n",
3019  Domains[i].name, i),
3021 
3022 }
static void print_decision_table(GenDecisionTableType t)
Definition: genClib.c:2864
struct gen_binding * Tabulated_bp
pointer to tabulated domain hack
Definition: genClib.c:58
static gen_tables DirectDomainsTable
Definition: genClib.c:2861
static void initialize_domain_DirectDomainsTable(int target, union domain *dp)
walks thru the domain to tag all types for target.
Definition: genClib.c:2952

References check_read_spec_performed, DirectDomainsTable, gen_binding::domain, Domains, fprintf(), GEN_DBG_RECURSE, gen_debug, initialize_domain_DirectDomainsTable(), gen_binding::name, number_of_domains, print_decision_table(), and Tabulated_bp.

Referenced by init_gen_quick_recurse_tables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_domain_DecisionTables()

static void initialize_domain_DecisionTables ( int  domain)
static

demand driven computation of the decision table to scan domain.

this table is computed by a closure from the initial type matrix

the algorithm is straightforward. tabulated domains are skipped. worst case complexity if O(n^2) for each requested domain. the closure is shorten because already computed tables are used.

init with direct inclusions

now the closure is computed

look for the next domain to include

none

cannot come from tabulated domains... this should be discussed, or put as a parameter...

shorten

false : not_used[j]

Definition at line 2880 of file genClib.c.

2881 {
2882  GenDecisionTableType not_used;
2883  int i, j;
2884 
2885  if (gen_debug & GEN_DBG_RECURSE)
2886  fprintf(stderr,
2887  "[initialize_domain_DecisionTables] domain %s (%d)\n",
2888  Domains[domain].name, domain);
2889 
2890  for (i=0; i<number_of_domains; i++)
2891  not_used[i] = true;
2892 
2893  /* init with direct inclusions
2894  */
2895  for (i=0; i<number_of_domains; i++)
2897 
2898  not_used[domain]=false;
2899 
2900  /* now the closure is computed
2901  */
2902 
2903  while(1)
2904  {
2905  /* look for the next domain to include
2906  */
2907  for (i=0; i<number_of_domains; i++)
2908  if (DecisionTables[domain][i] & not_used[i])
2909  break;
2910 
2911  if (i>=number_of_domains) break; /* none */
2912 
2913  not_used[i] = false;
2914 
2915  /* cannot come from tabulated domains...
2916  * this should be discussed, or put as a parameter...
2917  */
2918  if (IS_TABULATED(&Domains[i])) continue;
2919 
2921  {
2922  /* shorten */
2923  if (gen_debug & GEN_DBG_RECURSE)
2924  fprintf(stderr,
2925  " - shortening with already computed %s (%d)\n",
2926  Domains[i].name, i);
2927 
2928  for (j=0; j<number_of_domains; j++)
2929  DecisionTables[domain][j] |= DecisionTables[i][j],
2930  not_used[j] &= !DecisionTables[i][j] /*? false : not_used[j] */;
2931  }
2932  else
2933  {
2934  if (gen_debug & GEN_DBG_RECURSE)
2935  fprintf(stderr,
2936  " - including %s (%d)\n",
2937  Domains[i].name, i);
2938 
2939  for (j=0; j<number_of_domains; j++)
2941  }
2942  }
2943 
2944  if (gen_debug & GEN_DBG_RECURSE)
2945  fprintf(stderr, " - computed table is\n"),
2947 }
char GenDecisionTableType[MAX_DOMAIN]
Definition: genClib.c:2854

References decision_table_undefined, DecisionTables, DirectDomainsTable, Domains, fprintf(), GEN_DBG_RECURSE, gen_debug, IS_TABULATED, number_of_domains, and print_decision_table().

Referenced by get_decision_table().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_domain_DirectDomainsTable()

static void initialize_domain_DirectDomainsTable ( int  target,
union domain dp 
)
static

walks thru the domain to tag all types for target.

some domains are NULL

obvious: don't go inside externals!

abort() ? true (safe) ?

nothing is done

Definition at line 2952 of file genClib.c.

2955 {
2956  if (dp==NULL) return; /* some domains are NULL */
2957 
2958  switch(dp->ba.type)
2959  {
2960  case EXTERNAL_DT:
2961  break; /* obvious: don't go inside externals! */
2962  case BASIS_DT:
2963  case LIST_DT:
2964  case ARRAY_DT:
2965  case SET_DT:
2966  if (gen_debug & GEN_DBG_RECURSE)
2967  fprintf(stderr,
2968  " - setting %s (%d) contains %s (%zd)\n",
2969  Domains[target].name, target,
2970  dp->se.element->name, dp->se.element-Domains);
2971  DirectDomainsTable[dp->se.element-Domains][target] = true;
2972  break;
2973  case CONSTRUCTED_DT:
2974  {
2975  struct domainlist *l=dp->co.components;
2976 
2977  for (; l!=NULL; l=l->cdr)
2978  initialize_domain_DirectDomainsTable(target, l->domain);
2979  }
2980  case IMPORT_DT:
2981  break; /* abort() ? true (safe) ? */
2982  case UNDEF_DT:
2983  break; /* nothing is done */
2984  default:
2985  fprintf(stderr, "newgen: unexpected domain type (%d)\n", dp->ba.type),
2986  abort();
2987  }
2988 }

References abort, ARRAY_DT, domain::ba, BASIS_DT, domain::co, domain::components, CONSTRUCTED_DT, DirectDomainsTable, Domains, domain::element, EXTERNAL_DT, fprintf(), GEN_DBG_RECURSE, gen_debug, IMPORT_DT, LIST_DT, gen_binding::name, domain::se, SET_DT, domain::type, and UNDEF_DT.

Referenced by initialize_DirectDomainsTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newgen_domain_index()

int newgen_domain_index ( gen_chunk obj)

DOMAIN_INDEX returns the index in the Domain table for object OBJ.

Definition at line 105 of file genClib.c.

106 {
107  message_assert("No NULL object", obj!=NULL);
108  message_assert("No undefined object", obj!=gen_chunk_undefined);
109  if ((obj->i)<0 || (obj->i)>=MAX_DOMAIN)
110  fatal("Inconsistent domain number %d (%p) found\n",
111  obj->i, obj);
112  return obj->i;
113 }

References fatal(), gen_chunk_undefined, gen_chunk::i, MAX_DOMAIN, and message_assert.

+ Here is the call graph for this function:

◆ newgen_start_lexer()

void newgen_start_lexer ( FILE *  in)

starting the scanner.

Definition at line 822 of file genread_lex.c.

823 {
824  if (in) { yyin = in; }
825  newgen_char_number = 0;
826  newgen_line_number = 1;
827  newgen_col_number = 0;
828  newgen_lex_number = 0;
829 }
static size_t newgen_char_number
Definition: genread_lex.c:818
static size_t newgen_lex_number
Definition: genread_lex.c:820
static size_t newgen_col_number
Definition: genread_lex.c:819
#define yyin
Definition: genread_lex.c:21
static size_t newgen_line_number
Definition: genread_lex.c:817

References newgen_char_number, newgen_col_number, newgen_lex_number, newgen_line_number, and yyin.

Referenced by gen_read(), gen_read_spec(), and gen_read_tabulated().

+ Here is the caller graph for this function:

◆ open_black_hole()

static void open_black_hole ( )
static

not reached

Definition at line 2387 of file genClib.c.

2388 {
2389  if (black_hole == NULL)
2390  if ((black_hole=fopen("/dev/null", "r")) == NULL)
2391  fatal("Cannot open /dev/null !") ; /* not reached */
2392 }

References black_hole, and fatal().

Referenced by gen_consistent_p(), and gen_defined_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ persistant_simple_in()

static int persistant_simple_in ( obj  ,
dp   
)
static

GEN_LOCAL_FREE frees the object OBJ with or without KEEPing the sharing.

???

just to avoid a gcc warning

Definition at line 950 of file genClib.c.

953 {
954  switch( dp->ba.type ) {
955  case BASIS_DT:
956  return( !dp->ba.persistant && obj->i) ; /* ??? */
957  case LIST_DT:
958  return( !dp->li.persistant && obj->l && obj->l != list_undefined ) ;
959  case SET_DT:
960  return( !dp->se.persistant && obj->t && obj->t != set_undefined ) ;
961  case ARRAY_DT:
962  return( !dp->ar.persistant && obj->p && obj->p != array_undefined ) ;
963  default:
964  break;
965  }
966  fatal( "persistant_simple_in: unknown type %s\n", i2a( dp->ba.type )) ;
967 
968  return(-1); /* just to avoid a gcc warning */
969 }

References domain::ar, ARRAY_DT, array_undefined, domain::ba, BASIS_DT, fatal(), gen_chunk::i, i2a(), gen_chunk::l, domain::li, LIST_DT, list_undefined, gen_chunk::p, domain::persistant, domain::se, SET_DT, set_undefined, gen_chunk::t, and domain::type.

Referenced by gen_free(), and sharing_simple_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop_gen_trav_env()

static void pop_gen_trav_env ( )
static

Definition at line 827 of file genClib.c.

828 {
829  struct gen_trav_env *env ;
830 
831  message_assert("Too many pops", gen_trav_env_top >= 0);
832 
836 
838  seen_once = env->seen_once ;
839  obj_table = env->obj_table ;
840  shared_number = env->shared_number ;
841 }
static char * first_seen
Definition: genClib.c:634
static char * seen_once
Definition: genClib.c:635
struct gen_trav_env gen_trav_envs[MAX_GEN_TRAV_ENV]
static int gen_trav_env_top
Definition: genClib.c:799

References env, first_seen, gen_trav_env_top, gen_trav_envs, hash_table_free(), message_assert, newgen_free, obj_table, seen_once, and shared_number.

Referenced by gen_defined_p(), gen_sharing_p(), gen_write(), and gen_write_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_decision_table()

static void print_decision_table ( GenDecisionTableType  t)
static

Definition at line 2864 of file genClib.c.

2865 {
2866  int i;
2867  fprintf(stderr, "[print_decision_table] %p\n", t);
2868  for (i=0; i<MAX_DOMAIN; i++)
2869  if (t[i]) fprintf(stderr, " go through %s\n", Domains[i].name);
2870 }

References Domains, fprintf(), and MAX_DOMAIN.

Referenced by initialize_DirectDomainsTable(), and initialize_domain_DecisionTables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ push_gen_trav_env()

static void push_gen_trav_env ( )
static

Definition at line 808 of file genClib.c.

809 {
810  struct gen_trav_env *env ;
811 
812  message_assert("Too many recursive gen_trav",
814 
816  env->first_seen = first_seen ;
817  env->seen_once = seen_once ;
818  env->obj_table = obj_table ;
819  env->shared_number = shared_number ;
820 
821  first_seen = (char *)alloc( MAX_SHARED_OBJECTS ) ;
822  seen_once = (char *)alloc( MAX_SHARED_OBJECTS ) ;
824  shared_number = 0 ;
825 }
#define MAX_SHARED_OBJECTS
These functions computes an hash table of object pointers (to be used to manage sharing when dealing ...
Definition: genClib.c:632
#define MAX_GEN_TRAV_ENV
GEN_TRAV_ENVS are stacked to allow recursive calls to GEN_TRAV_OBJ (cf.
Definition: genClib.c:797

References alloc(), env, first_seen, gen_trav_env_top, gen_trav_envs, hash_pointer, hash_table_make(), MAX_GEN_TRAV_ENV, MAX_SHARED_OBJECTS, message_assert, obj_table, seen_once, and shared_number.

Referenced by gen_defined_p(), gen_sharing_p(), gen_write(), and gen_write_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quick_multi_already_seen_p()

static bool quick_multi_already_seen_p ( gen_chunk obj)
static

true if obj was already seen in this recursion.

also record ancestor on the fly.

Definition at line 3144 of file genClib.c.

3145 {
3146  if (hash_defined_p(current_mrc->seen, obj))
3147  return true;
3148 
3150  return false;
3151 }
static struct multi_recurse * current_mrc
the current multi recurse driver.
Definition: genClib.c:3137
void * stack_head(const stack)
returns the item on top of stack s
Definition: stack.c:420
stack upwards
Definition: genClib.c:3125
hash_table seen
Definition: genClib.c:3111

References current_mrc, hash_defined_p(), hash_put(), multi_recurse::seen, stack_head(), and multi_recurse::upwards.

Referenced by quick_multi_recurse_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quick_multi_recurse_obj_in()

static int quick_multi_recurse_obj_in ( gen_chunk obj,
__attribute__((unused)) struct driver dr 
)
static

Definition at line 3154 of file genClib.c.

3156 {
3157  int dom = obj->i, go = !GO;
3158  check_domain(dom);
3159 
3160  // don't walk twice thru the same object:
3161  if (quick_multi_already_seen_p(obj))
3162  return !GO;
3163 
3164  // tabulated objects are not walked thru.
3165  // the decision could be managed by the table, or *after* the
3166  // filtering: the current status implied that you cannot enumerate
3167  // tabulated elements for instance.
3168  //
3169  // these features/bugs/limitations are compatible with gen_slow_recurse.
3170  //
3171  // FI told me that only persistant edges shouldn't be followed.
3172  // it may mean that tabulated elements are always persistent?
3173  if (!current_mrc->always_recurse &&
3175  return !GO;
3176 
3177  // set current object for call
3178  current_mrc->current = obj;
3179 
3180  // filter case, tell whether to apply rewrite
3181  // it should be different from recurring down...
3182  if ((*(current_mrc->domains))[dom])
3183  go = (*((*(current_mrc->filters))[dom]))(obj, current_mrc->context);
3184  else
3185  // else, here is the *maybe* intelligent decision to be made.
3186  go = current_mrc->always_recurse || (*(current_mrc->decisions))[dom];
3187 
3188  // else push current object before continuing the recursion downwards
3189  if (go) stack_push(obj, current_mrc->upwards);
3190 
3191  // we have just visited this one (downwards)
3192  current_mrc->previous = obj;
3193  current_mrc->current = NULL;
3194 
3195  return go;
3196 }
static bool quick_multi_already_seen_p(gen_chunk *obj)
true if obj was already seen in this recursion.
Definition: genClib.c:3144
void stack_push(void *, stack)
stack use
Definition: stack.c:373
gen_chunk * previous
Definition: genClib.c:3127
bool always_recurse
Definition: genClib.c:3114
GenFilterTableType * filters
Definition: genClib.c:3120
GenDecisionTableType * decisions
Definition: genClib.c:3118
GenDecisionTableType * domains
Definition: genClib.c:3116
gen_chunk * current
Definition: genClib.c:3129
void * context
Definition: genClib.c:3123

References multi_recurse::always_recurse, check_domain, multi_recurse::context, multi_recurse::current, current_mrc, multi_recurse::decisions, multi_recurse::domains, Domains, multi_recurse::filters, GO, gen_chunk::i, IS_TABULATED, multi_recurse::previous, quick_domain_index, quick_multi_already_seen_p(), stack_push(), and multi_recurse::upwards.

Referenced by gen_internal_context_multi_recurse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quick_multi_recurse_obj_out()

static void quick_multi_recurse_obj_out ( gen_chunk obj,
__attribute__((unused)) struct gen_binding bp,
__attribute__((unused)) struct driver dr 
)
static

Definition at line 3199 of file genClib.c.

3202 {
3203  int dom = obj->i;
3204  check_domain(dom);
3205 
3206  // pop before calling rewrite function, so that the current ancestor
3207  // should is the right one, not the current object
3208  gen_chunk * popped = stack_pop(current_mrc->upwards);
3209  message_assert("pop myself", popped==obj);
3210 
3211  // set current object before call
3212  current_mrc->current = obj;
3213 
3214  // now call the rewrite function
3215  if ((*(current_mrc->domains))[dom])
3216  (*((*(current_mrc->rewrites))[dom]))(obj, current_mrc->context);
3217 
3218  // we have just visited this one (upwards)
3219  current_mrc->previous = obj;
3220  current_mrc->current = NULL;
3221 }
void * stack_pop(stack)
POPs one item from stack s.
Definition: stack.c:399
GenRewriteTableType * rewrites
Definition: genClib.c:3121

References check_domain, multi_recurse::context, multi_recurse::current, current_mrc, multi_recurse::domains, gen_chunk::i, message_assert, multi_recurse::previous, multi_recurse::rewrites, stack_pop(), and multi_recurse::upwards.

Referenced by gen_internal_context_multi_recurse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quick_multi_recurse_simple_in()

static int quick_multi_recurse_simple_in ( gen_chunk obj,
union domain dp 
)
static

Definition at line 3224 of file genClib.c.

3225 {
3226  int t;
3227  return
3229  (*(current_mrc->decisions))[dp->se.element-Domains] ||
3230  (*(current_mrc->domains))[dp->se.element-Domains]) &&
3231  (current_mrc->always_recurse || !dp->se.persistant) && // stay at level
3232  ((t=dp->ba.type)==BASIS_DT ? true :
3233  t==LIST_DT ? obj->l != list_undefined :
3234  t==SET_DT ? obj->t != set_undefined :
3235  t==ARRAY_DT ? obj->p != array_undefined :
3236  (fatal("persistant_simple_in: unknown type %s\n",
3237  i2a(dp->ba.type)), false));
3238 }

References multi_recurse::always_recurse, ARRAY_DT, array_undefined, domain::ba, BASIS_DT, current_mrc, multi_recurse::decisions, multi_recurse::domains, Domains, domain::element, fatal(), i2a(), gen_chunk::l, LIST_DT, list_undefined, gen_chunk::p, domain::persistant, domain::se, SET_DT, set_undefined, gen_chunk::t, true, and domain::type.

Referenced by gen_internal_context_multi_recurse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shared_obj()

static int shared_obj ( obj  ,
void (*)()  first,
void (*)()  others 
)
static

SHARED_OBJ manages the OBJect modulo sharing (the OBJ_TABLE has to be set first, see above).

If the object isn't shared, don't do nothing. else, if that's the first appearance, call FIRST and go on, else call OTHERS. If the obj_table isn't defined, recurse.

Definition at line 764 of file genClib.c.

768 {
769  char *shared ;
770  int shared_number ;
771 
772  message_assert("Defined obj_table", obj_table!=(hash_table)NULL);
773 
774  shared = hash_get( obj_table, (char *)obj);
775 
776  if(shared==HASH_UNDEFINED_VALUE || shared == first_seen )
777  return(!GO) ;
778  else
779  if( FIRST_SEEN( shared ))
780  {
781  (*first)( shared_number = shared-first_seen ) ;
782  hash_update( obj_table, (char *)obj, seen_once+shared_number ) ;
783  return( !GO) ;
784  }
785  else
786  {
787  (*others)( shared - seen_once ) ;
788  return( GO) ;
789  }
790 }
#define FIRST_SEEN(s)
Definition: genClib.c:637
void hash_update(hash_table htp, const void *key, const void *val)
update key->val in htp, that MUST be pre-existent.
Definition: hash.c:491

References first_seen, FIRST_SEEN, GO, hash_get(), HASH_UNDEFINED_VALUE, hash_update(), message_assert, obj_table, seen_once, and shared_number.

Referenced by sharing_obj_in(), and write_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shared_obj_in()

static int shared_obj_in ( gen_chunk obj,
struct driver dr 
)
static

SHARED_OBJ_IN introduces an object OBJ in the OBJ_TABLE.

If it is already in the table, don't recurse (at least, if you want to avoid an infinite loop) and give it a number. Else recurse.

Definition at line 670 of file genClib.c.

671 {
672  void * seen = hash_get(obj_table, obj);
673  message_assert("argument not used", dr==dr);
674 
676  {
677  if(seen == first_seen)
678  {
679  shared_number++;
680  message_assert("shared table not full",
682 
684  }
685  return(!GO) ;
686  }
687 
688  hash_put(obj_table, obj, first_seen ) ;
689  return GO;
690 }
static hash_table seen
static function to store whether a module has been seen during the recursive generation of the daVinc...
Definition: graph.c:85

References first_seen, GO, hash_get(), hash_put(), HASH_UNDEFINED_VALUE, hash_update(), MAX_SHARED_OBJECTS, message_assert, obj_table, seen, and shared_number.

Referenced by shared_pointers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shared_pointers()

static void shared_pointers ( obj  ,
keep   
)
static

SHARED_POINTERS creates (in OBJ_TABLE) the association between objects and their numbers (!= 0 if sharing).

Inlined values are NOT considered to be shared (neither list and arrays), just objects (i.e. objects which have a user name, a spec in Domains). KEEP says whether the previous sharing table is preserved.

else the obj_table is kept as it is.

Definition at line 734 of file genClib.c.

737 {
738  struct driver dr ;
739 
740  dr.null = dr.leaf_out = dr.simple_out = dr.obj_out = gen_null ;
741  dr.obj_in = shared_obj_in ;
742  dr.simple_in = shared_simple_in ;
743  dr.array_leaf = gen_array_leaf ;
744  dr.leaf_in = tabulated_leaf_in ;
745 
746  message_assert("obj_table not null", obj_table!=(hash_table)NULL);
747 
748  if(!keep) {
750  shared_number = 0 ;
751  }
752  /* else the obj_table is kept as it is.
753  */
754 
755  gen_trav_obj( obj, &dr ) ;
756 }
static int shared_obj_in(gen_chunk *obj, struct driver *dr)
SHARED_OBJ_IN introduces an object OBJ in the OBJ_TABLE.
Definition: genClib.c:670
static int shared_simple_in(obj, dp)
Definition: genClib.c:693
void(* null)()
Definition: genClib.c:366

References driver::array_leaf, gen_array_leaf(), gen_null(), gen_trav_obj(), hash_table_clear(), keep, driver::leaf_in, driver::leaf_out, message_assert, driver::null, driver::obj_in, driver::obj_out, obj_table, shared_number, shared_obj_in(), shared_simple_in(), driver::simple_in, driver::simple_out, and tabulated_leaf_in().

Referenced by gen_defined_p(), gen_sharing_p(), gen_write(), and gen_write_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shared_simple_in()

static int shared_simple_in ( obj  ,
dp   
)
static

just to avoid a gcc warning

Definition at line 693 of file genClib.c.

696 {
697  switch( dp->ba.type ) {
698  case BASIS_DT:
699  return( !dp->ba.persistant ) ;
700  case LIST_DT: {
701  cons *p ;
702 
703  if( obj->l == list_undefined ) {
704  return( !GO) ;
705  }
706  for( p=obj->l ; p!=NIL ; p=p->cdr )
707  {
708  message_assert("no sharing of cons",
709  hash_get(obj_table, (char *)p) == HASH_UNDEFINED_VALUE);
710 
711  hash_put(obj_table, (char *)p, (char *)p);
712  }
713  return( !dp->li.persistant ) ;
714  }
715  case SET_DT:
716  return( !dp->se.persistant ) ;
717  case ARRAY_DT:
718  return( !dp->ar.persistant ) ;
719  default:
720  break;
721  }
722  fatal( "shared_simple_in: unknown type %s\n", i2a( dp->ba.type )) ;
723 
724  return(-1); /* just to avoid a gcc warning */
725 }

References domain::ar, ARRAY_DT, domain::ba, BASIS_DT, cons::cdr, fatal(), GO, hash_get(), hash_put(), HASH_UNDEFINED_VALUE, i2a(), gen_chunk::l, domain::li, LIST_DT, list_undefined, message_assert, NIL, obj_table, domain::persistant, domain::se, SET_DT, and domain::type.

Referenced by shared_pointers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sharing_obj_in()

static int sharing_obj_in ( gen_chunk obj,
struct driver dr 
)
static

Definition at line 2485 of file genClib.c.

2486 {
2487  message_assert("argument not used", dr==dr);
2488 
2489  if (shared_obj(obj, gen_null, gen_null))
2490  return !GO;
2491 
2493  return !GO;
2494 
2495  check_sharing((char *)obj, "CHUNK *");
2496  return GO;
2497 }
static int shared_obj(obj, void(*first)(), void(*others)())
SHARED_OBJ manages the OBJect modulo sharing (the OBJ_TABLE has to be set first, see above).
Definition: genClib.c:764
static bool check_sharing(char *p, char *type)
Definition: genClib.c:2475

References check_sharing(), Domains, gen_null(), GO, IS_TABULATED, message_assert, quick_domain_index, and shared_obj().

Referenced by gen_sharing_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sharing_simple_in()

static int sharing_simple_in ( gen_chunk obj,
union domain dp 
)
static

Definition at line 2499 of file genClib.c.

2500 {
2501  cons *p ;
2502 
2503  switch( dp->ba.type ) {
2504  case LIST_DT:
2505  if( obj->l == list_undefined ) {
2506  return( !GO) ;
2507  }
2508  for( p=obj->l ; p!=NIL ; p=p->cdr ) {
2509  check_sharing( (char *)p, "CONS *" ) ;
2510  }
2511  default:
2512  break;
2513  }
2514  return( persistant_simple_in( obj, dp )) ;
2515 }

References domain::ba, cons::cdr, check_sharing(), GO, gen_chunk::l, LIST_DT, list_undefined, NIL, persistant_simple_in(), and domain::type.

Referenced by gen_sharing_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tabulated_leaf_in()

static int tabulated_leaf_in ( gen_chunk obj,
struct gen_binding bp 
)
static

Definition at line 620 of file genClib.c.

621 {
622  message_assert("argument not used", obj==obj);
623  return(!IS_TABULATED(bp));
624 }

References IS_TABULATED, and message_assert.

Referenced by gen_internal_context_multi_recurse(), gen_local_copy_tree(), gen_sharing_p(), and shared_pointers().

+ Here is the caller graph for this function:

◆ void_gen_consistent_p()

static void void_gen_consistent_p ( gen_chunk obj)
static

for side effects only

Definition at line 2415 of file genClib.c.

2416 {
2417  (void) gen_consistent_p(obj);
2418 }
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
Definition: genClib.c:2398

References gen_consistent_p().

Referenced by gen_tabulated_consistent_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_array_leaf()

static void write_array_leaf ( struct gen_binding bp,
int  i,
gen_chunk obj,
struct driver dr 
)
static

WRITE_ARRAY_LEAF only writes non-null elements, in a sparse way.

write array index

write array value at index

Definition at line 1703 of file genClib.c.

1708 {
1709  if( IS_INLINABLE( bp ) || IS_EXTERNAL( bp )) {
1710  gen_trav_leaf( bp, obj, dr ) ;
1711  }
1712  else if (obj->p != gen_chunk_undefined)
1713  {
1714  fputi(i, user_file); /* write array index */
1715  gen_trav_leaf(bp, obj, dr); /* write array value at index */
1716  }
1717 }

References fputi(), gen_chunk_undefined, gen_trav_leaf(), IS_EXTERNAL, IS_INLINABLE, gen_chunk::p, and user_file.

Referenced by gen_write(), and gen_write_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_define_shared_node()

static void write_define_shared_node ( int  n)
static

WRITE_DEFINE_SHARED_NODE defines the node whose number is N.

Definition at line 1500 of file genClib.c.

1501 {
1502  fputci('[', n, user_file);
1503 }
static void fputci(char c, int i, FILE *f)
Definition: genClib.c:1492

References fputci(), and user_file.

Referenced by write_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_leaf_in()

static int write_leaf_in ( gen_chunk obj,
struct gen_binding bp 
)
static

WRITE_LEAF_IN prints the OBJect of type BP.

If it is inlined, prints it according to the format, else recurse.

references are by name. The number may can be changed...

hummm...

Definition at line 1612 of file genClib.c.

1613 {
1614  if(IS_TABULATED(bp))
1615  {
1616  if( obj->p == gen_chunk_undefined ) {
1618  {
1619  user("gen_write: writing undefined tabulated object\n", NULL);
1620  }
1621  else
1622  {
1623  (void) fputc('N', user_file);
1624  }
1625  }
1626  else {
1627  /* references are by name. The number may can be changed...
1628  */
1629  int type_number = gen_type_translation_actual_to_old(bp-Domains);
1630  fputci('R', type_number, user_file);
1631  write_string("\"", (obj->p+HASH_OFFSET)->s, "\" ", "_", "!") ;
1632  }
1633  return !GO;
1634  }
1635  else if( IS_INLINABLE( bp )) {
1636  /* hummm... */
1637  if (IS_UNIT_TYPE(bp-Domains))
1638  putc('U', user_file);
1639  else if (IS_BOOL_TYPE(bp-Domains))
1640  fputci('B', obj->b, user_file);
1641  else if (IS_INT_TYPE(bp-Domains))
1642  fputi(obj->i, user_file);
1643  else if (IS_FLOAT_TYPE(bp-Domains))
1644  (void) fprintf(user_file, "%f", obj->f) ;
1645  else if (IS_STRING_TYPE(bp-Domains))
1646  write_string( "\"", obj->s, "\"", "_", "!") ;
1647  else
1648  fatal( "write_leaf_in: Don't know how to print %s\n", bp->name ) ;
1649  }
1650  else if( IS_EXTERNAL( bp )) {
1651  int type_number;
1652  if( bp->domain->ex.write == NULL ) {
1653  user("gen_write: uninitialized external type %s (%d)\n",
1654  bp->name, bp-Domains);
1655  return !GO;
1656  }
1657  type_number = gen_type_translation_actual_to_old(bp-Domains);
1658  fputci('E', type_number, user_file);
1659  (*(bp->domain->ex.write))(user_file, obj->s);
1660  }
1661  return( GO) ;
1662 }
static int disallow_undefined_tabulated
Default option in GEN_WRITE.
Definition: genClib.c:74
static void write_string(string init, string s, string end, string ifnull, string ifundefined)
Definition: genClib.c:1580
#define IS_FLOAT_TYPE(n)
#define IS_BOOL_TYPE(n)
#define IS_UNIT_TYPE(n)
#define IS_STRING_TYPE(n)
#define IS_INT_TYPE(n)
float f
Definition: genC.h:63
bool b
Definition: genC.h:60
string s
Definition: genC.h:64

References gen_chunk::b, disallow_undefined_tabulated, gen_binding::domain, Domains, domain::ex, gen_chunk::f, fatal(), fprintf(), fputci(), fputi(), gen_chunk_undefined, gen_type_translation_actual_to_old(), GO, HASH_OFFSET, gen_chunk::i, IS_BOOL_TYPE, IS_EXTERNAL, IS_FLOAT_TYPE, IS_INLINABLE, IS_INT_TYPE, IS_STRING_TYPE, IS_TABULATED, IS_UNIT_TYPE, gen_binding::name, gen_chunk::p, gen_chunk::s, user(), user_file, domain::write, and write_string().

Referenced by gen_defined_p(), gen_write(), gen_write_without_sharing(), and write_tabulated_leaf_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_null()

static void write_null ( struct gen_binding bp)
static

Definition at line 1512 of file genClib.c.

1513 {
1514  message_assert("argument not used", bp==bp);
1515  putc('N', user_file);
1516 }

References message_assert, and user_file.

Referenced by gen_write(), gen_write_tabulated(), gen_write_without_sharing(), and write_tabulated_leaf_in().

+ Here is the caller graph for this function:

◆ write_obj_in()

static int write_obj_in ( gen_chunk obj,
struct driver dr 
)
static

WRITE_OBJ_IN writes the OBJect of type BP.

We first prints its type (its index in the Domains table), its tag (for OR_OP types) and then ... let's do the recursion.

tabulated number is skipped...

tag...

Definition at line 1522 of file genClib.c.

1523 {
1524  struct gen_binding *bp = &Domains[ quick_domain_index( obj ) ] ;
1525  union domain *dp = bp->domain ;
1526  int data = 1+IS_TABULATED( bp ) ;
1527  int type_number;
1528 
1529  message_assert("argument not used", dr==dr);
1530 
1532  return( !GO) ;
1533 
1534  type_number = gen_type_translation_actual_to_old(bp-Domains);
1535  fputci('T', type_number, user_file);
1536 
1537  /* tabulated number is skipped... */
1538 
1539  switch( dp->ba.type ) {
1540  case EXTERNAL_DT:
1541  fatal( "write_obj_in: Don't know how to write an EXTERNAL: %s\n",
1542  bp->name ) ;
1543  break ;
1544  case CONSTRUCTED_DT:
1545  if (dp->co.op == OR_OP)
1546  fputi((obj+data)->i, user_file); /* tag... */
1547  else if(dp->co.op == ARROW_OP) {
1548  putc('%', user_file) ;
1549  }
1550  break ;
1551  default:
1552  break;
1553  }
1554  return GO;
1555 }
static void write_define_shared_node(int n)
WRITE_DEFINE_SHARED_NODE defines the node whose number is N.
Definition: genClib.c:1500
static void write_shared_node(int n)
WRITE_SHARED_NODE references a shared node N.
Definition: genClib.c:1507

References ARROW_OP, domain::ba, domain::co, CONSTRUCTED_DT, gen_binding::domain, Domains, EXTERNAL_DT, fatal(), fputci(), fputi(), gen_type_translation_actual_to_old(), GO, IS_TABULATED, message_assert, gen_binding::name, domain::op, OR_OP, quick_domain_index, shared_obj(), domain::type, user_file, write_define_shared_node(), and write_shared_node().

Referenced by gen_defined_p(), gen_write(), gen_write_tabulated(), and gen_write_without_sharing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_obj_out()

static void write_obj_out ( gen_chunk obj,
struct gen_binding bp,
struct driver dr 
)
static

WRITE_OBJ_OUT is done when the OBJect (of type BP) has been printed.

Just close the opening parenthese.

Definition at line 1560 of file genClib.c.

1563 {
1564  union domain * dp = bp->domain ;
1565 
1566  message_assert("argument not used", dr==dr && obj==obj);
1567 
1568  switch (dp->ba.type) {
1569  case CONSTRUCTED_DT:
1570  if( dp->co.op == ARROW_OP ) {
1571  putc(')', user_file);
1572  }
1573  break ;
1574  default:
1575  break;
1576  }
1577  putc(')', user_file);
1578 }

References ARROW_OP, domain::ba, domain::co, CONSTRUCTED_DT, gen_binding::domain, message_assert, domain::op, domain::type, and user_file.

Referenced by gen_defined_p(), gen_write(), gen_write_tabulated(), and gen_write_without_sharing().

+ Here is the caller graph for this function:

◆ write_shared_node()

static void write_shared_node ( int  n)
static

WRITE_SHARED_NODE references a shared node N.

Definition at line 1507 of file genClib.c.

1508 {
1509  fputci('H', n, user_file);
1510 }

References fputci(), and user_file.

Referenced by write_obj_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_simple_in()

static int write_simple_in ( obj  ,
dp   
)
static

WRITE_SIMPLE_IN is done before printing a simple OBJect of type DP.

The sharing of basis objects will be done later.

Definition at line 1668 of file genClib.c.

1671 {
1672  switch( dp->ba.type ) {
1673  case LIST_DT:
1674  if( obj->l == list_undefined ) {
1675  putc('L', user_file);
1676  return !GO;
1677  }
1678  putc('(', user_file);
1679  break ;
1680  case SET_DT:
1681  if( obj->t == set_undefined ) {
1682  putc('S', user_file);
1683  return( !GO) ;
1684  }
1685  fputci('{', dp->se.what, user_file);
1686  break ;
1687  case ARRAY_DT:
1688  if( obj->p == array_undefined ) {
1689  putc('A', user_file);
1690  return !GO;
1691  }
1692  fputci('$', array_size(dp->ar.dimensions), user_file);
1693  break ;
1694  default:
1695  break;
1696  }
1697  return GO;
1698 }

References domain::ar, ARRAY_DT, array_size(), array_undefined, domain::ba, domain::dimensions, fputci(), GO, gen_chunk::l, LIST_DT, list_undefined, gen_chunk::p, domain::se, SET_DT, set_undefined, gen_chunk::t, domain::type, user_file, and domain::what.

Referenced by gen_defined_p(), gen_write(), gen_write_tabulated(), and gen_write_without_sharing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_simple_out()

static void write_simple_out ( gen_chunk obj,
union domain dp 
)
static

WRITE_LEAF_OUT prints the closing parenthesis of (non-basis) simple OBJect of type DP.

RGSUSED

Definition at line 1724 of file genClib.c.

1725 {
1726  message_assert("argument not used", obj==obj);
1727 
1728  switch( dp->ba.type ) {
1729  case SET_DT:
1730  putc('}', user_file);
1731  break ;
1732  case LIST_DT:
1733  case ARRAY_DT:
1734  putc(')', user_file);
1735  break ;
1736  default:
1737  break;
1738  }
1739 }

References ARRAY_DT, domain::ba, LIST_DT, message_assert, SET_DT, domain::type, and user_file.

Referenced by gen_defined_p(), gen_write(), gen_write_tabulated(), and gen_write_without_sharing().

+ Here is the caller graph for this function:

◆ write_string()

static void write_string ( string  init,
string  s,
string  end,
string  ifnull,
string  ifundefined 
)
static

else

Definition at line 1580 of file genClib.c.

1585 {
1586  if (!s)
1587  {
1588  if (ifnull)
1589  fputs(ifnull, user_file);
1590  else
1591  user("null string not allowed");
1592  return;
1593  }
1594  else if (string_undefined_p(s))
1595  {
1596  fputs(ifundefined, user_file);
1597  return;
1598  }
1599  /* else */
1600  fputs(init, user_file);
1601  for(; *s != '\0' ; s++)
1602  {
1603  if (*s=='"' || *s=='\\') putc('\\', user_file);
1604  putc(*s, user_file);
1605  }
1606  fputs(end, user_file);
1607 }
char end
Definition: gtk_status.c:82

References end, init, string_undefined_p, user(), and user_file.

Referenced by write_leaf_in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_tabulated_leaf_in()

static int write_tabulated_leaf_in ( gen_chunk obj,
struct gen_binding bp 
)
static

WRITE_TABULATED_LEAF_IN prints the OBJect of type BP.

If it is tabulated, then recurse.

boum! why?

fprintf(stderr, "writing %d %s\n", number, (obj->p+HASH_OFFSET)->s);

once written the domain number sign is inverted, to tag the object has been written, so that its definition is not written twice on disk. The second time a simple reference is written instead. beurk. FC.

Definition at line 1809 of file genClib.c.

1810 {
1811  if (IS_TABULATED(bp))
1812  {
1813  int number ;
1814 
1815  if (obj->p == gen_chunk_undefined) {
1816  write_null(bp);
1817  return !GO;
1818  }
1819  number = (obj->p+1)->i;
1820 
1821  if (number==0) { /* boum! why? */
1822  fatal("write_tabulated_leaf_in: Zero index in domain %s\n", bp->name);
1823  }
1824 
1825  /* fprintf(stderr, "writing %d %s\n", number, (obj->p+HASH_OFFSET)->s);
1826  */
1827  if (number >= 0)
1828  {
1829  putc('D', user_file);
1830  /*
1831  int type_number = gen_type_translation_actual_to_old(bp-Domains);
1832  fputci('D', type_number, user_file);
1833  write_string("\"", (obj->p+HASH_OFFSET)->s, "\" ", "_", "!"); */
1834 
1835  /* once written the domain number sign is inverted,
1836  * to tag the object has been written, so that
1837  * its definition is not written twice on disk.
1838  * The second time a simple reference is written instead.
1839  * beurk. FC.
1840  */
1841  (obj->p+1)->i = - (obj->p+1)->i;
1842  return GO;
1843  }
1844  }
1845 
1846  return write_leaf_in(obj, bp);
1847 }

References fatal(), gen_chunk_undefined, GO, IS_TABULATED, gen_binding::name, gen_chunk::p, user_file, write_leaf_in(), and write_null().

Referenced by gen_write_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_this_tabulated()

static void write_this_tabulated ( gen_chunk o)
static

Definition at line 1851 of file genClib.c.

1852 {
1853  gen_chunk g;
1854  g.p = o;
1855  gen_trav_leaf(wtt_bp, &g, wtt_dr);
1856 }

References gen_trav_leaf(), gen_chunk::p, wtt_bp, and wtt_dr.

Referenced by gen_write_tabulated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ already_seen_objects

hash_table already_seen_objects = NULL
static

Definition at line 2562 of file genClib.c.

Referenced by allocated_memory_already_seen_p(), and gen_allocated_memory().

◆ black_hole

FILE* black_hole = NULL
static

used for consistence checking...

Definition at line 2386 of file genClib.c.

Referenced by gen_consistent_p(), gen_defined_p(), and open_black_hole().

◆ copy_table

hash_table copy_table = NULL
static

These functions are used to implement the copying of objects.

A tabulated constructor has to stop recursive duplication.

Definition at line 1050 of file genClib.c.

Referenced by copy_hsearch(), copy_leaf_out(), copy_obj_in(), copy_simple_in(), copy_simple_out(), and gen_local_copy_tree().

◆ cumulated_error_seen

bool cumulated_error_seen
static

Definition at line 2394 of file genClib.c.

Referenced by gen_consistent_p(), and gen_tabulated_consistent_p().

◆ current_mrc

struct multi_recurse* current_mrc = (struct multi_recurse *) NULL
static

the current multi recurse driver.

it is cleaner than the gen_recurse version since I added the decisions table without modifying Pierre code, while here I redefined a current status struct that stores everything needed.

Definition at line 3137 of file genClib.c.

Referenced by gen_get_ancestor(), gen_get_current_object(), gen_get_recurse_ancestor(), gen_get_recurse_current_ancestor(), gen_get_recurse_previous_visited_object(), gen_internal_context_multi_recurse(), gen_recurse_stop(), quick_multi_already_seen_p(), quick_multi_recurse_obj_in(), quick_multi_recurse_obj_out(), and quick_multi_recurse_simple_in().

◆ current_size

int current_size
static

returns the number of bytes allocated for a given structure may need additional fonctions for externals...

May be called recursively. If so, already_seen_objects table kept.

Definition at line 2561 of file genClib.c.

Referenced by allocated_memory_leaf_in(), allocated_memory_obj_in(), allocated_memory_simple_in(), gen_allocated_memory(), hash_size_limit(), and tpips_help().

◆ DecisionTables

gen_tables DecisionTables
static

◆ DirectDomainsTable

◆ disallow_undefined_tabulated

int disallow_undefined_tabulated = true
static

Default option in GEN_WRITE.

Definition at line 74 of file genClib.c.

Referenced by write_leaf_in().

◆ env

◆ error_seen

int error_seen
extern

Have we seen a user error somewhere ?

Definition at line 76 of file build.c.

Referenced by build(), gen_consistent_p(), gen_defined_p(), and init().

◆ first_seen

char* first_seen = (char *)NULL
static

Definition at line 634 of file genClib.c.

Referenced by pop_gen_trav_env(), push_gen_trav_env(), shared_obj(), and shared_obj_in().

◆ free_already_seen

__thread hash_table free_already_seen = (hash_table) NULL
static

These functions are used to implement the freeing of objects.

A tabulated constructor has to stop recursive freeing.

Definition at line 848 of file genClib.c.

Referenced by free_already_seen_p(), gen_free(), gen_free_tabulated(), and gen_full_free_list().

◆ gen_debug

int gen_debug = 0

The debug flag can be changed by the user to check genClib code.

Function interface for user applications.

If you set gen_debug dynamically with gdb, do not forget to set gen_debug_indent to a positive enough value to avoid problems when gen_trav_obj() moves upwards the point it was when gen_debug was set

Definition at line 69 of file genClib.c.

Referenced by do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), full_loop_unroll(), gen_consistent_p(), gen_trav_leaf(), gen_trav_obj(), gen_trav_simple(), init_gen_quick_recurse_tables(), initialize_DirectDomainsTable(), initialize_domain_DecisionTables(), and initialize_domain_DirectDomainsTable().

◆ gen_debug_indent

int gen_debug_indent = 0
static

Definition at line 70 of file genClib.c.

Referenced by gen_trav_leaf(), gen_trav_obj(), and gen_trav_simple().

◆ gen_trav_env_top

int gen_trav_env_top = 0
static

Definition at line 799 of file genClib.c.

Referenced by pop_gen_trav_env(), and push_gen_trav_env().

◆ gen_trav_envs

struct gen_trav_env gen_trav_envs[ MAX_GEN_TRAV_ENV ]

◆ gen_trav_stop_recursion

◆ genspec_in

FILE* genspec_in
extern

lex files

Referenced by gen_read_spec().

◆ genspec_out

FILE * genspec_out

Definition at line 52 of file genClib.c.

Referenced by gen_read_spec().

◆ gtt_current_table

◆ number_of_domains

◆ obj_table

hash_table obj_table = (hash_table)NULL
static

The OBJ_TABLE maps objects to addresses within the arrays FIRST_SEEN and SEEN_ONCE.

In the first case, if the address is FIRST_SEEN, then this is the first occurence of the object; if it has a non-zero offset i, then it is the i-th shared object seen so far. This offset is used in SHARED_OBJ to decide which number to print and update the OBJ_TABLE to associate the object to SEEN_ONCE+i so that latter references can be correctly generated.

Definition at line 648 of file genClib.c.

Referenced by current_shared_obj_table_size(), gen_sharing_p(), gen_write_without_sharing(), pop_gen_trav_env(), push_gen_trav_env(), shared_obj(), shared_obj_in(), shared_pointers(), and shared_simple_in().

◆ pointers

hash_table pointers = (hash_table)NULL
static

GEN_SHARING_P checks whether OBJ1 uses objects (except tabulated) or CONS cells that appear in OBJ2.

Definition at line 2472 of file genClib.c.

Referenced by check_sharing(), and gen_sharing_p().

◆ Read_spec_mode

int Read_spec_mode

extern int Current_first ;

Definition at line 60 of file genClib.c.

Referenced by gen_read_spec(), main(), new_binding(), and reconnect().

◆ Read_spec_performed

bool Read_spec_performed = false
static

Definition at line 61 of file genClib.c.

Referenced by gen_read_spec().

◆ seen_once

char* seen_once = (char *)NULL
static

Definition at line 635 of file genClib.c.

Referenced by pop_gen_trav_env(), push_gen_trav_env(), and shared_obj().

◆ shared_number

int shared_number = 0
static

The running counter of shared objects number.

Definition at line 662 of file genClib.c.

Referenced by gen_write(), gen_write_tabulated(), pop_gen_trav_env(), push_gen_trav_env(), shared_obj(), shared_obj_in(), and shared_pointers().

◆ Tabulated_bp

struct gen_binding * Tabulated_bp

pointer to tabulated domain hack

hack to walk thru tabulateds...

Definition at line 58 of file genClib.c.

Referenced by compile(), gen_tabulated_fake_object_hack(), init(), initialize_DirectDomainsTable(), and print_domains().

◆ user_file

◆ wtt_bp

struct gen_binding* wtt_bp = NULL
static

Definition at line 1849 of file genClib.c.

Referenced by gen_write_tabulated(), and write_this_tabulated().

◆ wtt_dr

struct driver* wtt_dr = NULL
static

Definition at line 1850 of file genClib.c.

Referenced by gen_write_tabulated(), and write_this_tabulated().