Fixed 'inline' lossage --flo
[libfirm] / ir / ir / irnode_t.h
index c5e1c46..fa24090 100644 (file)
@@ -1,6 +1,15 @@
-/* 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
@@ -10,7 +19,6 @@
  * @author Martin Trapp, Christian Schaefer
  */
 
-/* $Id$ */
 
 # ifndef _IRNODE_T_H_
 # define _IRNODE_T_H_
@@ -24,6 +32,7 @@
 # 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 {
-  ir_graph *irg;
+  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;
 
@@ -114,14 +133,17 @@ typedef struct {
 
 /** 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;
 
@@ -130,13 +152,15 @@ 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 */
@@ -155,6 +179,7 @@ typedef union {
                           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
@@ -185,6 +210,9 @@ struct ir_node {
   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. */
 };
@@ -192,7 +220,7 @@ 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);
 
 
 /** Returns the array with the ins.  The content of the array may not be
@@ -201,12 +229,13 @@ 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);