Commit 68aa7e58 authored by Michael Beck's avatar Michael Beck
Browse files

Converted to doxygen comments

[r726]
parent ac478f0c
/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe 3 2002/02/28 13:33:52 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe 3 2002/02/28 13:33:52
* All rights reserved. * All rights reserved.
*
* Authors: Martin Trapp, Christian Schaefer
*
* declarations of an ir node
*/ */
/**
* @file irnode.h
*
* Declarations of an ir node.
*
* author Martin Trapp, Christian Schaefer
*/
/* $Id$ */ /* $Id$ */
# ifndef _IRNODE_H_ # ifndef _IRNODE_H_
...@@ -23,7 +27,7 @@ ...@@ -23,7 +27,7 @@
/* The type definiton of ir_node is also in irgraph.h to resolve /* The type definiton of ir_node is also in irgraph.h to resolve
recursion between irnode.h and irgraph.h */ recursion between irnode.h and irgraph.h */
/** /*
* *
* NAME ir_node - a datatype representing a Firm node * NAME ir_node - a datatype representing a Firm node
* *
...@@ -53,9 +57,10 @@ typedef struct ir_node ir_node; ...@@ -53,9 +57,10 @@ typedef struct ir_node ir_node;
you can work on the graph without considering the different types you can work on the graph without considering the different types
of nodes, it's just a big graph. **/ of nodes, it's just a big graph. **/
/* returns the number of predecessors without the block predecessor: */ /** returns the number of predecessors without the block predecessor: */
int get_irn_arity (ir_node *node); int get_irn_arity (ir_node *node);
/* Replaces the old in array by a new one that will contain the ins given in
/** Replaces the old in array by a new one that will contain the ins given in
the parameters. Conserves the block predecessor. It copies the array passed. the parameters. Conserves the block predecessor. It copies the array passed.
This function is necessary to ajust in arrays of blocks, calls and phis. This function is necessary to ajust in arrays of blocks, calls and phis.
Assumes that current_ir_graph is set to the graph containing "node". Assumes that current_ir_graph is set to the graph containing "node".
...@@ -97,18 +102,21 @@ INLINE int irn_not_visited (ir_node *node); ...@@ -97,18 +102,21 @@ INLINE int irn_not_visited (ir_node *node);
INLINE int irn_visited (ir_node *node); INLINE int irn_visited (ir_node *node);
INLINE void set_irn_link (ir_node *node, void *link); INLINE void set_irn_link (ir_node *node, void *link);
INLINE void *get_irn_link (ir_node *node); INLINE void *get_irn_link (ir_node *node);
/* Outputs a unique number for this node if libfirm is compiled for
/** Outputs a unique number for this node if libfirm is compiled for
debugging, (configure with --enable-debug) else returns 0. */ debugging, (configure with --enable-debug) else returns 0. */
INLINE long get_irn_node_nr(ir_node *node); INLINE long get_irn_node_nr(ir_node *node);
/* Returns the ir_graph this node belongs to. Only valid for
/** Returns the ir_graph this node belongs to. Only valid for
* CallBegin, EndReg and EndExcept */ * CallBegin, EndReg and EndExcept */
INLINE ir_graph *get_irn_irg(ir_node *node); INLINE ir_graph *get_irn_irg(ir_node *node);
/* irnode constructor */ /**
/* Create a new irnode in irg, with an op, mode, arity and */ * irnode constructor.
/* some incoming irnodes. */ * Create a new irnode in irg, with an op, mode, arity and
/* If arity is negative, a node with a dynamic array is created. */ * some incoming irnodes.
* If arity is negative, a node with a dynamic array is created.
*/
INLINE ir_node * INLINE ir_node *
new_ir_node (dbg_info *db, new_ir_node (dbg_info *db,
ir_graph *irg, ir_graph *irg,
...@@ -118,7 +126,7 @@ new_ir_node (dbg_info *db, ...@@ -118,7 +126,7 @@ new_ir_node (dbg_info *db,
int arity, int arity,
ir_node *in[]); ir_node *in[]);
/** /*
* *
* NAME access functions for node fields. * NAME access functions for node fields.
* *
...@@ -130,15 +138,15 @@ new_ir_node (dbg_info *db, ...@@ -130,15 +138,15 @@ new_ir_node (dbg_info *db,
INLINE ir_node *get_nodes_Block (ir_node *node); INLINE ir_node *get_nodes_Block (ir_node *node);
INLINE void set_nodes_Block (ir_node *node, ir_node *block); INLINE void set_nodes_Block (ir_node *node, ir_node *block);
/* Projection numbers for result of Start node: use for Proj nodes! */ /** Projection numbers for result of Start node: use for Proj nodes! */
typedef enum { typedef enum {
pns_initial_exec, /* Projection on an executable, the initial control pns_initial_exec, /**< Projection on an executable, the initial control
flow. */ flow. */
pns_global_store, /* Projection on the global store */ pns_global_store, /**< Projection on the global store */
pns_frame_base, /* Projection on the frame base */ pns_frame_base, /**< Projection on the frame base */
pns_globals, /* Projection on the pointer to the data segment pns_globals, /**< Projection on the pointer to the data segment
containing _all_ global entities. */ containing _all_ global entities. */
pns_args /* Projection on all arguments */ pns_args /**< Projection on all arguments */
} pns_number; } pns_number;
/* @@@ no more supported */ /* @@@ no more supported */
...@@ -201,8 +209,8 @@ ir_graph *get_EndExcept_irg (ir_node *end); ...@@ -201,8 +209,8 @@ ir_graph *get_EndExcept_irg (ir_node *end);
Default flavor is "dense" Default flavor is "dense"
*/ */
typedef enum { typedef enum {
dense, /* Default. Missing Proj nodes are dead control flow. */ dense, /**< Default. Missing Proj nodes are dead control flow. */
fragmentary /* Special. No control flow optimizations allowed. Missing fragmentary /**< Special. No control flow optimizations allowed. Missing
Proj nodes mean default control flow, i.e., Proj(n). */ Proj nodes mean default control flow, i.e., Proj(n). */
} cond_kind; } cond_kind;
...@@ -226,16 +234,16 @@ INLINE void set_Raise_exo_ptr (ir_node *node, ir_node *exoptr); ...@@ -226,16 +234,16 @@ INLINE void set_Raise_exo_ptr (ir_node *node, ir_node *exoptr);
INLINE tarval *get_Const_tarval (ir_node *node); INLINE tarval *get_Const_tarval (ir_node *node);
INLINE void set_Const_tarval (ir_node *node, tarval *con); INLINE void set_Const_tarval (ir_node *node, tarval *con);
/* This enum names the three different kinds of symbolic Constants /** This enum names the three different kinds of symbolic Constants
represented by SymConst. The content of the attribute type_or_id represented by SymConst. The content of the attribute type_or_id
depends on this tag. Use the proper access routine after testing depends on this tag. Use the proper access routine after testing
this flag. */ this flag. */
typedef enum { typedef enum {
type_tag, /* The SymConst is a type tag for the given type. type_tag, /**< The SymConst is a type tag for the given type.
Type_or_id_p is type *. */ Type_or_id_p is type *. */
size, /* The SymConst is the size of the given type. size, /**< The SymConst is the size of the given type.
Type_or_id_p is type *. */ Type_or_id_p is type *. */
linkage_ptr_info /* The SymConst is a symbolic pointer to be filled in linkage_ptr_info /**< The SymConst is a symbolic pointer to be filled in
by the linker. Type_or_id_p is ident *. */ by the linker. Type_or_id_p is ident *. */
} symconst_kind; } symconst_kind;
typedef union type_or_id * type_or_id_p; typedef union type_or_id * type_or_id_p;
...@@ -377,24 +385,24 @@ INLINE void set_Eor_right (ir_node *node, ir_node *right); ...@@ -377,24 +385,24 @@ INLINE void set_Eor_right (ir_node *node, ir_node *right);
INLINE ir_node *get_Not_op (ir_node *node); INLINE ir_node *get_Not_op (ir_node *node);
INLINE void set_Not_op (ir_node *node, ir_node *op); INLINE void set_Not_op (ir_node *node, ir_node *op);
/* Projection numbers of compare: use for Proj nodes! */ /** Projection numbers of compare: use for Proj nodes! */
typedef enum { typedef enum {
False, /* false */ False, /**< false */
Eq, /* equal */ Eq, /**< equal */
Lt, /* less */ Lt, /**< less */
Le, /* less or equal */ Le, /**< less or equal */
Gt, /* greater */ Gt, /**< greater */
Ge, /* greater or equal */ Ge, /**< greater or equal */
Lg, /* less or greater */ Lg, /**< less or greater */
Leg, /* less, equal or greater = ordered */ Leg, /**< less, equal or greater = ordered */
Uo, /* unordered */ Uo, /**< unordered */
Ue, /* unordered or equal */ Ue, /**< unordered or equal */
Ul, /* unordered or less */ Ul, /**< unordered or less */
Ule, /* unordered, less or equal */ Ule, /**< unordered, less or equal */
Ug, /* unordered or greater */ Ug, /**< unordered or greater */
Uge, /* unordered, greater or equal */ Uge, /**< unordered, greater or equal */
Ne, /* unordered, less or greater = not equal */ Ne, /**< unordered, less or greater = not equal */
True /* true */ True /**< true */
/* not_mask = Leg*/ /* bits to flip to negate comparison * @@ hack for jni interface */ /* not_mask = Leg*/ /* bits to flip to negate comparison * @@ hack for jni interface */
} pnc_number; } pnc_number;
#define not_mask Leg #define not_mask Leg
...@@ -462,10 +470,13 @@ INLINE ir_node *get_Alloc_size (ir_node *node); ...@@ -462,10 +470,13 @@ INLINE ir_node *get_Alloc_size (ir_node *node);
INLINE void set_Alloc_size (ir_node *node, ir_node *size); INLINE void set_Alloc_size (ir_node *node, ir_node *size);
INLINE type *get_Alloc_type (ir_node *node); INLINE type *get_Alloc_type (ir_node *node);
INLINE void set_Alloc_type (ir_node *node, type *tp); INLINE void set_Alloc_type (ir_node *node, type *tp);
/** allocation place. */
typedef enum { typedef enum {
stack_alloc, /* Alloc allocates the object on the stack. */ stack_alloc, /**< Alloc allocates the object on the stack. */
heap_alloc /* Alloc allocates the object on the heap. */ heap_alloc /**< Alloc allocates the object on the heap. */
} where_alloc; } where_alloc;
INLINE where_alloc get_Alloc_where (ir_node *node); INLINE where_alloc get_Alloc_where (ir_node *node);
INLINE void set_Alloc_where (ir_node *node, where_alloc where); INLINE void set_Alloc_where (ir_node *node, where_alloc where);
...@@ -497,7 +508,7 @@ INLINE ir_node *get_Id_pred (ir_node *node); ...@@ -497,7 +508,7 @@ INLINE ir_node *get_Id_pred (ir_node *node);
INLINE void set_Id_pred (ir_node *node, ir_node *pred); INLINE void set_Id_pred (ir_node *node, ir_node *pred);
/** /*
* *
* NAME Auxiliary routines * NAME Auxiliary routines
* *
...@@ -505,43 +516,44 @@ INLINE void set_Id_pred (ir_node *node, ir_node *pred); ...@@ -505,43 +516,44 @@ INLINE void set_Id_pred (ir_node *node, ir_node *pred);
* *
*/ */
/* returns operand of node if node is a Proj. */ /** returns operand of node if node is a Proj. */
INLINE ir_node *skip_Proj (ir_node *node); INLINE ir_node *skip_Proj (ir_node *node);
/* returns operand of node if node is a Id */ /** returns operand of node if node is a Id */
INLINE ir_node *skip_nop (ir_node *node); INLINE ir_node *skip_nop (ir_node *node);
INLINE ir_node *skip_Id (ir_node *node); /* Same as skip_nop. */ INLINE ir_node *skip_Id (ir_node *node); /* Same as skip_nop. */
/* returns corresponding operand of Tuple if node is a Proj from /* returns corresponding operand of Tuple if node is a Proj from
a Tuple. */ a Tuple. */
INLINE ir_node *skip_Tuple (ir_node *node); INLINE ir_node *skip_Tuple (ir_node *node);
/* returns true if node is a Bad node. */ /** returns true if node is a Bad node. */
INLINE int is_Bad (ir_node *node); INLINE int is_Bad (ir_node *node);
/* returns true if the node is not a Block */ /** returns true if the node is not a Block */
INLINE int is_no_Block (ir_node *node); INLINE int is_no_Block (ir_node *node);
/* returns true if the node is a Block */ /** returns true if the node is a Block */
INLINE int is_Block (ir_node *node); INLINE int is_Block (ir_node *node);
/* returns true if node is a Proj node or a Filter node in /** returns true if node is a Proj node or a Filter node in
* intraprocedural view */ * intraprocedural view */
INLINE int is_Proj (ir_node *node); INLINE int is_Proj (ir_node *node);
/* Returns true if the operation manipulates control flow: /** Returns true if the operation manipulates control flow:
Start, End, Jmp, Cond, Return, Raise, Bad, CallBegin, EndReg, EndExcept */ Start, End, Jmp, Cond, Return, Raise, Bad, CallBegin, EndReg, EndExcept */
int is_cfop(ir_node *node); int is_cfop(ir_node *node);
/* Returns true if the operation manipulates interprocedural control flow: /** Returns true if the operation manipulates interprocedural control flow:
CallBegin, EndReg, EndExcept */ CallBegin, EndReg, EndExcept */
int is_ip_cfop(ir_node *node); int is_ip_cfop(ir_node *node);
/* Returns true if the operation can change the control flow because /** Returns true if the operation can change the control flow because
of an exception: Call, Quot, DivMod, Div, Mod, Load, Store, Alloc, of an exception: Call, Quot, DivMod, Div, Mod, Load, Store, Alloc,
Bad. */ Bad. */
ir_graph *get_ip_cfop_irg(ir_node *n); ir_graph *get_ip_cfop_irg(ir_node *n);
int is_fragile_op(ir_node *node); int is_fragile_op(ir_node *node);
/* Returns the memory operand of fragile operations. */ /** Returns the memory operand of fragile operations. */
ir_node *get_fragile_op_mem(ir_node *node); ir_node *get_fragile_op_mem(ir_node *node);
/* Makros for debugging the libfirm */
#include "ident.h" #include "ident.h"
/*@{*/
/** Makros for debugging the libfirm */
#ifdef __GNUC__ #ifdef __GNUC__
/* /*
* GNU C has the __FUNCTION__ extension * GNU C has the __FUNCTION__ extension
...@@ -581,6 +593,7 @@ ir_node *get_fragile_op_mem(ir_node *node); ...@@ -581,6 +593,7 @@ ir_node *get_fragile_op_mem(ir_node *node);
#define DDMI(X) xprintf("%s(l.%i) %I: %p\n", __FILE__, __LINE__, (X), (X)) #define DDMI(X) xprintf("%s(l.%i) %I: %p\n", __FILE__, __LINE__, (X), (X))
#endif /* __GNUC__ */ #endif /* __GNUC__ */
/*@}*/
# endif /* _IRNODE_H_ */ # endif /* _IRNODE_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment