From 06c450a6bf29496386fa6f70b1a223cb4c39155f Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 4 Feb 2003 14:05:59 +0000 Subject: [PATCH] Converted comments to doxygen [r736] --- ir/ana/irloop.h | 93 +++++++++++++++++++++++++---------------------- ir/ana/irloop_t.h | 19 ++++++---- ir/ir/irgraph_t.h | 74 +++++++++++++++++++------------------ 3 files changed, 99 insertions(+), 87 deletions(-) diff --git a/ir/ana/irloop.h b/ir/ana/irloop.h index 2dcf42564..7e15f33bc 100644 --- a/ir/ana/irloop.h +++ b/ir/ana/irloop.h @@ -1,9 +1,14 @@ /* Copyright (C) 2002 by Universitaet Karlsruhe * All rights reserved. +*/ + +/** +* @file irloop.h * -* Authors: Goetz Lindenmaier +* Computes backedges in the control and data flow. +* +* @author Goetz Lindenmaier * -* irloops.h: Computes backedges in the control and data flow. * Only Block and Phi/Filter nodes can have incoming backedges. * Constructs loops data structure: indicates loop nesting. */ @@ -17,80 +22,80 @@ # include "irnode.h" -/** @@@ Interprocedural backedges ... ???? **/ +/* @@@ Interprocedural backedges ... ???? */ -/**********************************************************************/ -/** Backedge information. **/ -/** **/ -/** Predecessors of Block, Phi and interprocedural Filter nodes can **/ -/** have backedges. If loop information is computed, this **/ -/** information is computed, too. **/ -/** The backedge information can only be used if the graph is not in **/ -/** phase phase_building. **/ -/**********************************************************************/ +/* + * Backedge information. + * + * Predecessors of Block, Phi and interprocedural Filter nodes can + * have backedges. If loop information is computed, this + * information is computed, too. + * The backedge information can only be used if the graph is not in + * phase phase_building. + */ -/* Returns true if the predesessor pos is a backedge. */ +/** Returns true if the predesessor pos is a backedge. */ bool is_backedge (ir_node *n, int pos); -/* Remarks that edge pos is a backedge. */ +/** Remarks that edge pos is a backedge. */ void set_backedge (ir_node *n, int pos); -/* Remarks that edge pos is not a backedge. */ +/** Remarks that edge pos is not a backedge. */ void set_not_backedge (ir_node *n, int pos); -/* Returns true if n has backedges. */ +/** Returns true if n has backedges. */ bool has_backedges (ir_node *n); -/* Sets backedge information to zero. */ +/** Sets backedge information to zero. */ void clear_backedges (ir_node *n); -/**********************************************************************/ -/** The loops datastructure **/ -/** **/ -/** The loops datastructure represents circles in the intermediate **/ -/** representation. It does not represent loops in the terms of a **/ -/** source program. **/ -/** Each ir_graph can contain one outermost loop datastructure. **/ -/** loop is the entry point to the nested loops. **/ -/** The loop datastructure contains a field indicating the depth of **/ -/** the loop within the nesting. Further it contains a list of the **/ -/** loops with nesting depth -1. Finally it contains a list of all **/ -/** nodes in the loop. **/ -/* @@@ We could add a field pointing from a node to the containing loop, - this would cost a lot of memory, though. */ -/**********************************************************************/ - +/** + * The loops datastructure. + * + * The loops datastructure represents circles in the intermediate + * representation. It does not represent loops in the terms of a + * source program. + * Each ir_graph can contain one outermost loop datastructure. + * loop is the entry point to the nested loops. + * The loop datastructure contains a field indicating the depth of + * the loop within the nesting. Further it contains a list of the + * loops with nesting depth -1. Finally it contains a list of all + * nodes in the loop. + * + * @todo We could add a field pointing from a node to the containing loop, + * this would cost a lot of memory, though. + */ typedef struct ir_loop ir_loop; void set_irg_loop(ir_graph *irg, ir_loop *l); ir_loop *get_irg_loop(ir_graph *irg); -/* Returns the loop n is contained in. +/** Returns the loop n is contained in. assumes current_ir_graph set properly. */ ir_loop *get_irn_loop(ir_node *n); -/* Returns outer loop, itself if outermost. */ +/** Returns outer loop, itself if outermost. */ ir_loop *get_loop_outer_loop (ir_loop *loop); -/* Returns nesting depth of this loop */ +/** Returns nesting depth of this loop */ int get_loop_depth (ir_loop *loop); /* Sons are the inner loops contained in this loop. */ -/* Returns the number of inner loops */ +/** Returns the number of inner loops */ int get_loop_n_sons (ir_loop *loop); ir_loop *get_loop_son (ir_loop *loop, int pos); -/* Returns the number of nodes contained in loop. */ +/** Returns the number of nodes contained in loop. */ int get_loop_n_nodes (ir_loop *loop); ir_node *get_loop_node (ir_loop *loop, int pos); -/**********************************************************************/ -/* Constructing and destructing the loop/backedge information. **/ -/**********************************************************************/ +/* + * Constructing and destructing the loop/backedge information. + */ -/* Constructs backedge information for irg in intraprocedural view. */ +/** Constructs backedge information for irg in intraprocedural view. */ void construct_backedges(ir_graph *irg); -/* Constructs backedges for all irgs in interprocedural view. All +/** Constructs backedges for all irgs in interprocedural view. All loops in the graph will be marked as such, not only realizeable loops and recursions in the program. E.g., if the same funcion is called twice, there is a loop between the first funcion return and the second call. */ -void construct_ip_backedges(); +void construct_ip_backedges(void); #endif /* _IRLOOP_H_ */ diff --git a/ir/ana/irloop_t.h b/ir/ana/irloop_t.h index 9797db619..3aac65e90 100644 --- a/ir/ana/irloop_t.h +++ b/ir/ana/irloop_t.h @@ -1,9 +1,11 @@ /* Copyright (C) 2002 by Universitaet Karlsruhe * All rights reserved. +*/ + +/** +* @file irloop_t.h * -* Authors: Goetz Lindenmaier -* -* irloops_t.h: +* @author Goetz Lindenmaier */ /* $Id$ */ @@ -14,13 +16,14 @@ #ifndef _IRLOOP_T_H_ #define _IRLOOP_T_H_ +/** The loops datastructure. */ struct ir_loop { - firm_kind kind; /* A type tag, set to k_ir_loop. */ + firm_kind kind; /**< A type tag, set to k_ir_loop. */ - struct ir_loop *outer_loop; /* The outer loop */ - struct ir_loop **sons; /* Inner loops */ - struct ir_node **nodes; /* Nodes in loop. */ - int depth; /* Nesting depth */ + struct ir_loop *outer_loop; /**< The outer loop */ + struct ir_loop **sons; /**< Inner loops */ + struct ir_node **nodes; /**< Nodes in loop. */ + int depth; /**< Nesting depth */ /* struct state_entry *mem_phis; struct state_entry *states; diff --git a/ir/ir/irgraph_t.h b/ir/ir/irgraph_t.h index 66f7ae8ec..200831e3b 100644 --- a/ir/ir/irgraph_t.h +++ b/ir/ir/irgraph_t.h @@ -1,9 +1,13 @@ /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe * All rights reserved. +*/ + +/** +* @file irgraph_t.h * -* Authors: Martin Trapp, Christian Schaefer +* ir graph construction. * -* irgraph.h: ir graph construction +* @author Martin Trapp, Christian Schaefer */ /* $Id$ */ @@ -17,60 +21,60 @@ #define FRAME_TP_SUFFIX "frame_tp" -/* ir_graph holds all information for a procedure */ +/** ir_graph holds all information for a procedure */ struct ir_graph { - /** Basics of the representation **/ - struct entity *ent; /* The entity of this procedure, i.e., + /* -- Basics of the representation -- */ + struct entity *ent; /**< The entity of this procedure, i.e., the type of the procedure and the class it belongs to. */ - struct type *frame_type; /* A class type representing the stack frame. + struct type *frame_type; /**< A class type representing the stack frame. Can include "inner" methods. */ - struct ir_node *start_block; /* block the start node will belong to */ - struct ir_node *start; /* start node of this ir_graph */ - struct ir_node *end_block; /* block the end node will belong to */ - struct ir_node *end; /* end node of this ir_graph */ - struct ir_node *cstore; /* constant store -- no more needed!! */ - struct ir_node *frame; /* method's frame */ - struct ir_node *globals; /* pointer to the data segment containing all + struct ir_node *start_block; /**< block the start node will belong to */ + struct ir_node *start; /**< start node of this ir_graph */ + struct ir_node *end_block; /**< block the end node will belong to */ + struct ir_node *end; /**< end node of this ir_graph */ + struct ir_node *cstore; /**< constant store -- no more needed!! */ + struct ir_node *frame; /**< method's frame */ + struct ir_node *globals; /**< pointer to the data segment containing all globals as well as global procedures. */ - struct ir_node *args; /* methods arguments */ - struct ir_node *bad; /* bad node of this ir_graph, the one and + struct ir_node *args; /**< methods arguments */ + struct ir_node *bad; /**< bad node of this ir_graph, the one and only in this graph */ - struct ir_node *unknown; /* unknown node of this ir_graph */ - struct obstack *obst; /* obstack where all of the ir_nodes live */ - struct ir_node *current_block; /* block for newly gen_*()-erated + struct ir_node *unknown; /**< unknown node of this ir_graph */ + struct obstack *obst; /**< obstack where all of the ir_nodes live */ + struct ir_node *current_block; /**< block for newly gen_*()-erated ir_nodes */ - /** Fields indicating different states of irgraph **/ - irg_phase_state phase_state; /* compiler phase */ - op_pinned pinned; /* Flag for status of nodes */ - irg_outs_state outs_state; /* Out edges. */ - irg_dom_state dom_state; /* Dominator information */ + /* -- Fields indicating different states of irgraph -- */ + irg_phase_state phase_state; /**< compiler phase */ + op_pinned pinned; /**< Flag for status of nodes */ + irg_outs_state outs_state; /**< Out edges. */ + irg_dom_state dom_state; /**< Dominator information */ - /** Fields for construction **/ + /* -- Fields for construction -- */ #if USE_EXPLICIT_PHI_IN_STACK - struct Phi_in_stack *Phi_in_stack; /* needed for automatic Phi construction */ + struct Phi_in_stack *Phi_in_stack; /**< needed for automatic Phi construction */ #endif - int n_loc; /* number of local variable in this + int n_loc; /**< number of local variable in this procedure including procedure parameters. */ - /** Fields for optimizations / analysis information **/ - pset *value_table; /* hash table for global value numbering (cse) + /* -- Fields for optimizations / analysis information -- */ + pset *value_table; /**< hash table for global value numbering (cse) for optimizing use in iropt.c */ - struct ir_node **outs; /* Space for the out arrays. */ - struct ir_loop *loop; /* The outermost loop */ - void *link; /* A void* field to link any information to + struct ir_node **outs; /**< Space for the out arrays. */ + struct ir_loop *loop; /**< The outermost loop */ + void *link; /**< A void* field to link any information to the node. */ - /** Fields for Walking the graph **/ - unsigned long visited; /* this flag is an identifier for + /* -- Fields for Walking the graph -- */ + unsigned long visited; /**< this flag is an identifier for ir walk. it will be incremented every time someone walks through the graph */ - unsigned long block_visited; /* same as visited, for a complete block */ + unsigned long block_visited; /**< same as visited, for a complete block */ }; -/* Make a rudimentary ir graph for the constant code. +/** Make a rudimentary ir graph for the constant code. Must look like a correct irg, spare everything else. */ ir_graph *new_const_code_irg(); -- 2.20.1