PIPS
complexity_ri.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "complexity_ri.h"
+ Include dependency graph for complexity_ri.c:

Go to the source code of this file.

Typedefs

typedef void * Ppolynome
 

Functions

complexity copy_complexity (complexity p)
 COMPLEXITY. More...
 
void free_complexity (complexity p)
 
complexity check_complexity (complexity p)
 
bool complexity_consistent_p (complexity p)
 
bool complexity_defined_p (complexity p)
 
list gen_complexity_cons (complexity p, list l)
 
void complexity_assign_contents (complexity r, complexity v)
 
void complexity_non_recursive_free (complexity p)
 
void write_complexity (FILE *f, complexity p)
 
complexity read_complexity (FILE *f)
 
complexity make_complexity (Ppolynome a1, varcount a2, rangecount a3, ifcount a4)
 
ifcount copy_ifcount (ifcount p)
 IFCOUNT. More...
 
void free_ifcount (ifcount p)
 
ifcount check_ifcount (ifcount p)
 
bool ifcount_consistent_p (ifcount p)
 
bool ifcount_defined_p (ifcount p)
 
list gen_ifcount_cons (ifcount p, list l)
 
void ifcount_assign_contents (ifcount r, ifcount v)
 
void ifcount_non_recursive_free (ifcount p)
 
void write_ifcount (FILE *f, ifcount p)
 
ifcount read_ifcount (FILE *f)
 
ifcount make_ifcount (intptr_t a1, intptr_t a2, intptr_t a3)
 
rangecount copy_rangecount (rangecount p)
 RANGECOUNT. More...
 
void free_rangecount (rangecount p)
 
rangecount check_rangecount (rangecount p)
 
bool rangecount_consistent_p (rangecount p)
 
bool rangecount_defined_p (rangecount p)
 
list gen_rangecount_cons (rangecount p, list l)
 
void rangecount_assign_contents (rangecount r, rangecount v)
 
void rangecount_non_recursive_free (rangecount p)
 
void write_rangecount (FILE *f, rangecount p)
 
rangecount read_rangecount (FILE *f)
 
rangecount make_rangecount (intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4)
 
varcount copy_varcount (varcount p)
 VARCOUNT. More...
 
void free_varcount (varcount p)
 
varcount check_varcount (varcount p)
 
bool varcount_consistent_p (varcount p)
 
bool varcount_defined_p (varcount p)
 
list gen_varcount_cons (varcount p, list l)
 
void varcount_assign_contents (varcount r, varcount v)
 
void varcount_non_recursive_free (varcount p)
 
void write_varcount (FILE *f, varcount p)
 
varcount read_varcount (FILE *f)
 
varcount make_varcount (intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4)
 

Typedef Documentation

◆ Ppolynome

typedef void* Ppolynome

Definition at line 7 of file complexity_ri.c.

Function Documentation

◆ check_complexity()

complexity check_complexity ( complexity  p)

Definition at line 24 of file complexity_ri.c.

24  {
26 }
#define complexity_domain
newgen_Ppolynome_domain_defined
Definition: complexity_ri.h:25
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
A gen_chunk is used to store every object.
Definition: genC.h:58

References complexity_domain, and gen_check().

+ Here is the call graph for this function:

◆ check_ifcount()

ifcount check_ifcount ( ifcount  p)

Definition at line 66 of file complexity_ri.c.

66  {
67  return (ifcount) gen_check((gen_chunk*) p, ifcount_domain);
68 }
#define ifcount_domain
newgen_complexity_domain_defined
Definition: complexity_ri.h:33

References gen_check(), and ifcount_domain.

+ Here is the call graph for this function:

◆ check_rangecount()

rangecount check_rangecount ( rangecount  p)

Definition at line 108 of file complexity_ri.c.

108  {
110 }
#define rangecount_domain
newgen_ifcount_domain_defined
Definition: complexity_ri.h:41

References gen_check(), and rangecount_domain.

+ Here is the call graph for this function:

◆ check_varcount()

varcount check_varcount ( varcount  p)

Definition at line 150 of file complexity_ri.c.

150  {
152 }
#define varcount_domain
newgen_rangecount_domain_defined
Definition: complexity_ri.h:49

References gen_check(), and varcount_domain.

+ Here is the call graph for this function:

◆ complexity_assign_contents()

void complexity_assign_contents ( complexity  r,
complexity  v 
)

Definition at line 37 of file complexity_ri.c.

37  {
40  message_assert("defined references to domain complexity",
42  memcpy(r, v, sizeof(struct _newgen_struct_complexity_));
43 }
bool complexity_defined_p(complexity p)
Definition: complexity_ri.c:31
complexity check_complexity(complexity p)
Definition: complexity_ri.c:24
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References check_complexity(), complexity_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ complexity_consistent_p()

bool complexity_consistent_p ( complexity  p)

Definition at line 27 of file complexity_ri.c.

27  {
29  return gen_consistent_p((gen_chunk*) p);
30 }
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
Definition: genClib.c:2398

References check_complexity(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ complexity_defined_p()

bool complexity_defined_p ( complexity  p)

Definition at line 31 of file complexity_ri.c.

31  {
32  return gen_defined_p((gen_chunk*) p);
33 }
int gen_defined_p(gen_chunk *obj)
Definition: genClib.c:2438

References gen_defined_p().

+ Here is the call graph for this function:

◆ complexity_non_recursive_free()

void complexity_non_recursive_free ( complexity  p)

Definition at line 44 of file complexity_ri.c.

44  {
45  // should clear up contents...
46  free(p);
47 }
void free(void *)

References free().

+ Here is the call graph for this function:

◆ copy_complexity()

complexity copy_complexity ( complexity  p)

COMPLEXITY.

Definition at line 18 of file complexity_ri.c.

18  {
19  return (complexity) gen_copy_tree((gen_chunk*) p);
20 }
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_ifcount()

ifcount copy_ifcount ( ifcount  p)

IFCOUNT.

Definition at line 60 of file complexity_ri.c.

60  {
61  return (ifcount) gen_copy_tree((gen_chunk*) p);
62 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_rangecount()

rangecount copy_rangecount ( rangecount  p)

RANGECOUNT.

Definition at line 102 of file complexity_ri.c.

102  {
103  return (rangecount) gen_copy_tree((gen_chunk*) p);
104 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_varcount()

varcount copy_varcount ( varcount  p)

VARCOUNT.

Definition at line 144 of file complexity_ri.c.

144  {
145  return (varcount) gen_copy_tree((gen_chunk*) p);
146 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ free_complexity()

void free_complexity ( complexity  p)

Definition at line 21 of file complexity_ri.c.

21  {
22  gen_free((gen_chunk*) p);
23 }
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992

References gen_free().

+ Here is the call graph for this function:

◆ free_ifcount()

void free_ifcount ( ifcount  p)

Definition at line 63 of file complexity_ri.c.

63  {
64  gen_free((gen_chunk*) p);
65 }

References gen_free().

+ Here is the call graph for this function:

◆ free_rangecount()

void free_rangecount ( rangecount  p)

Definition at line 105 of file complexity_ri.c.

105  {
106  gen_free((gen_chunk*) p);
107 }

References gen_free().

+ Here is the call graph for this function:

◆ free_varcount()

void free_varcount ( varcount  p)

Definition at line 147 of file complexity_ri.c.

147  {
148  gen_free((gen_chunk*) p);
149 }

References gen_free().

+ Here is the call graph for this function:

◆ gen_complexity_cons()

list gen_complexity_cons ( complexity  p,
list  l 
)

Definition at line 34 of file complexity_ri.c.

34  {
36 }
#define COMPLEXITY_NEWGEN_DOMAIN
Definition: complexity_ri.h:28
list gen_typed_cons(_int type, const void *item, const list next)
CONS a list with minimal type checking this cannot be done within the CONS macro because possible fun...
Definition: list.c:900

References COMPLEXITY_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_ifcount_cons()

list gen_ifcount_cons ( ifcount  p,
list  l 
)

Definition at line 76 of file complexity_ri.c.

76  {
78 }
#define IFCOUNT_NEWGEN_DOMAIN
Definition: complexity_ri.h:36

References gen_typed_cons(), and IFCOUNT_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gen_rangecount_cons()

list gen_rangecount_cons ( rangecount  p,
list  l 
)

Definition at line 118 of file complexity_ri.c.

118  {
120 }
#define RANGECOUNT_NEWGEN_DOMAIN
Definition: complexity_ri.h:44

References gen_typed_cons(), and RANGECOUNT_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gen_varcount_cons()

list gen_varcount_cons ( varcount  p,
list  l 
)

Definition at line 160 of file complexity_ri.c.

160  {
162 }
#define VARCOUNT_NEWGEN_DOMAIN
Definition: complexity_ri.h:52

References gen_typed_cons(), and VARCOUNT_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ ifcount_assign_contents()

void ifcount_assign_contents ( ifcount  r,
ifcount  v 
)

Definition at line 79 of file complexity_ri.c.

79  {
80  check_ifcount(r);
81  check_ifcount(v);
82  message_assert("defined references to domain ifcount",
84  memcpy(r, v, sizeof(struct _newgen_struct_ifcount_));
85 }
bool ifcount_defined_p(ifcount p)
Definition: complexity_ri.c:73
ifcount check_ifcount(ifcount p)
Definition: complexity_ri.c:66

References check_ifcount(), ifcount_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ ifcount_consistent_p()

bool ifcount_consistent_p ( ifcount  p)

Definition at line 69 of file complexity_ri.c.

69  {
70  check_ifcount(p);
71  return gen_consistent_p((gen_chunk*) p);
72 }

References check_ifcount(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ ifcount_defined_p()

bool ifcount_defined_p ( ifcount  p)

Definition at line 73 of file complexity_ri.c.

73  {
74  return gen_defined_p((gen_chunk*) p);
75 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ ifcount_non_recursive_free()

void ifcount_non_recursive_free ( ifcount  p)

Definition at line 86 of file complexity_ri.c.

86  {
87  // should clear up contents...
88  free(p);
89 }

References free().

+ Here is the call graph for this function:

◆ make_complexity()

complexity make_complexity ( Ppolynome  a1,
varcount  a2,
rangecount  a3,
ifcount  a4 
)

Definition at line 54 of file complexity_ri.c.

54  {
55  return (complexity) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, complexity_domain, a1, a2, a3, a4);
56 }
#define GEN_CHECK_ALLOC
Definition: genC.h:307
gen_chunk * gen_alloc(int size, int gen_check_p, int dom,...)
allocates something in newgen.
Definition: genClib.c:298

References complexity_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ make_ifcount()

ifcount make_ifcount ( intptr_t  a1,
intptr_t  a2,
intptr_t  a3 
)

Definition at line 96 of file complexity_ri.c.

96  {
97  return (ifcount) gen_alloc(4*sizeof(gen_chunk), GEN_CHECK_ALLOC, ifcount_domain, a1, a2, a3);
98 }

References gen_alloc(), GEN_CHECK_ALLOC, and ifcount_domain.

+ Here is the call graph for this function:

◆ make_rangecount()

rangecount make_rangecount ( intptr_t  a1,
intptr_t  a2,
intptr_t  a3,
intptr_t  a4 
)

Definition at line 138 of file complexity_ri.c.

138  {
139  return (rangecount) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, rangecount_domain, a1, a2, a3, a4);
140 }

References gen_alloc(), GEN_CHECK_ALLOC, and rangecount_domain.

+ Here is the call graph for this function:

◆ make_varcount()

varcount make_varcount ( intptr_t  a1,
intptr_t  a2,
intptr_t  a3,
intptr_t  a4 
)

Definition at line 180 of file complexity_ri.c.

180  {
181  return (varcount) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, varcount_domain, a1, a2, a3, a4);
182 }

References gen_alloc(), GEN_CHECK_ALLOC, and varcount_domain.

+ Here is the call graph for this function:

◆ rangecount_assign_contents()

void rangecount_assign_contents ( rangecount  r,
rangecount  v 
)

Definition at line 121 of file complexity_ri.c.

121  {
122  check_rangecount(r);
123  check_rangecount(v);
124  message_assert("defined references to domain rangecount",
126  memcpy(r, v, sizeof(struct _newgen_struct_rangecount_));
127 }
rangecount check_rangecount(rangecount p)
bool rangecount_defined_p(rangecount p)

References check_rangecount(), message_assert, and rangecount_defined_p().

+ Here is the call graph for this function:

◆ rangecount_consistent_p()

bool rangecount_consistent_p ( rangecount  p)

Definition at line 111 of file complexity_ri.c.

111  {
112  check_rangecount(p);
113  return gen_consistent_p((gen_chunk*) p);
114 }

References check_rangecount(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ rangecount_defined_p()

bool rangecount_defined_p ( rangecount  p)

Definition at line 115 of file complexity_ri.c.

115  {
116  return gen_defined_p((gen_chunk*) p);
117 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ rangecount_non_recursive_free()

void rangecount_non_recursive_free ( rangecount  p)

Definition at line 128 of file complexity_ri.c.

128  {
129  // should clear up contents...
130  free(p);
131 }

References free().

+ Here is the call graph for this function:

◆ read_complexity()

complexity read_complexity ( FILE *  f)

Definition at line 51 of file complexity_ri.c.

51  {
52  return (complexity) gen_read(f);
53 }
gen_chunk * gen_read(FILE *file)
GEN_READ reads any object from the FILE stream.
Definition: genClib.c:2323
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_ifcount()

ifcount read_ifcount ( FILE *  f)

Definition at line 93 of file complexity_ri.c.

93  {
94  return (ifcount) gen_read(f);
95 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_rangecount()

rangecount read_rangecount ( FILE *  f)

Definition at line 135 of file complexity_ri.c.

135  {
136  return (rangecount) gen_read(f);
137 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_varcount()

varcount read_varcount ( FILE *  f)

Definition at line 177 of file complexity_ri.c.

177  {
178  return (varcount) gen_read(f);
179 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ varcount_assign_contents()

void varcount_assign_contents ( varcount  r,
varcount  v 
)

Definition at line 163 of file complexity_ri.c.

163  {
164  check_varcount(r);
165  check_varcount(v);
166  message_assert("defined references to domain varcount",
168  memcpy(r, v, sizeof(struct _newgen_struct_varcount_));
169 }
varcount check_varcount(varcount p)
bool varcount_defined_p(varcount p)

References check_varcount(), message_assert, and varcount_defined_p().

+ Here is the call graph for this function:

◆ varcount_consistent_p()

bool varcount_consistent_p ( varcount  p)

Definition at line 153 of file complexity_ri.c.

153  {
154  check_varcount(p);
155  return gen_consistent_p((gen_chunk*) p);
156 }

References check_varcount(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ varcount_defined_p()

bool varcount_defined_p ( varcount  p)

Definition at line 157 of file complexity_ri.c.

157  {
158  return gen_defined_p((gen_chunk*) p);
159 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ varcount_non_recursive_free()

void varcount_non_recursive_free ( varcount  p)

Definition at line 170 of file complexity_ri.c.

170  {
171  // should clear up contents...
172  free(p);
173 }

References free().

+ Here is the call graph for this function:

◆ write_complexity()

void write_complexity ( FILE *  f,
complexity  p 
)

Definition at line 48 of file complexity_ri.c.

48  {
49  gen_write(f, (gen_chunk*) p);
50 }
void gen_write(FILE *fd, gen_chunk *obj)
GEN_WRITE writes the OBJect on the stream FD.
Definition: genClib.c:1745

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_ifcount()

void write_ifcount ( FILE *  f,
ifcount  p 
)

Definition at line 90 of file complexity_ri.c.

90  {
91  gen_write(f, (gen_chunk*) p);
92 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_rangecount()

void write_rangecount ( FILE *  f,
rangecount  p 
)

Definition at line 132 of file complexity_ri.c.

132  {
133  gen_write(f, (gen_chunk*) p);
134 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_varcount()

void write_varcount ( FILE *  f,
varcount  p 
)

Definition at line 174 of file complexity_ri.c.

174  {
175  gen_write(f, (gen_chunk*) p);
176 }

References f(), and gen_write().

+ Here is the call graph for this function: