From: Michael Beck Date: Thu, 18 Sep 2008 14:36:03 +0000 (+0000) Subject: - add get_compound_graph_path_type() X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=b41ce1d070a9f7d216f024fc969ad49908098c0c;p=libfirm - add get_compound_graph_path_type() - add some doxygen comments [r22086] --- diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index 3e212645f..4e43b8ae5 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -457,13 +457,13 @@ void set_atomic_ent_value(ir_entity *ent, ir_node *val); /** the kind (type) of an initializer */ typedef enum ir_initializer_kind_t { - /* initializer containing an ir_node from the const-code irg */ + /** initializer containing an ir_node from the const-code irg */ IR_INITIALIZER_CONST, - /* initializer containing a tarval */ + /** initializer containing a tarval */ IR_INITIALIZER_TARVAL, - /* initializes type with default values (usually 0) */ + /** initializes type with default values (usually 0) */ IR_INITIALIZER_NULL, - /* list of initializers used to initializer a compound or array type */ + /** list of initializers used to initializer a compound or array type */ IR_INITIALIZER_COMPOUND } ir_initializer_kind_t; @@ -516,10 +516,16 @@ void free_compound_graph_path(compound_graph_path *gr); /** Returns the length of a graph path */ int get_compound_graph_path_length(const compound_graph_path *gr); +/** Get the entity node of an compound graph path at position pos. */ ir_entity *get_compound_graph_path_node(const compound_graph_path *gr, int pos); -void set_compound_graph_path_node(compound_graph_path *gr, int pos, ir_entity *node); -int get_compound_graph_path_array_index(const compound_graph_path *gr, int pos); -void set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index); +/** Set the entity node of an compound graph path at position pos. */ +void set_compound_graph_path_node(compound_graph_path *gr, int pos, ir_entity *node); +/** Get the index of an compound graph path at position pos. */ +int get_compound_graph_path_array_index(const compound_graph_path *gr, int pos); +/** Set the index of an compound graph path at position pos. */ +void set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index); +/** Get the type of an compound graph path. */ +ir_type *get_compound_graph_path_type(const compound_graph_path *gr); /** Checks whether the path up to pos is correct. If the path contains a NULL, * assumes the path is not complete and returns non-zero. */ @@ -565,8 +571,10 @@ ir_entity *get_compound_ent_value_member(ir_entity *ent, int pos); /** Sets the path at pos 0 */ void set_compound_ent_value(ir_entity *ent, ir_node *val, ir_entity *member, int pos); +/** Sets the new style initializers of an entity. */ void set_entity_initializer(ir_entity *entity, ir_initializer_t *initializer); +/** Return the new style initializers of an entity. */ ir_initializer_t *get_entity_initializer(const ir_entity *entity); /** Initializes the entity ent which must be of a one dimensional diff --git a/ir/tr/entity.c b/ir/tr/entity.c index da62e15a3..9af1de6a0 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -888,6 +888,12 @@ set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index) gr->list[pos].index = index; } /* set_compound_graph_path_array_index */ +ir_type * +get_compound_graph_path_type(const compound_graph_path *gr) { + assert(gr && is_compound_graph_path(gr)); + return gr->tp; +} + /* A value of a compound entity is a pair of value and the corresponding path to a member of the compound. */ void