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

Go to the source code of this file.

Functions

gexpression copy_gexpression (gexpression p)
 GEXPRESSION. More...
 
void free_gexpression (gexpression p)
 
gexpression check_gexpression (gexpression p)
 
bool gexpression_consistent_p (gexpression p)
 
bool gexpression_defined_p (gexpression p)
 
list gen_gexpression_cons (gexpression p, list l)
 
void gexpression_assign_contents (gexpression r, gexpression v)
 
void gexpression_non_recursive_free (gexpression p)
 
void write_gexpression (FILE *f, gexpression p)
 
gexpression read_gexpression (FILE *f)
 
gexpression make_gexpression (expression a1, expression a2)
 
pattern copy_pattern (pattern p)
 PATTERN. More...
 
void free_pattern (pattern p)
 
pattern check_pattern (pattern p)
 
bool pattern_consistent_p (pattern p)
 
bool pattern_defined_p (pattern p)
 
list gen_pattern_cons (pattern p, list l)
 
void pattern_assign_contents (pattern r, pattern v)
 
void pattern_non_recursive_free (pattern p)
 
void write_pattern (FILE *f, pattern p)
 
pattern read_pattern (FILE *f)
 
pattern make_pattern (entity a1, expression a2, expression a3, entity a4, list a5)
 
reduced_loops copy_reduced_loops (reduced_loops p)
 REDUCED_LOOPS. More...
 
void free_reduced_loops (reduced_loops p)
 
reduced_loops check_reduced_loops (reduced_loops p)
 
bool reduced_loops_consistent_p (reduced_loops p)
 
bool reduced_loops_defined_p (reduced_loops p)
 
list gen_reduced_loops_cons (reduced_loops p, list l)
 
void reduced_loops_assign_contents (reduced_loops r, reduced_loops v)
 
void reduced_loops_non_recursive_free (reduced_loops p)
 
void write_reduced_loops (FILE *f, reduced_loops p)
 
reduced_loops read_reduced_loops (FILE *f)
 
reduced_loops make_reduced_loops (list a)
 
sexpression copy_sexpression (sexpression p)
 SEXPRESSION. More...
 
void free_sexpression (sexpression p)
 
sexpression check_sexpression (sexpression p)
 
bool sexpression_consistent_p (sexpression p)
 
bool sexpression_defined_p (sexpression p)
 
list gen_sexpression_cons (sexpression p, list l)
 
void sexpression_assign_contents (sexpression r, sexpression v)
 
void sexpression_non_recursive_free (sexpression p)
 
void write_sexpression (FILE *f, sexpression p)
 
sexpression read_sexpression (FILE *f)
 
sexpression make_sexpression (list a)
 

Function Documentation

◆ check_gexpression()

gexpression check_gexpression ( gexpression  p)

Definition at line 22 of file reduction.c.

22  {
24 }
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 gexpression_domain
newgen_entity_domain_defined
Definition: reduction.h:24
A gen_chunk is used to store every object.
Definition: genC.h:58

References gen_check(), and gexpression_domain.

+ Here is the call graph for this function:

◆ check_pattern()

pattern check_pattern ( pattern  p)

Definition at line 64 of file reduction.c.

64  {
65  return (pattern) gen_check((gen_chunk*) p, pattern_domain);
66 }
#define pattern_domain
newgen_gexpression_domain_defined
Definition: reduction.h:32

References gen_check(), and pattern_domain.

+ Here is the call graph for this function:

◆ check_reduced_loops()

reduced_loops check_reduced_loops ( reduced_loops  p)

Definition at line 106 of file reduction.c.

106  {
108 }
#define reduced_loops_domain
newgen_pattern_domain_defined
Definition: reduction.h:40

References gen_check(), and reduced_loops_domain.

+ Here is the call graph for this function:

◆ check_sexpression()

sexpression check_sexpression ( sexpression  p)

Definition at line 148 of file reduction.c.

148  {
150 }
#define sexpression_domain
newgen_reduced_loops_domain_defined
Definition: reduction.h:48

References gen_check(), and sexpression_domain.

+ Here is the call graph for this function:

◆ copy_gexpression()

gexpression copy_gexpression ( gexpression  p)

GEXPRESSION.

Definition at line 16 of file reduction.c.

16  {
17  return (gexpression) gen_copy_tree((gen_chunk*) p);
18 }
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_pattern()

pattern copy_pattern ( pattern  p)

PATTERN.

Definition at line 58 of file reduction.c.

58  {
59  return (pattern) gen_copy_tree((gen_chunk*) p);
60 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_reduced_loops()

reduced_loops copy_reduced_loops ( reduced_loops  p)

REDUCED_LOOPS.

Definition at line 100 of file reduction.c.

100  {
101  return (reduced_loops) gen_copy_tree((gen_chunk*) p);
102 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_sexpression()

sexpression copy_sexpression ( sexpression  p)

SEXPRESSION.

Definition at line 142 of file reduction.c.

142  {
143  return (sexpression) gen_copy_tree((gen_chunk*) p);
144 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ free_gexpression()

void free_gexpression ( gexpression  p)

Definition at line 19 of file reduction.c.

19  {
20  gen_free((gen_chunk*) p);
21 }
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_pattern()

void free_pattern ( pattern  p)

Definition at line 61 of file reduction.c.

61  {
62  gen_free((gen_chunk*) p);
63 }

References gen_free().

+ Here is the call graph for this function:

◆ free_reduced_loops()

void free_reduced_loops ( reduced_loops  p)

Definition at line 103 of file reduction.c.

103  {
104  gen_free((gen_chunk*) p);
105 }

References gen_free().

+ Here is the call graph for this function:

◆ free_sexpression()

void free_sexpression ( sexpression  p)

Definition at line 145 of file reduction.c.

145  {
146  gen_free((gen_chunk*) p);
147 }

References gen_free().

+ Here is the call graph for this function:

◆ gen_gexpression_cons()

list gen_gexpression_cons ( gexpression  p,
list  l 
)

Definition at line 32 of file reduction.c.

32  {
34 }
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
#define GEXPRESSION_NEWGEN_DOMAIN
Definition: reduction.h:27

References gen_typed_cons(), and GEXPRESSION_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gen_pattern_cons()

list gen_pattern_cons ( pattern  p,
list  l 
)

Definition at line 74 of file reduction.c.

74  {
76 }
#define PATTERN_NEWGEN_DOMAIN
Definition: reduction.h:35

References gen_typed_cons(), and PATTERN_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gen_reduced_loops_cons()

list gen_reduced_loops_cons ( reduced_loops  p,
list  l 
)

Definition at line 116 of file reduction.c.

116  {
118 }
#define REDUCED_LOOPS_NEWGEN_DOMAIN
Definition: reduction.h:43

References gen_typed_cons(), and REDUCED_LOOPS_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gen_sexpression_cons()

list gen_sexpression_cons ( sexpression  p,
list  l 
)

Definition at line 158 of file reduction.c.

158  {
160 }
#define SEXPRESSION_NEWGEN_DOMAIN
Definition: reduction.h:51

References gen_typed_cons(), and SEXPRESSION_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ gexpression_assign_contents()

void gexpression_assign_contents ( gexpression  r,
gexpression  v 
)

Definition at line 35 of file reduction.c.

35  {
38  message_assert("defined references to domain gexpression",
40  memcpy(r, v, sizeof(struct _newgen_struct_gexpression_));
41 }
gexpression check_gexpression(gexpression p)
Definition: reduction.c:22
bool gexpression_defined_p(gexpression p)
Definition: reduction.c:29
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References check_gexpression(), gexpression_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ gexpression_consistent_p()

bool gexpression_consistent_p ( gexpression  p)

Definition at line 25 of file reduction.c.

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

References check_gexpression(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ gexpression_defined_p()

bool gexpression_defined_p ( gexpression  p)

Definition at line 29 of file reduction.c.

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

References gen_defined_p().

+ Here is the call graph for this function:

◆ gexpression_non_recursive_free()

void gexpression_non_recursive_free ( gexpression  p)

Definition at line 42 of file reduction.c.

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

References free().

+ Here is the call graph for this function:

◆ make_gexpression()

gexpression make_gexpression ( expression  a1,
expression  a2 
)

Definition at line 52 of file reduction.c.

52  {
54 }
#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 gen_alloc(), GEN_CHECK_ALLOC, and gexpression_domain.

+ Here is the call graph for this function:

◆ make_pattern()

pattern make_pattern ( entity  a1,
expression  a2,
expression  a3,
entity  a4,
list  a5 
)

Definition at line 94 of file reduction.c.

94  {
95  return (pattern) gen_alloc(6*sizeof(gen_chunk), GEN_CHECK_ALLOC, pattern_domain, a1, a2, a3, a4, a5);
96 }

References gen_alloc(), GEN_CHECK_ALLOC, and pattern_domain.

+ Here is the call graph for this function:

◆ make_reduced_loops()

reduced_loops make_reduced_loops ( list  a)

Definition at line 136 of file reduction.c.

136  {
138 }

References gen_alloc(), GEN_CHECK_ALLOC, and reduced_loops_domain.

+ Here is the call graph for this function:

◆ make_sexpression()

sexpression make_sexpression ( list  a)

Definition at line 178 of file reduction.c.

178  {
180 }

References gen_alloc(), GEN_CHECK_ALLOC, and sexpression_domain.

+ Here is the call graph for this function:

◆ pattern_assign_contents()

void pattern_assign_contents ( pattern  r,
pattern  v 
)

Definition at line 77 of file reduction.c.

77  {
78  check_pattern(r);
79  check_pattern(v);
80  message_assert("defined references to domain pattern",
82  memcpy(r, v, sizeof(struct _newgen_struct_pattern_));
83 }
pattern check_pattern(pattern p)
Definition: reduction.c:64
bool pattern_defined_p(pattern p)
Definition: reduction.c:71

References check_pattern(), message_assert, and pattern_defined_p().

+ Here is the call graph for this function:

◆ pattern_consistent_p()

bool pattern_consistent_p ( pattern  p)

Definition at line 67 of file reduction.c.

67  {
68  check_pattern(p);
69  return gen_consistent_p((gen_chunk*) p);
70 }

References check_pattern(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ pattern_defined_p()

bool pattern_defined_p ( pattern  p)

Definition at line 71 of file reduction.c.

71  {
72  return gen_defined_p((gen_chunk*) p);
73 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ pattern_non_recursive_free()

void pattern_non_recursive_free ( pattern  p)

Definition at line 84 of file reduction.c.

84  {
85  // should clear up contents...
86  free(p);
87 }

References free().

+ Here is the call graph for this function:

◆ read_gexpression()

gexpression read_gexpression ( FILE *  f)

Definition at line 49 of file reduction.c.

49  {
50  return (gexpression) gen_read(f);
51 }
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_pattern()

pattern read_pattern ( FILE *  f)

Definition at line 91 of file reduction.c.

91  {
92  return (pattern) gen_read(f);
93 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_reduced_loops()

reduced_loops read_reduced_loops ( FILE *  f)

Definition at line 133 of file reduction.c.

133  {
134  return (reduced_loops) gen_read(f);
135 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_sexpression()

sexpression read_sexpression ( FILE *  f)

Definition at line 175 of file reduction.c.

175  {
176  return (sexpression) gen_read(f);
177 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ reduced_loops_assign_contents()

void reduced_loops_assign_contents ( reduced_loops  r,
reduced_loops  v 
)

Definition at line 119 of file reduction.c.

119  {
122  message_assert("defined references to domain reduced_loops",
124  memcpy(r, v, sizeof(struct _newgen_struct_reduced_loops_));
125 }
bool reduced_loops_defined_p(reduced_loops p)
Definition: reduction.c:113
reduced_loops check_reduced_loops(reduced_loops p)
Definition: reduction.c:106

References check_reduced_loops(), message_assert, and reduced_loops_defined_p().

+ Here is the call graph for this function:

◆ reduced_loops_consistent_p()

bool reduced_loops_consistent_p ( reduced_loops  p)

Definition at line 109 of file reduction.c.

109  {
111  return gen_consistent_p((gen_chunk*) p);
112 }

References check_reduced_loops(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ reduced_loops_defined_p()

bool reduced_loops_defined_p ( reduced_loops  p)

Definition at line 113 of file reduction.c.

113  {
114  return gen_defined_p((gen_chunk*) p);
115 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ reduced_loops_non_recursive_free()

void reduced_loops_non_recursive_free ( reduced_loops  p)

Definition at line 126 of file reduction.c.

126  {
127  // should clear up contents...
128  free(p);
129 }

References free().

+ Here is the call graph for this function:

◆ sexpression_assign_contents()

void sexpression_assign_contents ( sexpression  r,
sexpression  v 
)

Definition at line 161 of file reduction.c.

161  {
164  message_assert("defined references to domain sexpression",
166  memcpy(r, v, sizeof(struct _newgen_struct_sexpression_));
167 }
sexpression check_sexpression(sexpression p)
Definition: reduction.c:148
bool sexpression_defined_p(sexpression p)
Definition: reduction.c:155

References check_sexpression(), message_assert, and sexpression_defined_p().

+ Here is the call graph for this function:

◆ sexpression_consistent_p()

bool sexpression_consistent_p ( sexpression  p)

Definition at line 151 of file reduction.c.

151  {
153  return gen_consistent_p((gen_chunk*) p);
154 }

References check_sexpression(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ sexpression_defined_p()

bool sexpression_defined_p ( sexpression  p)

Definition at line 155 of file reduction.c.

155  {
156  return gen_defined_p((gen_chunk*) p);
157 }

References gen_defined_p().

+ Here is the call graph for this function:

◆ sexpression_non_recursive_free()

void sexpression_non_recursive_free ( sexpression  p)

Definition at line 168 of file reduction.c.

168  {
169  // should clear up contents...
170  free(p);
171 }

References free().

+ Here is the call graph for this function:

◆ write_gexpression()

void write_gexpression ( FILE *  f,
gexpression  p 
)

Definition at line 46 of file reduction.c.

46  {
47  gen_write(f, (gen_chunk*) p);
48 }
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_pattern()

void write_pattern ( FILE *  f,
pattern  p 
)

Definition at line 88 of file reduction.c.

88  {
89  gen_write(f, (gen_chunk*) p);
90 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_reduced_loops()

void write_reduced_loops ( FILE *  f,
reduced_loops  p 
)

Definition at line 130 of file reduction.c.

130  {
131  gen_write(f, (gen_chunk*) p);
132 }

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_sexpression()

void write_sexpression ( FILE *  f,
sexpression  p 
)

Definition at line 172 of file reduction.c.

172  {
173  gen_write(f, (gen_chunk*) p);
174 }

References f(), and gen_write().

+ Here is the call graph for this function: