-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*/
+/*
+ * Project: libFIRM
+ * File name: ir/ir/irnode_t.h
+ * Purpose: Representation of an intermediate operation -- private header.
+ * Author: Martin Trapp, Christian Schaefer
+ * Modified by: Goetz Lindenmaier
+ * Created:
+ * CVS-ID: $Id$
+ * Copyright: (c) 1998-2003 Universität Karlsruhe
+ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ */
+
/**
* @file irnode_t.h
* @author Martin Trapp, Christian Schaefer
*/
-/* $Id$ */
# ifndef _IRNODE_T_H_
# define _IRNODE_T_H_
#endif
# include "irnode.h"
-# include "xprintf.h"
# include "irop_t.h"
# include "firm_common_t.h"
# include "irdom_t.h" /* For size of struct dom_info. */
# include "dbginfo.h"
+# include "irloop.h"
# include "exc.h"
/** Block attributes */
typedef struct {
+ /* General attributes */
+ ir_graph *irg;
unsigned long block_visited; /**< for the walker that walks over all blocks. */
/* Attributes private to construction: */
bool matured; /**< if set, all in-nodes of the block are fixed */
struct ir_node **graph_arr; /**< array to store all parameters */
+ /* Attributes holding analyses information */
struct dom_info dom; /**< Datastructure that holds information about dominators.
- @todo
- Eventually overlay with graph_arr as only valid
- in different phases. Eventually inline the whole
- datastructure. */
- exc_t exc; /**< role of this block for exception handling */
- ir_node *handler_entry; /**< handler entry block iff this block is part of a region */
+ @@@ @todo
+ Eventually overlay with graph_arr as only valid
+ in different phases. Eventually inline the whole
+ datastructure. */
+ // exc_t exc; /**< role of this block for exception handling */
+ // ir_node *handler_entry; /**< handler entry block iff this block is part of a region */
ir_node ** in_cg; /**< array with predecessors in
* interprocedural_view, if they differ
* from intraprocedural predecessors */
int *backedge; /**< Field n set to true if pred n is backedge.
- @todo Ev. replace by bitfield! */
+ @@@ @todo Ev. replace by bitfield! */
int *cg_backedge; /**< Field n set to true if pred n is interprocedural backedge.
- @todo Ev. replace by bitfield! */
+ @@@ @todo Ev. replace by bitfield! */
} block_attr;
+/** Start attributes */
+typedef struct {
+ char dummy;
+ // ir_graph *irg; @@@ now in block
+} start_attr;
+
/** Cond attributes */
typedef struct {
cond_kind kind; /**< flavor of Cond */
long default_proj; /**< for optimization: biggest Proj number, i.e. the one
- used for default. */
+ used for default. */
} cond_attr;
+/** Const attributes */
+typedef struct {
+ tarval *tv; /**< the target value */
+ type *tp; /**< the source type, for analyses. default: type_unknown. */
+} const_attr;
+
/** SymConst attributes
This union contains the symbolic information represented by the node */
typedef union type_or_id {
- type *typ;
+ type *typ;
ident *ptrinfo;
} type_or_id;
/** EndReg/EndExcept attributes */
typedef struct {
- ir_graph * irg; /**< ir_graph this node belongs to (for
- * navigating in interprocedural graphs) */
+ char dummy;
+ // ir_graph * irg; /**< ir_graph this node belongs to (for
+ // * navigating in interprocedural graphs)
+ // @@@ now in block */
} end_attr;
/** CallBegin attributes */
typedef struct {
- ir_graph * irg; /**< ir_graph this node belongs to (for
- * navigating in interprocedural graphs) */
+ // ir_graph * irg; / **< ir_graph this node belongs to (for
+ // * navigating in interprocedural graphs) */
+ // @@@ now in block
ir_node * call; /**< associated Call-operation */
} callbegin_attr;
+/** Cast attributes */
+typedef struct {
+ type *totype;
+} cast_attr;
+
+typedef pn_Cmp confirm_attr; /** Attribute to hold compare operation */
+
/** Some irnodes just have one attribute, these are stored here,
some have more. Their name is 'irnodename_attr' */
typedef union {
+ start_attr start; /**< For Start */
block_attr block; /**< For Block: Fields needed to construct it */
cond_attr c; /**< For Cond. */
- struct tarval *con; /**< For Const: contains the value of the constant */
+ const_attr con; /**< For Const: contains the value of the constant and a type */
symconst_attr i; /**< For SymConst. */
sel_attr s; /**< For Sel. */
call_attr call; /**< For Call: pointer to the type of the method to call */
alloc_attr a; /**< For Alloc. */
io_attr io; /**< For InstOf */
type *f; /**< For Free. */
+ cast_attr cast; /**< For Cast. */
int phi0_pos; /**< For Phi. Used to remember the value defined by
this Phi node. Needed when the Phi is completed
to call get_r_internal_value to find the
Field n set to true if pred n is backedge.
@todo Ev. replace by bitfield! */
long proj; /**< For Proj: contains the result position to project */
+ confirm_attr confirm_cmp; /**< For Confirm: compare operation */
filter_attr filter; /**< For Filter */
end_attr end; /**< For EndReg, EndExcept */
#if PRECISE_EXC_CONTEXT
int node_nr; /**< a unique node number for each node to make output
readable. */
#endif
+ /* ------- For analyses -------- */
+ ir_loop *loop; /**< the loop the node is in. Access routines in irloop.h */
+ /* ------- Opcode depending fields -------- */
attr attr; /**< attribute of this node. Depends on opcode.
Must be last field of struct ir_node. */
};
/** Copies all attributes stored in the old node to the new node.
Assumes both have the same opcode and sufficient size. */
void
-copy_attrs (ir_node *old, ir_node *new);
-
+copy_attrs(const ir_node *old_node, ir_node *new_node);
-/** Print IR-Nodes with attributes
- @todo brauchen wir dienoch? dann fliegt ev. das xprint raus? */
-int ir_node_print (XP_PAR1, const xprintf_info *, XP_PARN);
/** Returns the array with the ins. The content of the array may not be
changed. */
-ir_node **get_irn_in (ir_node *node);
+ir_node **get_irn_in (const ir_node *node);
/*@{*/
/** access attributes directly */
-INLINE tarval *get_irn_const_attr (ir_node *node);
+INLINE const_attr get_irn_const_attr (ir_node *node);
INLINE long get_irn_proj_attr (ir_node *node);
INLINE alloc_attr get_irn_alloc_attr (ir_node *node);
INLINE type *get_irn_free_attr (ir_node *node);
INLINE symconst_attr get_irn_symconst_attr (ir_node *node);
type *get_irn_call_attr (ir_node *node);
+type *get_irn_funccall_attr (ir_node *node);
sel_attr get_irn_sel_attr (ir_node *node);
int get_irn_phi_attr (ir_node *node);
block_attr get_irn_block_attr (ir_node *node);