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

Go to the source code of this file.

Functions

align copy_align (align p)
 ALIGN. More...
 
void free_align (align p)
 
align check_align (align p)
 
bool align_consistent_p (align p)
 
bool align_defined_p (align p)
 
list gen_align_cons (align p, list l)
 
void align_assign_contents (align r, align v)
 
void align_non_recursive_free (align p)
 
void write_align (FILE *f, align p)
 
align read_align (FILE *f)
 
align make_align (list a1, entity a2)
 
alignment copy_alignment (alignment p)
 ALIGNMENT. More...
 
void free_alignment (alignment p)
 
alignment check_alignment (alignment p)
 
bool alignment_consistent_p (alignment p)
 
bool alignment_defined_p (alignment p)
 
list gen_alignment_cons (alignment p, list l)
 
void alignment_assign_contents (alignment r, alignment v)
 
void alignment_non_recursive_free (alignment p)
 
void write_alignment (FILE *f, alignment p)
 
alignment read_alignment (FILE *f)
 
alignment make_alignment (intptr_t a1, intptr_t a2, expression a3, expression a4)
 
distribute copy_distribute (distribute p)
 DISTRIBUTE. More...
 
void free_distribute (distribute p)
 
distribute check_distribute (distribute p)
 
bool distribute_consistent_p (distribute p)
 
bool distribute_defined_p (distribute p)
 
list gen_distribute_cons (distribute p, list l)
 
void distribute_assign_contents (distribute r, distribute v)
 
void distribute_non_recursive_free (distribute p)
 
void write_distribute (FILE *f, distribute p)
 
distribute read_distribute (FILE *f)
 
distribute make_distribute (list a1, entity a2)
 
distribution copy_distribution (distribution p)
 DISTRIBUTION. More...
 
void free_distribution (distribution p)
 
distribution check_distribution (distribution p)
 
bool distribution_consistent_p (distribution p)
 
bool distribution_defined_p (distribution p)
 
list gen_distribution_cons (distribution p, list l)
 
void distribution_assign_contents (distribution r, distribution v)
 
void distribution_non_recursive_free (distribution p)
 
void write_distribution (FILE *f, distribution p)
 
distribution read_distribution (FILE *f)
 
distribution make_distribution (style a1, expression a2)
 
style copy_style (style p)
 STYLE. More...
 
void free_style (style p)
 
style check_style (style p)
 
bool style_consistent_p (style p)
 
bool style_defined_p (style p)
 
list gen_style_cons (style p, list l)
 
void style_assign_contents (style r, style v)
 
void style_non_recursive_free (style p)
 
void write_style (FILE *f, style p)
 
style read_style (FILE *f)
 
string style_tag_as_string (enum style_utype tag)
 
style make_style (enum style_utype tag, void *val)
 
style make_style_none (void)
 
style make_style_block (void)
 
style make_style_cyclic (void)
 

Function Documentation

◆ align_assign_contents()

void align_assign_contents ( align  r,
align  v 
)

Definition at line 35 of file hpf.c.

35  {
36  check_align(r);
37  check_align(v);
38  message_assert("defined references to domain align",
40  memcpy(r, v, sizeof(struct _newgen_struct_align_));
41 }
bool align_defined_p(align p)
Definition: hpf.c:29
align check_align(align p)
Definition: hpf.c:22
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References align_defined_p(), check_align(), and message_assert.

+ Here is the call graph for this function:

◆ align_consistent_p()

bool align_consistent_p ( align  p)

Definition at line 25 of file hpf.c.

25  {
26  check_align(p);
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
A gen_chunk is used to store every object.
Definition: genC.h:58

References check_align(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ align_defined_p()

bool align_defined_p ( align  p)

Definition at line 29 of file hpf.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().

Referenced by align_assign_contents().

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

◆ align_non_recursive_free()

void align_non_recursive_free ( align  p)

Definition at line 42 of file hpf.c.

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

References free().

+ Here is the call graph for this function:

◆ alignment_assign_contents()

void alignment_assign_contents ( alignment  r,
alignment  v 
)

Definition at line 77 of file hpf.c.

77  {
78  check_alignment(r);
79  check_alignment(v);
80  message_assert("defined references to domain alignment",
82  memcpy(r, v, sizeof(struct _newgen_struct_alignment_));
83 }
alignment check_alignment(alignment p)
Definition: hpf.c:64
bool alignment_defined_p(alignment p)
Definition: hpf.c:71

References alignment_defined_p(), check_alignment(), and message_assert.

+ Here is the call graph for this function:

◆ alignment_consistent_p()

bool alignment_consistent_p ( alignment  p)

Definition at line 67 of file hpf.c.

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

References check_alignment(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ alignment_defined_p()

bool alignment_defined_p ( alignment  p)

Definition at line 71 of file hpf.c.

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

References gen_defined_p().

Referenced by alignment_assign_contents().

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

◆ alignment_non_recursive_free()

void alignment_non_recursive_free ( alignment  p)

Definition at line 84 of file hpf.c.

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

References free().

+ Here is the call graph for this function:

◆ check_align()

align check_align ( align  p)

Definition at line 22 of file hpf.c.

22  {
23  return (align) gen_check((gen_chunk*) p, align_domain);
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 align_domain
newgen_expression_domain_defined
Definition: hpf.h:24

References align_domain, and gen_check().

Referenced by align_assign_contents(), and align_consistent_p().

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

◆ check_alignment()

alignment check_alignment ( alignment  p)

Definition at line 64 of file hpf.c.

64  {
66 }
#define alignment_domain
newgen_align_domain_defined
Definition: hpf.h:32

References alignment_domain, and gen_check().

Referenced by alignment_assign_contents(), and alignment_consistent_p().

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

◆ check_distribute()

distribute check_distribute ( distribute  p)

Definition at line 106 of file hpf.c.

106  {
108 }
#define distribute_domain
newgen_alignment_domain_defined
Definition: hpf.h:40

References distribute_domain, and gen_check().

Referenced by distribute_assign_contents(), and distribute_consistent_p().

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

◆ check_distribution()

distribution check_distribution ( distribution  p)

Definition at line 148 of file hpf.c.

148  {
150 }
#define distribution_domain
newgen_distribute_domain_defined
Definition: hpf.h:48

References distribution_domain, and gen_check().

Referenced by distribution_assign_contents(), and distribution_consistent_p().

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

◆ check_style()

style check_style ( style  p)

Definition at line 190 of file hpf.c.

190  {
191  return (style) gen_check((gen_chunk*) p, style_domain);
192 }
#define style_domain
newgen_distribution_domain_defined
Definition: hpf.h:56

References gen_check(), and style_domain.

Referenced by style_assign_contents(), and style_consistent_p().

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

◆ copy_align()

align copy_align ( align  p)

ALIGN.

Definition at line 16 of file hpf.c.

16  {
17  return (align) gen_copy_tree((gen_chunk*) p);
18 }
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429

References gen_copy_tree().

Referenced by hpfc_translate_call_with_distributed_args(), and new_align_with_template().

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

◆ copy_alignment()

alignment copy_alignment ( alignment  p)

ALIGNMENT.

Definition at line 58 of file hpf.c.

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

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_distribute()

distribute copy_distribute ( distribute  p)

DISTRIBUTE.

Definition at line 100 of file hpf.c.

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

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_distribution()

distribution copy_distribution ( distribution  p)

DISTRIBUTION.

Definition at line 142 of file hpf.c.

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

References gen_copy_tree().

+ Here is the call graph for this function:

◆ copy_style()

style copy_style ( style  p)

STYLE.

Definition at line 184 of file hpf.c.

184  {
185  return (style) gen_copy_tree((gen_chunk*) p);
186 }

References gen_copy_tree().

+ Here is the call graph for this function:

◆ distribute_assign_contents()

void distribute_assign_contents ( distribute  r,
distribute  v 
)

Definition at line 119 of file hpf.c.

119  {
120  check_distribute(r);
121  check_distribute(v);
122  message_assert("defined references to domain distribute",
124  memcpy(r, v, sizeof(struct _newgen_struct_distribute_));
125 }
bool distribute_defined_p(distribute p)
Definition: hpf.c:113
distribute check_distribute(distribute p)
Definition: hpf.c:106

References check_distribute(), distribute_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ distribute_consistent_p()

bool distribute_consistent_p ( distribute  p)

Definition at line 109 of file hpf.c.

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

References check_distribute(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ distribute_defined_p()

bool distribute_defined_p ( distribute  p)

Definition at line 113 of file hpf.c.

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

References gen_defined_p().

Referenced by distribute_assign_contents().

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

◆ distribute_non_recursive_free()

void distribute_non_recursive_free ( distribute  p)

Definition at line 126 of file hpf.c.

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

References free().

+ Here is the call graph for this function:

◆ distribution_assign_contents()

void distribution_assign_contents ( distribution  r,
distribution  v 
)

Definition at line 161 of file hpf.c.

161  {
164  message_assert("defined references to domain distribution",
166  memcpy(r, v, sizeof(struct _newgen_struct_distribution_));
167 }
bool distribution_defined_p(distribution p)
Definition: hpf.c:155
distribution check_distribution(distribution p)
Definition: hpf.c:148

References check_distribution(), distribution_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ distribution_consistent_p()

bool distribution_consistent_p ( distribution  p)

Definition at line 151 of file hpf.c.

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

References check_distribution(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ distribution_defined_p()

bool distribution_defined_p ( distribution  p)

Definition at line 155 of file hpf.c.

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

References gen_defined_p().

Referenced by distribution_assign_contents().

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

◆ distribution_non_recursive_free()

void distribution_non_recursive_free ( distribution  p)

Definition at line 168 of file hpf.c.

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

References free().

+ Here is the call graph for this function:

◆ free_align()

void free_align ( align  p)

Definition at line 19 of file hpf.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().

Referenced by array_synonym_aligned_as().

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

◆ free_alignment()

void free_alignment ( alignment  p)

Definition at line 61 of file hpf.c.

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

References gen_free().

+ Here is the call graph for this function:

◆ free_distribute()

void free_distribute ( distribute  p)

Definition at line 103 of file hpf.c.

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

References gen_free().

Referenced by template_synonym_distributed_as().

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

◆ free_distribution()

void free_distribution ( distribution  p)

Definition at line 145 of file hpf.c.

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

References gen_free().

+ Here is the call graph for this function:

◆ free_style()

void free_style ( style  p)

Definition at line 187 of file hpf.c.

187  {
188  gen_free((gen_chunk*) p);
189 }

References gen_free().

+ Here is the call graph for this function:

◆ gen_align_cons()

list gen_align_cons ( align  p,
list  l 
)

Definition at line 32 of file hpf.c.

32  {
33  return gen_typed_cons(ALIGN_NEWGEN_DOMAIN, p, l);
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 ALIGN_NEWGEN_DOMAIN
Definition: hpf.h:27

References ALIGN_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_alignment_cons()

list gen_alignment_cons ( alignment  p,
list  l 
)

Definition at line 74 of file hpf.c.

74  {
76 }
#define ALIGNMENT_NEWGEN_DOMAIN
Definition: hpf.h:35

References ALIGNMENT_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_distribute_cons()

list gen_distribute_cons ( distribute  p,
list  l 
)

Definition at line 116 of file hpf.c.

116  {
118 }
#define DISTRIBUTE_NEWGEN_DOMAIN
Definition: hpf.h:43

References DISTRIBUTE_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_distribution_cons()

list gen_distribution_cons ( distribution  p,
list  l 
)

Definition at line 158 of file hpf.c.

158  {
160 }
#define DISTRIBUTION_NEWGEN_DOMAIN
Definition: hpf.h:51

References DISTRIBUTION_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ gen_style_cons()

list gen_style_cons ( style  p,
list  l 
)

Definition at line 200 of file hpf.c.

200  {
201  return gen_typed_cons(STYLE_NEWGEN_DOMAIN, p, l);
202 }
#define STYLE_NEWGEN_DOMAIN
Definition: hpf.h:59

References gen_typed_cons(), and STYLE_NEWGEN_DOMAIN.

+ Here is the call graph for this function:

◆ make_align()

align make_align ( list  a1,
entity  a2 
)

Definition at line 52 of file hpf.c.

52  {
53  return (align) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, align_domain, a1, a2);
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 align_domain, gen_alloc(), and GEN_CHECK_ALLOC.

Referenced by array_as_template(), and extract_the_align().

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

◆ make_alignment()

alignment make_alignment ( intptr_t  a1,
intptr_t  a2,
expression  a3,
expression  a4 
)

Definition at line 94 of file hpf.c.

94  {
95  return (alignment) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, alignment_domain, a1, a2, a3, a4);
96 }

References alignment_domain, gen_alloc(), and GEN_CHECK_ALLOC.

Referenced by array_as_template(), and extract_the_align().

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

◆ make_distribute()

distribute make_distribute ( list  a1,
entity  a2 
)

Definition at line 136 of file hpf.c.

136  {
137  return (distribute) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, distribute_domain, a1, a2);
138 }

References distribute_domain, gen_alloc(), and GEN_CHECK_ALLOC.

Referenced by extract_the_distribute().

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

◆ make_distribution()

distribution make_distribution ( style  a1,
expression  a2 
)

Definition at line 178 of file hpf.c.

178  {
180 }

References distribution_domain, gen_alloc(), and GEN_CHECK_ALLOC.

Referenced by extract_the_distribute().

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

◆ make_style()

style make_style ( enum style_utype  tag,
void *  val 
)

Definition at line 228 of file hpf.c.

228  {
229  return (style) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, style_domain, tag, val);
230 }
int tag
TAG.
Definition: newgen_types.h:92

References gen_alloc(), GEN_CHECK_ALLOC, and style_domain.

Referenced by extract_the_distribute(), make_style_block(), make_style_cyclic(), and make_style_none().

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

◆ make_style_block()

style make_style_block ( void  )

Definition at line 234 of file hpf.c.

234  {
235  return make_style(is_style_block, UU);
236 }
style make_style(enum style_utype tag, void *val)
Definition: hpf.c:228
@ is_style_block
Definition: hpf.h:238
#define UU
Definition: newgen_types.h:98

References is_style_block, make_style(), and UU.

+ Here is the call graph for this function:

◆ make_style_cyclic()

style make_style_cyclic ( void  )

Definition at line 237 of file hpf.c.

237  {
238  return make_style(is_style_cyclic, UU);
239 }
@ is_style_cyclic
Definition: hpf.h:239

References is_style_cyclic, make_style(), and UU.

+ Here is the call graph for this function:

◆ make_style_none()

style make_style_none ( void  )

Definition at line 231 of file hpf.c.

231  {
232  return make_style(is_style_none, UU);
233 }
@ is_style_none
Definition: hpf.h:237

References is_style_none, make_style(), and UU.

+ Here is the call graph for this function:

◆ read_align()

align read_align ( FILE *  f)

Definition at line 49 of file hpf.c.

49  {
50  return (align) 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_alignment()

alignment read_alignment ( FILE *  f)

Definition at line 91 of file hpf.c.

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

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_distribute()

distribute read_distribute ( FILE *  f)

Definition at line 133 of file hpf.c.

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

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_distribution()

distribution read_distribution ( FILE *  f)

Definition at line 175 of file hpf.c.

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

References f(), and gen_read().

+ Here is the call graph for this function:

◆ read_style()

style read_style ( FILE *  f)

Definition at line 217 of file hpf.c.

217  {
218  return (style) gen_read(f);
219 }

References f(), and gen_read().

+ Here is the call graph for this function:

◆ style_assign_contents()

void style_assign_contents ( style  r,
style  v 
)

Definition at line 203 of file hpf.c.

203  {
204  check_style(r);
205  check_style(v);
206  message_assert("defined references to domain style",
208  memcpy(r, v, sizeof(struct _newgen_struct_style_));
209 }
style check_style(style p)
Definition: hpf.c:190
bool style_defined_p(style p)
Definition: hpf.c:197

References check_style(), message_assert, and style_defined_p().

+ Here is the call graph for this function:

◆ style_consistent_p()

bool style_consistent_p ( style  p)

Definition at line 193 of file hpf.c.

193  {
194  check_style(p);
195  return gen_consistent_p((gen_chunk*) p);
196 }

References check_style(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ style_defined_p()

bool style_defined_p ( style  p)

Definition at line 197 of file hpf.c.

197  {
198  return gen_defined_p((gen_chunk*) p);
199 }

References gen_defined_p().

Referenced by style_assign_contents().

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

◆ style_non_recursive_free()

void style_non_recursive_free ( style  p)

Definition at line 210 of file hpf.c.

210  {
211  // should clear up contents...
212  free(p);
213 }

References free().

+ Here is the call graph for this function:

◆ style_tag_as_string()

string style_tag_as_string ( enum style_utype  tag)

Definition at line 220 of file hpf.c.

220  {
221  switch (tag) {
222  case is_style_none: return "none";
223  case is_style_block: return "block";
224  case is_style_cyclic: return "cyclic";
225  default: return string_undefined;
226  }
227 }
#define string_undefined
Definition: newgen_types.h:40

References is_style_block, is_style_cyclic, is_style_none, and string_undefined.

◆ write_align()

void write_align ( FILE *  f,
align  p 
)

Definition at line 46 of file hpf.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_alignment()

void write_alignment ( FILE *  f,
alignment  p 
)

Definition at line 88 of file hpf.c.

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

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_distribute()

void write_distribute ( FILE *  f,
distribute  p 
)

Definition at line 130 of file hpf.c.

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

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_distribution()

void write_distribution ( FILE *  f,
distribution  p 
)

Definition at line 172 of file hpf.c.

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

References f(), and gen_write().

+ Here is the call graph for this function:

◆ write_style()

void write_style ( FILE *  f,
style  p 
)

Definition at line 214 of file hpf.c.

214  {
215  gen_write(f, (gen_chunk*) p);
216 }

References f(), and gen_write().

+ Here is the call graph for this function: