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

Go to the source code of this file.

Functions

clone_context copy_clone_context (clone_context p)
 CLONE_CONTEXT. More...
 
void free_clone_context (clone_context p)
 
clone_context check_clone_context (clone_context p)
 
bool clone_context_consistent_p (clone_context p)
 
bool clone_context_defined_p (clone_context p)
 
list gen_clone_context_cons (clone_context p, list l)
 
void clone_context_assign_contents (clone_context r, clone_context v)
 
void clone_context_non_recursive_free (clone_context p)
 
void write_clone_context (FILE *f, clone_context p)
 
clone_context read_clone_context (FILE *f)
 
clone_context make_clone_context (entity a1, entity a2, list a3, statement a4)
 

Function Documentation

◆ check_clone_context()

clone_context check_clone_context ( clone_context  p)

Definition at line 22 of file cloning.c.

22  {
24 }
#define clone_context_domain
newgen_statement_domain_defined
Definition: cloning.h: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
A gen_chunk is used to store every object.
Definition: genC.h:58

References clone_context_domain, and gen_check().

+ Here is the call graph for this function:

◆ clone_context_assign_contents()

void clone_context_assign_contents ( clone_context  r,
clone_context  v 
)

Definition at line 35 of file cloning.c.

35  {
38  message_assert("defined references to domain clone_context",
40  memcpy(r, v, sizeof(struct _newgen_struct_clone_context_));
41 }
clone_context check_clone_context(clone_context p)
Definition: cloning.c:22
bool clone_context_defined_p(clone_context p)
Definition: cloning.c:29
#define message_assert(msg, ex)
Definition: newgen_assert.h:47

References check_clone_context(), clone_context_defined_p(), and message_assert.

+ Here is the call graph for this function:

◆ clone_context_consistent_p()

bool clone_context_consistent_p ( clone_context  p)

Definition at line 25 of file cloning.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_clone_context(), and gen_consistent_p().

+ Here is the call graph for this function:

◆ clone_context_defined_p()

bool clone_context_defined_p ( clone_context  p)

Definition at line 29 of file cloning.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:

◆ clone_context_non_recursive_free()

void clone_context_non_recursive_free ( clone_context  p)

Definition at line 42 of file cloning.c.

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

References free().

+ Here is the call graph for this function:

◆ copy_clone_context()

clone_context copy_clone_context ( clone_context  p)

CLONE_CONTEXT.

Definition at line 16 of file cloning.c.

16  {
17  return (clone_context) 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:

◆ free_clone_context()

void free_clone_context ( clone_context  p)

Definition at line 19 of file cloning.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:

◆ gen_clone_context_cons()

list gen_clone_context_cons ( clone_context  p,
list  l 
)

Definition at line 32 of file cloning.c.

32  {
34 }
#define CLONE_CONTEXT_NEWGEN_DOMAIN
Definition: cloning.h:27
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 CLONE_CONTEXT_NEWGEN_DOMAIN, and gen_typed_cons().

+ Here is the call graph for this function:

◆ make_clone_context()

clone_context make_clone_context ( entity  a1,
entity  a2,
list  a3,
statement  a4 
)

Definition at line 52 of file cloning.c.

52  {
53  return (clone_context) gen_alloc(5*sizeof(gen_chunk), GEN_CHECK_ALLOC, clone_context_domain, a1, a2, a3, a4);
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 clone_context_domain, gen_alloc(), and GEN_CHECK_ALLOC.

+ Here is the call graph for this function:

◆ read_clone_context()

clone_context read_clone_context ( FILE *  f)

Definition at line 49 of file cloning.c.

49  {
50  return (clone_context) 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:

◆ write_clone_context()

void write_clone_context ( FILE *  f,
clone_context  p 
)

Definition at line 46 of file cloning.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: