libFirm 1.20
libfirm/compound_path.h File Reference

Deprecated way to initialize compound entites! (use ir_initializer stuff instead) Declarations for functions and datastructures to represent compound type initializers. More...

#include "firm_types.h"
#include "begin.h"
#include "end.h"

Go to the source code of this file.

Typedefs

typedef struct compound_graph_path compound_graph_path
 path into compound types

Functions

compound_graph_pathnew_compound_graph_path (ir_type *tp, size_t length)
int is_compound_graph_path (const void *thing)
void free_compound_graph_path (compound_graph_path *gr)
size_t get_compound_graph_path_length (const compound_graph_path *gr)
ir_entityget_compound_graph_path_node (const compound_graph_path *gr, size_t pos)
void set_compound_graph_path_node (compound_graph_path *gr, size_t pos, ir_entity *node)
long get_compound_graph_path_array_index (const compound_graph_path *gr, size_t pos)
void set_compound_graph_path_array_index (compound_graph_path *gr, size_t pos, long index)
ir_typeget_compound_graph_path_type (const compound_graph_path *gr)
int is_proper_compound_graph_path (compound_graph_path *gr, size_t pos)
void add_compound_ent_value_w_path (ir_entity *ent, ir_node *val, compound_graph_path *path)
void set_compound_ent_value_w_path (ir_entity *ent, ir_node *val, compound_graph_path *path, size_t pos)
compound_graph_pathget_compound_ent_value_path (const ir_entity *ent, size_t pos)
ir_nodeget_compound_ent_value_by_path (const ir_entity *ent, compound_graph_path *path)
void remove_compound_ent_value (ir_entity *ent, ir_entity *value_ent)
void add_compound_ent_value (ir_entity *ent, ir_node *val, ir_entity *member)
ir_entityget_compound_ent_value_member (const ir_entity *ent, size_t pos)
void set_compound_ent_value (ir_entity *ent, ir_node *val, ir_entity *member, size_t pos)
void set_array_entity_values (ir_entity *ent, ir_tarval **values, size_t num_vals)
unsigned get_compound_ent_value_offset_bit_remainder (const ir_entity *ent, size_t pos)
unsigned get_compound_ent_value_offset_bytes (const ir_entity *ent, size_t pos)
size_t get_compound_ent_n_values (const ir_entity *ent)
ir_nodeget_compound_ent_value (const ir_entity *ent, size_t pos)
int entity_has_compound_ent_values (const ir_entity *entity)

Detailed Description

Deprecated way to initialize compound entites! (use ir_initializer stuff instead) Declarations for functions and datastructures to represent compound type initializers.

Definition in file compound_path.h.


Typedef Documentation

path into compound types

Definition at line 37 of file compound_path.h.


Function Documentation

void add_compound_ent_value ( ir_entity ent,
ir_node val,
ir_entity member 
)

Beware: Has a bad runtime for array elements (O(|array|) and should be avoided there. Use add_compound_ent_value_w_path() instead and create the path manually.

void add_compound_ent_value_w_path ( ir_entity ent,
ir_node val,
compound_graph_path path 
)
int entity_has_compound_ent_values ( const ir_entity entity)
void free_compound_graph_path ( compound_graph_path gr)
size_t get_compound_ent_n_values ( const ir_entity ent)

Asserts if the entity has variability_uninitialized.

ir_node* get_compound_ent_value ( const ir_entity ent,
size_t  pos 
)
ir_node* get_compound_ent_value_by_path ( const ir_entity ent,
compound_graph_path path 
)

The path must contain array indices for all array element entities.

ir_entity* get_compound_ent_value_member ( const ir_entity ent,
size_t  pos 
)
unsigned get_compound_ent_value_offset_bit_remainder ( const ir_entity ent,
size_t  pos 
)

This requires that the layout of all concerned types is fixed.

Parameters:
entAny entity of compound type with at least pos initialization values.
posThe position of the value for which the offset is requested.
unsigned get_compound_ent_value_offset_bytes ( const ir_entity ent,
size_t  pos 
)

This requires that the layout of all concerned types is fixed. Asserts if bit offset is not byte aligned.

Parameters:
entAny entity of compound type with at least pos initialization values.
posThe position of the value for which the offset is requested.
compound_graph_path* get_compound_ent_value_path ( const ir_entity ent,
size_t  pos 
)
long get_compound_graph_path_array_index ( const compound_graph_path gr,
size_t  pos 
)
size_t get_compound_graph_path_length ( const compound_graph_path gr)
ir_entity* get_compound_graph_path_node ( const compound_graph_path gr,
size_t  pos 
)
ir_type* get_compound_graph_path_type ( const compound_graph_path gr)
int is_compound_graph_path ( const void *  thing)
int is_proper_compound_graph_path ( compound_graph_path gr,
size_t  pos 
)

If the path contains a NULL, assumes the path is not complete and returns non-zero.

compound_graph_path* new_compound_graph_path ( ir_type tp,
size_t  length 
)
void remove_compound_ent_value ( ir_entity ent,
ir_entity value_ent 
)

Does not free the memory of the paths. (The same path might be used for several constant entities.

void set_array_entity_values ( ir_entity ent,
ir_tarval **  values,
size_t  num_vals 
)

The array must have a lower and an upper bound. Keeps the order of values. Does not test whether the number of values fits into the given array size. Does not test whether the values have the proper mode for the array.

void set_compound_ent_value ( ir_entity ent,
ir_node val,
ir_entity member,
size_t  pos 
)
void set_compound_ent_value_w_path ( ir_entity ent,
ir_node val,
compound_graph_path path,
size_t  pos 
)
void set_compound_graph_path_array_index ( compound_graph_path gr,
size_t  pos,
long  index 
)
void set_compound_graph_path_node ( compound_graph_path gr,
size_t  pos,
ir_entity node 
)