#include "irpass.h"
#include "irprintf.h"
#include "irprog.h"
-#include "irsimpletype.h"
#include "irtypeinfo.h"
#include "irverify.h"
#include "lowering.h"
FIRM_API ir_node *new_rd_Return(dbg_info *db, ir_node *block,
ir_node *store, int arity, ir_node *in[]);
-/** Constructor for a Const_type node.
- *
- * Adds the node to the start block.
- *
- * The constant represents a target value. This constructor sets high
- * level type information for the constant value.
- * Derives mode from passed tarval.
- *
- * @param *db A pointer for debug information.
- * @param *irg The IR graph the node belongs to.
- * @param *con Points to an entry in the constant table.
- * @param *tp The type of the constant.
- */
-FIRM_API ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg,
- tarval *con, ir_type *tp);
-
/** Constructor for a Const node.
*
* Adds the node to the start block.
FIRM_API ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg,
ir_mode *mode, long value);
-/** Constructor for a SymConst_type node.
+/** Constructor for a SymConst node.
*
* This is the constructor for a symbolic constant.
* There are several kinds of symbolic constants:
* @param val A type, ident, entity or enum constant depending on the
* SymConst kind.
* @param kind The kind of the symbolic constant, see the list above
- * @param tp The source type of the constant.
- */
-FIRM_API ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg,
- ir_mode *mode, union symconst_symbol val,
- symconst_kind kind, ir_type *tp);
-
-/** Constructor for a SymConst node.
- *
- * Same as new_rd_SymConst_type, except that it sets the type to type_unknown.
*/
FIRM_API ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode,
union symconst_symbol value,
/** Constructor for a SymConst addr_ent node.
*
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
* symconst_addr_ent.
* Adds the SymConst to the start block of irg. */
FIRM_API ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg,
- ir_mode *mode, ir_entity *symbol,
- ir_type *tp);
+ ir_mode *mode, ir_entity *symbol);
/** Constructor for a SymConst ofs_ent node.
*
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
* symconst_ofs_ent.
* Adds the SymConst to the start block of irg.
*/
FIRM_API ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg,
- ir_mode *mode, ir_entity *symbol,
- ir_type *tp);
+ ir_mode *mode, ir_entity *symbol);
/** Constructor for a SymConst type_tag node.
*
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
* symconst_type_tag.
* Adds the SymConst to the start block of irg.
*/
FIRM_API ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg,
- ir_mode *mode, ir_type *symbol,
- ir_type *tp);
+ ir_mode *mode, ir_type *symbol);
/** Constructor for a SymConst size node.
*
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
* symconst_type_size.
* Adds the SymConst to the start block of irg. */
FIRM_API ir_node *new_rd_SymConst_size(dbg_info *db, ir_graph *irg,
- ir_mode *mode, ir_type *symbol,
- ir_type *tp);
+ ir_mode *mode, ir_type *symbol);
/** Constructor for a SymConst size node.
*
- * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * Same as new_rd_SymConst, except that the constructor is tailored for
* symconst_type_align.
* Adds the SymConst to the start block of irg.
*/
FIRM_API ir_node *new_rd_SymConst_align(dbg_info *db, ir_graph *irg,
- ir_mode *mode, ir_type *symbol,
- ir_type *tp);
+ ir_mode *mode, ir_type *symbol);
/** Constructor for a simpleSel node.
*
*/
FIRM_API ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value);
-/** Constructor for a Const_type node.
- *
- * Adds the node to the start block.
- *
- * The constant represents a target value. This constructor sets high
- * level type information for the constant value.
- * Derives mode from passed tarval.
- *
- * @param *irg The IR graph the node belongs to.
- * @param *con Points to an entry in the constant table.
- * @param *tp The type of the constant.
- */
-FIRM_API ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp);
-
/** Constructor for a SymConst node.
*
* This is the constructor for a symbolic constant.
FIRM_API ir_node *new_d_Return(dbg_info *db, ir_node *store,
int arity, ir_node *in[]);
-/** Constructor for a Const_type node.
- *
- * Adds the node to the start block.
- *
- * The constant represents a target value. This constructor sets high
- * level type information for the constant value.
- * Derives mode from passed tarval.
- *
- * @param *db A pointer for debug information.
- * @param *con Points to an entry in the constant table. This pointer is
- added to the attributes of the node.
- * @param *tp The type of the constant.
- */
-FIRM_API ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp);
-
/** Constructor for a Const node.
*
* Adds the node to the block in current_ir_block.
*/
FIRM_API ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value);
-/** Constructor for a SymConst_type node.
+/** Constructor for a SymConst node.
*
* This is the constructor for a symbolic constant.
* There are several kinds of symbolic constants:
* @param value A type, ident, entity or enum constant depending on the
* SymConst kind.
* @param kind The kind of the symbolic constant, see the list above
- * @param tp The source type of the constant.
- */
-FIRM_API ir_node *new_d_SymConst_type(dbg_info *db, ir_mode *mode,
- union symconst_symbol value,
- symconst_kind kind, ir_type *tp);
-
-/** Constructor for a SymConst node.
- *
- * Same as new_d_SymConst_type, except that it sets the type to type_unknown.
*/
FIRM_API ir_node *new_d_SymConst(dbg_info *db, ir_mode *mode,
union symconst_symbol value,
*/
FIRM_API ir_node *new_Const_long(ir_mode *mode, long value);
-/** Constructor for a Const node.
- *
- * Derives mode from passed tarval. */
-FIRM_API ir_node *new_Const_type(tarval *con, ir_type *tp);
-
-/** Constructor for a SymConst_type node.
- *
- * This is the constructor for a symbolic constant.
- * There are several kinds of symbolic constants:
- * - symconst_type_tag The symbolic constant represents a type tag. The
- * type the tag stands for is given explicitly.
- * - symconst_type_size The symbolic constant represents the size of a type.
- * The type of which the constant represents the size
- * is given explicitly.
- * - symconst_type_align The symbolic constant represents the alignment of a
- * type. The type of which the constant represents the
- * size is given explicitly.
- * - symconst_addr_ent The symbolic constant represents the address of an
- * entity (variable or method). The variable is given
- * explicitly by a firm entity.
- * - symconst_ofs_ent The symbolic constant represents the offset of an
- * entity in its owner type.
- * - symconst_enum_const The symbolic constant is a enumeration constant of
- * an enumeration type.
- *
- * Inputs to the node:
- * No inputs except the block it belongs to.
- * Outputs of the node.
- * An unsigned integer (I_u) or a pointer (P).
- *
- * Mention union in declaration so that the firmjni generator recognizes that
- * it can not cast the argument to an int.
- *
- * @param mode The mode for the SymConst.
- * @param value A type, ident, entity or enum constant depending on the
- * SymConst kind.
- * @param kind The kind of the symbolic constant, see the list above
- * @param tp The source type of the constant.
- */
-FIRM_API ir_node *new_SymConst_type(ir_mode *mode, union symconst_symbol value,
- symconst_kind kind, ir_type *tp);
-
/** Constructor for a SymConst node.
*
* This is the constructor for a symbolic constant.
/** Returns true if node is a SymConst node with kind symconst_addr_ent. */
FIRM_API int is_SymConst_addr_ent(const ir_node *node);
-/** Returns the source language type of a Const node.
- * Must be an atomic type. Mode of type must be mode of node.
- */
-FIRM_API ir_type *get_Const_type(const ir_node *node);
-
-/** Sets the source language type of a Const node. */
-FIRM_API void set_Const_type(ir_node *node, ir_type *tp);
-
/** Returns non-zero if s symconst kind has a type attribute */
#define SYMCONST_HAS_TYPE(kind) ((kind) <= symconst_type_align)
FIRM_API void set_SymConst_symbol(ir_node *node,
union symconst_symbol sym);
-/** Access the type of the value represented by the SymConst.
- *
- * Example: primitive type int for SymConst size. */
-FIRM_API ir_type *get_SymConst_value_type(const ir_node *node);
-FIRM_API void set_SymConst_value_type(ir_node *node, ir_type *tp);
-
FIRM_API ir_node **get_Sel_index_arr(ir_node *node);
FIRM_API int get_Sel_n_indexs(const ir_node *node);
FIRM_API ir_node *get_Sel_index(const ir_node *node, int pos);
*/
FIRM_API void copy_node_attr(ir_graph *irg, const ir_node *old_node, ir_node *new_node);
-/** Return the type associated with the value produced by n
- * if the node remarks this type as it is the case for
- * Cast, Const, SymConst and some Proj nodes or unknown_type. */
-FIRM_API ir_type *get_irn_type(ir_node *n);
-
/** Return the type attribute of a node n (SymConst, Call, Alloc, Free,
Cast) or NULL.*/
FIRM_API ir_type *get_irn_type_attr(ir_node *n);
*/
typedef void (*copy_attr_func)(ir_graph *irg, const ir_node *old_node, ir_node *new_node);
-/**
- * The get_type operation.
- * Return the type of the node self.
- */
-typedef ir_type *(*get_type_func)(const ir_node *self);
-
/**
* The get_type_attr operation. Used to traverse all types that can be
* accessed from an ir_graph.
node_cmp_attr_func node_cmp_attr; /**< Compares two node attributes. */
reassociate_func reassociate; /**< Reassociate a tree. */
copy_attr_func copy_attr; /**< Copy node attributes. */
- get_type_func get_type; /**< Return the type of a node. */
get_type_attr_func get_type_attr; /**< Return the type attribute of a node. */
get_entity_attr_func get_entity_attr; /**< Return the entity attribute of a node. */
verify_node_func verify_node; /**< Verify the node. */
+++ /dev/null
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Run most simple type analyses.
- * @author Goetz Lindenmaier
- * @date 22.8.2003
- * @version $Id$
- * @brief
- * We compute type information for each node. It is derived from the
- * types of the origines of values, e.g. parameter types can be derived
- * from the method type.
- * The type information so far is saved in the link field.
- */
-#ifndef FIRM_ANA_IRSIMPLETYPE_H
-#define FIRM_ANA_IRSIMPLETYPE_H
-
-#include "irgraph.h"
-#include "irnode.h"
-#include "typerep.h"
-#include "begin.h"
-
-/* ------------ Building and Removing the type information ----------- */
-
-/** Computes type information for each node in all ir graphs.
- *
- * Computes type information for each node. Stores the information in the
- * field defined in irtypeinfo.h. Sets typestate in irg to irg_typeinfo_consistent.
- *
- * Derives the information from nodes/patterns that give hints about the
- * type, as projecting an argument from the Start node. Deletes all previous
- * type information.
- *
- * If a non-pointer type is specified for a pointer value (as the Alloc node does:
- * it contains the type allocated, but to type the result we need the type that
- * describes a pointer to the allocated type) searches for a corresponding pointer
- * type. If several exist, uses one of them. If none exists, uses unknown_type.
- *
- * Uses the link field of types. Sets this field of each type to point to a
- * pointer type that points to the type (Got it? ;-)).
- */
-FIRM_API void simple_analyse_types(void);
-
-/** Frees all type information datastructures. Sets the flag in irg to "???". */
-FIRM_API void free_simple_type_information(void);
-
-#include "end.h"
-
-#endif
if (! c) {
ir_mode *mode = get_irn_mode(irn);
- ir_type *tp = get_irn_type(irn);
- tarval *tv = new_tarval_from_long(nr, mode);
- c = new_r_Const_type(current_ir_graph, tv, tp);
+ tarval *tv = new_tarval_from_long(nr, mode);
+ c = new_r_Const(current_ir_graph, tv);
}
set_irn_n(succ, pos, c);
+++ /dev/null
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Run most simple type analyses.
- * @author Goetz Lindenmaier
- * @date 22.8.2003
- * @version $Id$
- * @brief
- * Runs most simple type analyses.
- *
- * We compute type information for each node. It is derived from the
- * types of the origines of values, e.g. parameter types can be derived
- * from the method type.
- * The type information so far is saved in the link field.
- */
-#include "config.h"
-
-#include "irtypeinfo.h"
-#include "irsimpletype.h"
-
-#include "irnode_t.h"
-#include "irprog_t.h"
-#include "irgwalk.h"
-#include "ident.h"
-#include "trouts.h"
-#include "debug.h"
-#include "error.h"
-
-DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL);
-
-static ir_type *phi_cycle_type = NULL;
-
-
-/* ------------ Building and Removing the type information ----------- */
-
-
-/**
- * init type link field so that types point to their pointers.
- */
-static void precompute_pointer_types(void)
-{
-#if 0
- int i;
- set_type_link(firm_unknown_type, firm_unknown_type);
- set_type_link(firm_none_type, firm_unknown_type);
-
- for (i = get_irp_n_types() - 1; i >= 0; --i)
- set_type_link(get_irp_type(i), (void *)firm_unknown_type);
-
- for (i = get_irp_n_types() - 1; i >= 0; --i) {
- ir_type *tp = get_irp_type(i);
- if (is_Pointer_type(tp))
- set_type_link(get_pointer_points_to_type(tp), (void *)tp);
- }
-#else
- compute_trouts();
-#endif
-}
-
-/**
- * Returns a pointer to type which was stored in the link field
- * to speed up search.
- */
-static ir_type *find_pointer_type_to (ir_type *tp)
-{
-#if 0
- return (ir_type *)get_type_link(tp);
-#else
- if (get_type_n_pointertypes_to(tp) > 0)
- return get_type_pointertype_to(tp, 0);
- else
- return firm_unknown_type;
-#endif
-}
-
-static ir_type *compute_irn_type(ir_node *n);
-
-/**
- * Try to determine a type for a Proj node.
- * If a type cannot be determined, return @p firm_none_type.
- */
-static ir_type *find_type_for_Proj(ir_node *n)
-{
- ir_type *tp;
-
- /* Avoid nested Tuples. */
- ir_node *pred = skip_Tuple(get_Proj_pred(n));
- ir_mode *m = get_irn_mode(n);
-
- if (m == mode_T ||
- m == mode_BB ||
- m == mode_X ||
- m == mode_M ||
- m == mode_b )
- return firm_none_type;
-
- switch (get_irn_opcode(pred)) {
- case iro_Proj: {
- ir_node *pred_pred;
- /* Deal with Start / Call here: we need to know the Proj Nr. */
- assert(get_irn_mode(pred) == mode_T);
- pred_pred = get_Proj_pred(pred);
- if (is_Start(pred_pred)) {
- ir_type *mtp = get_entity_type(get_irg_entity(get_irn_irg(pred_pred)));
- tp = get_method_param_type(mtp, get_Proj_proj(n));
- } else if (is_Call(pred_pred)) {
- ir_type *mtp = get_Call_type(pred_pred);
- tp = get_method_res_type(mtp, get_Proj_proj(n));
- } else if (is_Tuple(pred_pred)) {
- panic("Encountered nested Tuple");
- } else {
- DB((dbg, SET_LEVEL_1, "Proj %ld from Proj from ??: unknown type\n", get_irn_node_nr(n)));
- tp = firm_unknown_type;
- }
- break;
- }
- case iro_Start:
- /* frame pointer, globals and tls */
- switch (get_Proj_proj(n)) {
- case pn_Start_P_frame_base:
- tp = find_pointer_type_to(get_irg_frame_type(get_irn_irg(pred)));
- break;
- case pn_Start_P_tls:
- tp = find_pointer_type_to(get_tls_type());
- break;
- default:
- DB((dbg, SET_LEVEL_1, "Proj %ld %ld from Start: unknown type\n", get_Proj_proj(n), get_irn_node_nr(n)));
- tp = firm_unknown_type;
- }
- break;
- case iro_Call:
- /* value args pointer */
- if (get_Proj_proj(n) == pn_Call_P_value_res_base) {
- DB((dbg, SET_LEVEL_1, "Value res base Proj %ld from Call: unknown type\n", get_irn_node_nr(n)));
- tp = firm_unknown_type; /* find_pointer_type_to(get....get_Call_type(pred)); */
- } else {
- DB((dbg, SET_LEVEL_1, "Proj %ld %ld from Call: unknown type\n", get_Proj_proj(n), get_irn_node_nr(n)));
- tp = firm_unknown_type;
- }
- break;
- case iro_Tuple:
- tp = compute_irn_type(get_Tuple_pred(pred, get_Proj_proj(n)));
- break;
- default:
- tp = compute_irn_type(pred);
- }
-
- return tp;
-}
-
-/**
- * Try to determine the type of a node.
- * If a type cannot be determined, return @p firm_none_type.
- */
-static ir_type *find_type_for_node(ir_node *n)
-{
- ir_type *tp = firm_unknown_type;
- ir_type *tp1 = NULL, *tp2 = NULL;
- ir_node *a = NULL, *b = NULL;
-
- if (is_unop(n)) {
- a = get_unop_op(n);
- tp1 = compute_irn_type(a);
- }
- if (is_binop(n)) {
- a = get_binop_left(n);
- b = get_binop_right(n);
- tp1 = compute_irn_type(a);
- tp2 = compute_irn_type(b);
- }
-
- switch (get_irn_opcode(n)) {
-
- case iro_InstOf:
- assert(0 && "op_InstOf not supported");
- break;
-
- /* has no type */
- case iro_Return: {
- /* Check returned type. */
- /*
- int i;
- ir_type *meth_type = get_entity_type(get_irg_entity(current_ir_graph));
- for (i = 0; i < get_method_n_ress(meth_type); i++) {
- ir_type *res_type = get_method_res_type(meth_type, i);
- ir_type *ana_res_type = get_irn_type(get_Return_res(n, i));
- if (ana_res_type == firm_unknown_type) continue;
- if (res_type != ana_res_type && "return value has wrong type") {
- assert(res_type == ana_res_type && "return value has wrong type");
- }
- }
- */
- }
- case iro_Block:
- case iro_Start:
- case iro_End:
- case iro_Jmp:
- case iro_Cond:
- case iro_Raise:
- case iro_Call:
- case iro_Cmp:
- case iro_Store:
- case iro_Free:
- case iro_Sync:
- case iro_Tuple:
- case iro_Bad:
- case iro_NoMem:
- break;
-
- /* compute the type */
- case iro_Const:
- tp = get_Const_type(n);
- break;
- case iro_SymConst:
- tp = get_SymConst_value_type(n);
- break;
- case iro_Sel:
- tp = find_pointer_type_to(get_entity_type(get_Sel_entity(n)));
- break;
-
- /* asymmetric binops */
- case iro_Shl:
- case iro_Shr:
- case iro_Shrs:
- case iro_Rotl:
- tp = tp1;
- break;
- case iro_Cast:
- tp = get_Cast_type(n);
- break;
- case iro_Phi: {
- int i;
- int n_preds = get_Phi_n_preds(n);
-
- if (n_preds == 0)
- break;
-
- /* initialize this Phi */
- set_irn_typeinfo_type(n, phi_cycle_type);
-
- /* find a first real type */
- for (i = 0; i < n_preds; ++i) {
- tp1 = compute_irn_type(get_Phi_pred(n, i));
- assert(tp1 != initial_type);
- if ((tp1 != phi_cycle_type) && (tp1 != firm_none_type))
- break;
- }
-
- /* find a second real type */
- tp2 = tp1;
- for (; (i < n_preds); ++i) {
- tp2 = compute_irn_type(get_Phi_pred(n, i));
- if ((tp2 == phi_cycle_type) || (tp2 == firm_none_type)) {
- tp2 = tp1;
- continue;
- }
- if (tp2 != tp1) break;
- }
-
- /* printf("Types in Phi %s and %s \n", get_type_name(tp1), get_type_name(tp2)); */
-
- if (tp1 == tp2) { tp = tp1; break; }
-
- DB((dbg, SET_LEVEL_2, "Phi %ld with two different types: %+F, %+F: unknown type.\n", get_irn_node_nr(n), tp1, tp2));
- tp = firm_unknown_type; /* Test for supertypes? */
- break;
- }
-
- case iro_Load: {
- ir_node *a = get_Load_ptr(n);
- if (is_Sel(a))
- tp = get_entity_type(get_Sel_entity(a));
- else if (is_Pointer_type(compute_irn_type(a))) {
- tp = get_pointer_points_to_type(get_irn_typeinfo_type(a));
- if (is_Array_type(tp))
- tp = get_array_element_type(tp);
- } else {
- DB((dbg, SET_LEVEL_1, "Load %ld with typeless address. result: unknown type\n", get_irn_node_nr(n)));
- }
- break;
- }
- case iro_Alloc:
- tp = find_pointer_type_to(get_Alloc_type(n));
- break;
- case iro_Proj:
- tp = find_type_for_Proj(n);
- break;
- case iro_Id:
- tp = compute_irn_type(get_Id_pred(n));
- break;
- case iro_Unknown:
- tp = firm_unknown_type;
- break;
-
- /* catch special cases with fallthrough to binop/unop cases in default. */
- case iro_Sub:
- if (mode_is_int(get_irn_mode(n)) &&
- mode_is_reference(get_irn_mode(a)) &&
- mode_is_reference(get_irn_mode(b)) ) {
- DB((dbg, SET_LEVEL_1, "Sub %ld ptr - ptr = int: unknown type\n", get_irn_node_nr(n)));
- tp = firm_unknown_type; break;
- }
- /* fall through to Add. */
- case iro_Add:
- if (mode_is_reference(get_irn_mode(n)) &&
- mode_is_reference(get_irn_mode(a)) &&
- mode_is_int(get_irn_mode(b)) ) {
- tp = tp1; break;
- }
- if (mode_is_reference(get_irn_mode(n)) &&
- mode_is_int(get_irn_mode(a)) &&
- mode_is_reference(get_irn_mode(b)) ) {
- tp = tp2; break;
- }
- goto default_code;
-
- case iro_Mul:
- if (get_irn_mode(n) != get_irn_mode(a)) {
- DB((dbg, SET_LEVEL_1, "Mul %ld int1 * int1 = int2: unknown type\n", get_irn_node_nr(n)));
- tp = firm_unknown_type; break;
- }
- goto default_code;
-
- case iro_Mux:
- a = get_Mux_true(n);
- b = get_Mux_false(n);
- tp1 = compute_irn_type(a);
- tp2 = compute_irn_type(b);
- if (tp1 == tp2)
- tp = tp1;
- break;
-
- case iro_Bound:
- tp = compute_irn_type(get_Bound_index(n));
- break;
- case iro_Confirm:
- tp = compute_irn_type(get_Confirm_value(n));
- break;
- case iro_Conv:
- /* Conv is a unop, but changing the mode implies
- changing the type. */
- break;
-
- default:
-default_code:
- if (is_unop(n)) {
- /* It's not proper to walk past a Conv, so this case is handled above. */
- tp = tp1;
- break;
- }
-
- if (is_binop(n)) {
- if (tp1 == tp2) {
- tp = tp1;
- break;
- }
- if ((tp1 == phi_cycle_type) || (tp2 == phi_cycle_type)) {
- tp = phi_cycle_type;
- break;
- }
- DB((dbg, SET_LEVEL_2, "Binop %ld with two different types: %+F, %+F: unknown type\n", get_irn_node_nr(n), tp1, tp2));
- tp = firm_unknown_type;
- break;
- }
-
- panic(" not implemented: %+F", n);
- } /* end switch */
-
- return tp;
-}
-
-/** Compute the type of an IR node. */
-static ir_type *compute_irn_type(ir_node *n)
-{
- ir_type *tp = get_irn_typeinfo_type(n);
-
- if (tp == initial_type) {
- tp = find_type_for_node(n);
- set_irn_typeinfo_type(n, tp);
- }
- return tp;
-}
-
-/**
- * Post-Walker: computes the type for every node
- * and store it into a map.
- * Post-walking ensures that the types for all predecessor
- * nodes are already computed.
- */
-static void compute_type(ir_node *n, void *env)
-{
- ir_type *tp = get_irn_typeinfo_type(n);
- (void) env;
- if (tp == phi_cycle_type) {
- set_irn_typeinfo_type(n, initial_type);
- }
- compute_irn_type(n);
-}
-
-/**
- * Compute the types for all nodes of a graph.
- */
-static void analyse_irg (ir_graph *irg)
-{
- set_irg_typeinfo_state(irg, ir_typeinfo_consistent);
- irg_walk_graph(irg, NULL, compute_type, NULL);
-}
-
-/**
- * Initialize the analysis by creating a phi_cycle_type and
- * computing pointer types for all class and struct types.
- */
-static void init_irsimpletype(void)
-{
- init_irtypeinfo();
- if (!phi_cycle_type)
- phi_cycle_type = new_type_class(new_id_from_str("phi_cycle_type"));
- precompute_pointer_types();
-}
-
-/* Computes type information for each node in all ir graphs. */
-void simple_analyse_types(void)
-{
- int i;
- FIRM_DBG_REGISTER(dbg, "firm.ana.simpletype");
-
- init_irsimpletype();
- for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
- ir_graph *irg = get_irp_irg(i);
- analyse_irg(irg);
- }
- set_irp_typeinfo_state(ir_typeinfo_consistent);
-}
-
-void free_simple_type_information(void)
-{
- free_irtypeinfo();
-
- if (phi_cycle_type) {
- free_type(phi_cycle_type);
- phi_cycle_type = NULL;
- }
- set_irp_typeinfo_state(ir_typeinfo_none);
-}
dbgi = get_irn_dbg_info(pred);
trampoline = get_trampoline(be, entity);
trampoline_const = new_rd_SymConst_addr_ent(dbgi, irg, mode_P_code,
- trampoline, NULL);
+ trampoline);
set_irn_n(node, i, trampoline_const);
continue;
}
dbgi = get_irn_dbg_info(pred);
pic_symbol = get_pic_symbol(be, entity);
pic_symconst = new_rd_SymConst_addr_ent(dbgi, irg, mode_P_code,
- pic_symbol, NULL);
+ pic_symbol);
add = new_r_Add(block, pic_base, pic_symconst, mode);
mark_irn_visited(add);
NULL,
NULL,
NULL,
- NULL,
dump_node,
NULL,
&be_node_irn_ops
return res;
}
-ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg, tarval *con,
- ir_type *tp)
+ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con)
{
ir_node *block = get_irg_start_block(irg);
ir_mode *mode = get_tarval_mode(con);
ir_node *res = new_ir_node(db, irg, block, op_Const, mode, 0, NULL);
res->attr.con.tarval = con;
- set_Const_type(res, tp); /* Call method because of complex assertion. */
+
res = optimize_node (res);
- assert(get_Const_type(res) == tp);
irn_verify_irg(res, irg);
return res;
}
-ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con)
-{
- return new_rd_Const_type(db, irg, con, firm_unknown_type);
-}
-
ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg, ir_mode *mode,
long value)
{
return res;
}
-ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_mode *mode,
- symconst_symbol value, symconst_kind symkind,
- ir_type *tp)
-{
- ir_node *block = get_irg_start_block(irg);
- ir_node *res = new_ir_node(db, irg, block, op_SymConst, mode, 0, NULL);
-
- res->attr.symc.kind = symkind;
- res->attr.symc.sym = value;
- res->attr.symc.tp = tp;
-
- res = optimize_node(res);
- irn_verify_irg(res, irg);
- return res;
-}
-
ir_node *new_rd_Sync(dbg_info *db, ir_node *block, int arity, ir_node *in[])
{
ir_graph *irg = get_irn_irg(block);
ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode,
symconst_symbol value, symconst_kind symkind)
{
- return new_rd_SymConst_type(db, irg, mode, value, symkind, firm_unknown_type);
+ ir_node *block = get_irg_start_block(irg);
+ ir_node *res = new_ir_node(db, irg, block, op_SymConst, mode, 0, NULL);
+ res->attr.symc.kind = symkind;
+ res->attr.symc.sym = value;
+
+ res = optimize_node(res);
+ irn_verify_irg(res, irg);
+ return res;
}
-ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol, ir_type *tp)
+ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol)
{
symconst_symbol sym;
sym.entity_p = symbol;
- return new_rd_SymConst_type(db, irg, mode, sym, symconst_addr_ent, tp);
+ return new_rd_SymConst(db, irg, mode, sym, symconst_addr_ent);
}
-ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol, ir_type *tp)
+ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol)
{
symconst_symbol sym;
sym.entity_p = symbol;
- return new_rd_SymConst_type(db, irg, mode, sym, symconst_ofs_ent, tp);
+ return new_rd_SymConst(db, irg, mode, sym, symconst_ofs_ent);
}
-ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol, ir_type *tp)
+ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol)
{
symconst_symbol sym;
sym.type_p = symbol;
- return new_rd_SymConst_type(db, irg, mode, sym, symconst_type_tag, tp);
+ return new_rd_SymConst(db, irg, mode, sym, symconst_type_tag);
}
-ir_node *new_rd_SymConst_size(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol, ir_type *tp)
+ir_node *new_rd_SymConst_size(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol)
{
symconst_symbol sym;
sym.type_p = symbol;
- return new_rd_SymConst_type(db, irg, mode, sym, symconst_type_size, tp);
+ return new_rd_SymConst(db, irg, mode, sym, symconst_type_size);
}
-ir_node *new_rd_SymConst_align(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol, ir_type *tp)
+ir_node *new_rd_SymConst_align(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_type *symbol)
{
symconst_symbol sym;
sym.type_p = symbol;
- return new_rd_SymConst_type(db, irg, mode, sym, symconst_type_align, tp);
+ return new_rd_SymConst(db, irg, mode, sym, symconst_type_align);
}
ir_node *new_r_Start(ir_graph *irg)
{
return new_rd_Const_long(NULL, irg, mode, value);
}
-ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp)
-{
- return new_rd_Const_type(NULL, irg, con, tp);
-}
ir_node *new_r_SymConst(ir_graph *irg, ir_mode *mode, symconst_symbol value,
symconst_kind symkind)
{
return new_rd_Const_long(db, current_ir_graph, mode, value);
}
-ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp)
-{
- assert(get_irg_phase_state(current_ir_graph) == phase_building);
- return new_rd_Const_type(db, current_ir_graph, con, tp);
-}
-
ir_node *new_d_defaultProj(dbg_info *db, ir_node *arg, long max_proj)
{
ir_node *res;
store, objptr, 0, NULL, ent);
}
-ir_node *new_d_SymConst_type(dbg_info *db, ir_mode *mode, symconst_symbol value,
- symconst_kind kind, ir_type *tp)
-{
- assert(get_irg_phase_state(current_ir_graph) == phase_building);
- return new_rd_SymConst_type(db, current_ir_graph, mode, value, kind, tp);
-}
-
ir_node *new_d_SymConst(dbg_info *db, ir_mode *mode, symconst_symbol value,
symconst_kind kind)
{
assert(get_irg_phase_state(current_ir_graph) == phase_building);
- return new_rd_SymConst_type(db, current_ir_graph, mode, value, kind,
- firm_unknown_type);
+ return new_rd_SymConst(db, current_ir_graph, mode, value, kind);
}
ir_node *new_d_Sync(dbg_info *db, int arity, ir_node *in[])
return new_d_Const_long(NULL, mode, value);
}
-ir_node *new_Const_type(tarval *con, ir_type *tp)
-{
- return new_d_Const_type(NULL, con, tp);
-}
-
-ir_node *new_SymConst_type(ir_mode *mode, symconst_symbol value, symconst_kind kind, ir_type *type)
-{
- return new_d_SymConst_type(NULL, mode, value, kind, type);
-}
ir_node *new_SymConst(ir_mode *mode, symconst_symbol value, symconst_kind kind)
{
return new_d_SymConst(NULL, mode, value, kind);
get_method_res_type(tp, i));
}
} break;
- case iro_Const: {
- assert(get_Const_type(n) != firm_none_type);
- ir_fprintf(F, " Const of type %+F\n", get_Const_type(n));
- } break;
case iro_SymConst: {
switch (get_SymConst_kind(n)) {
case symconst_addr_ent:
fprintf(F, " name: %s\n", get_enumeration_const_name(get_SymConst_enum(n)));
break;
}
- ir_fprintf(F, " type of value: %+F\n", get_SymConst_value_type(n));
} break;
case iro_Load:
fprintf(F, " mode of loaded value: %s\n", get_mode_name_ex(get_Load_mode(n), NULL));
}
-/* The source language type. Must be an atomic type. Mode of type must
- be mode of node. For tarvals from entities type must be pointer to
- entity type. */
-ir_type *get_Const_type(const ir_node *node)
-{
- assert(is_Const(node));
- return node->attr.con.tp;
-}
-
-void set_Const_type(ir_node *node, ir_type *tp)
-{
- assert(is_Const(node));
- if (tp != firm_unknown_type) {
- assert(is_atomic_type(tp));
- assert(get_type_mode(tp) == get_irn_mode(node));
- }
- node->attr.con.tp = tp;
-}
-
symconst_kind get_SymConst_kind(const ir_node *node)
{
node->attr.symc.sym = sym;
}
-ir_type *get_SymConst_value_type(const ir_node *node)
-{
- assert(is_SymConst(node));
- return node->attr.symc.tp;
-}
-
-void set_SymConst_value_type(ir_node *node, ir_type *tp)
-{
- assert(is_SymConst(node));
- node->attr.symc.tp = tp;
-}
-
int get_Sel_n_indexs(const ir_node *node)
{
assert(is_Sel(node));
_copy_node_attr(irg, old_node, new_node);
}
-/* Return the type associated with the value produced by n
- * if the node remarks this type as it is the case for
- * Cast, Const, SymConst and some Proj nodes. */
-ir_type *(get_irn_type)(ir_node *node)
-{
- return _get_irn_type(node);
-}
-
/* Return the type attribute of a node n (SymConst, Call, Alloc, Free,
Cast) or NULL.*/
ir_type *(get_irn_type_attr)(ir_node *node)
#undef X
}
-/** the get_type operation must be always implemented and return a firm type */
-static ir_type *get_Default_type(const ir_node *n)
-{
- (void) n;
- return get_unknown_type();
-}
-
-/* Sets the get_type operation for an ir_op_ops. */
-ir_op_ops *firm_set_default_get_type(ir_opcode code, ir_op_ops *ops)
-{
- switch (code) {
- case iro_Const: ops->get_type = get_Const_type; break;
- case iro_SymConst: ops->get_type = get_SymConst_value_type; break;
- case iro_Cast: ops->get_type = get_Cast_type; break;
- case iro_Proj: ops->get_type = get_Proj_type; break;
- default:
- /* not allowed to be NULL */
- if (! ops->get_type)
- ops->get_type = get_Default_type;
- break;
- }
- return ops;
-}
-
/** Return the attribute type of a SymConst node if exists */
static ir_type *get_SymConst_attr_type(const ir_node *self)
{
*/
extern unsigned firm_add_node_size;
-/**
- * Sets the get_type operation for an ir_op_ops.
- *
- * @param code the opcode for the default operation
- * @param ops the operations initialized
- *
- * @return
- * The operations.
- */
-ir_op_ops *firm_set_default_get_type(ir_opcode code, ir_op_ops *ops);
-
/**
* Sets the get_type_attr operation for an ir_op_ops.
*
return is_op_forking(_get_irn_op(node));
}
-static inline ir_type *_get_irn_type(ir_node *node) {
- return _get_irn_op(node)->ops.get_type(node);
-}
-
static inline ir_type *_get_irn_type_attr(ir_node *node) {
return _get_irn_op(node)->ops.get_type_attr(node);
}
return n;
} /* equivalent_node_Conv */
-/**
- * A Cast may be removed if the type of the previous node
- * is already the type of the Cast.
- */
-static ir_node *equivalent_node_Cast(ir_node *n)
-{
- ir_node *oldn = n;
- ir_node *pred = get_Cast_op(n);
-
- if (get_irn_type(pred) == get_Cast_type(n)) {
- n = pred;
- DBG_OPT_ALGSIM0(oldn, n, FS_OPT_CAST);
- }
- return n;
-} /* equivalent_node_Cast */
-
/**
* - fold Phi-nodes, iff they have only one predecessor except
* themselves.
CASE(Or);
CASE(And);
CASE(Conv);
- CASE(Cast);
CASE(Phi);
CASE(Sync);
CASE_PROJ(Tuple);
irg = get_irn_irg(phi);
for (i = 0; i < n; ++i) {
pred = get_irn_n(phi, i);
- res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
+ res[i] = new_r_Const(irg, res[i]);
}
return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_binop_on_phi */
irg = get_irn_irg(a);
for (i = 0; i < n; ++i) {
pred = get_irn_n(a, i);
- res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
+ res[i] = new_r_Const(irg, res[i]);
}
return new_r_Phi(get_nodes_block(a), n, (ir_node **)res, mode);
} /* apply_binop_on_2_phis */
irg = get_irn_irg(phi);
for (i = 0; i < n; ++i) {
pred = get_irn_n(phi, i);
- res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
+ res[i] = new_r_Const(irg, res[i]);
}
return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_unop_on_phi */
irg = get_irn_irg(phi);
for (i = 0; i < n; ++i) {
pred = get_irn_n(phi, i);
- res[i] = new_r_Const_type(irg, res[i], get_Const_type(pred));
+ res[i] = new_r_Const(irg, res[i]);
}
return new_r_Phi(get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_conv_on_phi */
return n;
} /* transform_node_Minus */
-/**
- * Transform a Cast_type(Const) into a new Const_type
- */
-static ir_node *transform_node_Cast(ir_node *n)
-{
- ir_node *oldn = n;
- ir_node *pred = get_Cast_op(n);
- ir_type *tp = get_irn_type(n);
-
- if (is_Const(pred) && get_Const_type(pred) != tp) {
- ir_graph *irg = get_irn_irg(n);
- n = new_rd_Const_type(NULL, irg, get_Const_tarval(pred), tp);
- DBG_OPT_CSTEVAL(oldn, n);
- } else if (is_SymConst(pred) && get_SymConst_value_type(pred) != tp) {
- ir_graph *irg = get_irn_irg(n);
- n = new_rd_SymConst_type(NULL, irg, get_irn_mode(pred),
- get_SymConst_symbol(pred), get_SymConst_kind(pred), tp);
- DBG_OPT_CSTEVAL(oldn, n);
- }
-
- return n;
-} /* transform_node_Cast */
-
/**
* Transform a Proj(Load) with a non-null address.
*/
CASE(Eor);
CASE(Not);
CASE(Minus);
- CASE(Cast);
CASE_PROJ(Load);
CASE_PROJ(Store);
CASE_PROJ(Bound);
/** Compares the attributes of two Const nodes. */
static int node_cmp_attr_Const(ir_node *a, ir_node *b)
{
- return (get_Const_tarval(a) != get_Const_tarval(b))
- || (get_Const_type(a) != get_Const_type(b));
-} /* node_cmp_attr_Const */
+ return get_Const_tarval(a) != get_Const_tarval(b);
+}
/** Compares the attributes of two Proj nodes. */
static int node_cmp_attr_Proj(ir_node *a, ir_node *b)
const symconst_attr *pa = &a->attr.symc;
const symconst_attr *pb = &b->attr.symc;
return (pa->kind != pb->kind)
- || (pa->sym.type_p != pb->sym.type_p)
- || (pa->tp != pb->tp);
-} /* node_cmp_attr_SymConst */
+ || (pa->sym.type_p != pb->sym.type_p);
+}
/** Compares the attributes of two Call nodes. */
static int node_cmp_attr_Call(ir_node *a, ir_node *b)
tv = computed_value(n);
if (tv != tarval_bad) {
ir_node *nw;
- ir_type *old_tp = get_irn_type(n);
- int i, arity = get_irn_arity(n);
int node_size;
- /*
- * Try to recover the type of the new expression.
- */
- for (i = 0; i < arity && !old_tp; ++i)
- old_tp = get_irn_type(get_irn_n(n, i));
-
/*
* we MUST copy the node here temporary, because it's still needed
* for DBG_OPT_CSTEVAL
irg_kill_node(irg, n);
nw = new_r_Const(irg, tv);
- if (old_tp && get_type_mode(old_tp) == get_tarval_mode(tv))
- set_Const_type(nw, old_tp);
DBG_OPT_CSTEVAL(oldn, nw);
return nw;
}
tv = computed_value(n);
if (tv != tarval_bad) {
/* evaluation was successful -- replace the node. */
- ir_type *old_tp = get_irn_type(n);
ir_graph *irg = get_irn_irg(n);
- int i, arity = get_irn_arity(n);
-
- /*
- * Try to recover the type of the new expression.
- */
- for (i = 0; i < arity && !old_tp; ++i)
- old_tp = get_irn_type(get_irn_n(n, i));
n = new_r_Const(irg, tv);
- if (old_tp && get_type_mode(old_tp) == get_tarval_mode(tv))
- set_Const_type(n, old_tp);
-
DBG_OPT_CSTEVAL(oldn, n);
return n;
}
ops = firm_set_default_equivalent_node(code, ops);
ops = firm_set_default_transform_node(code, ops);
ops = firm_set_default_node_cmp_attr(code, ops);
- ops = firm_set_default_get_type(code, ops);
ops = firm_set_default_get_type_attr(code, ops);
ops = firm_set_default_get_entity_attr(code, ops);
ir_entity *ptr = new_entity(constructors, ide, ptr_type);
ir_graph *irg = get_const_code_irg();
ir_node *val = new_rd_SymConst_addr_ent(NULL, irg, mode_P_code,
- method, NULL);
+ method);
set_entity_compiler_generated(ptr, 1);
set_entity_linkage(ptr, IR_LINKAGE_CONSTANT);
/** Const attributes. */
typedef struct {
tarval *tarval; /**< the target value */
- ir_type *tp; /**< the source type, for analyses. default: type_unknown. */
} const_attr;
/** SymConst attributes. */
typedef struct {
symconst_symbol sym; // old tori
symconst_kind kind;
- ir_type *tp; /**< the source type, for analyses. default: type_unknown. */
} symconst_attr;
/** Sel attributes. */
}
} else {
/* global_type */
- newn = new_rd_SymConst_addr_ent(NULL, irg, mode, ent, firm_unknown_type);
+ newn = new_rd_SymConst_addr_ent(NULL, irg, mode, ent);
}
}
/* run the hooks */
}
if (len >= 0) {
tarval *tv = new_tarval_from_long(len, get_type_mode(res_tp));
- return new_r_Const_type(irg, tv, res_tp);
+ return new_r_Const(irg, tv);
}
return NULL;
}
ir_initializer_t *val = get_initializer_compound_value(initializer, i);
if (initializer_val_is_null(val)) {
tarval *tv = new_tarval_from_long(i, get_type_mode(res_tp));
- return new_r_Const_type(irg, tv, res_tp);
+ return new_r_Const(irg, tv);
}
}
if (i < n) {
/* we found an end */
tarval *tv = new_tarval_from_long(res, get_type_mode(res_tp));
- return new_r_Const_type(irg, tv, res_tp);
+ return new_r_Const(irg, tv);
}
return NULL;
}
arg = get_irg_arg(get_entity_irg(q->ent), q->pos);
/* we will replace the argument in position "q->pos" by this constant. */
- const_arg = new_r_Const_type(
- clone_irg, q->tv,
- get_method_param_type(get_entity_type(q->ent), q->pos));
+ const_arg = new_r_Const(clone_irg, q->tv);
/* args copy in the cloned graph will be the const. */
set_irn_link(arg, const_arg);
#include "irprog.h"
#include "irtypeinfo.h"
#include "irgwalk.h"
-#include "irsimpletype.h"
#include "trouts.h"
#include "ircons.h"
#include "irgmod.h"
int i;
if (gppt_fct) gen_pointer_type_to = gppt_fct;
+#if 0
if (get_irp_typeinfo_state() != ir_typeinfo_consistent)
simple_analyse_types();
+#endif
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
pure_normalize_irg_class_casts(get_irp_irg(i));
irg = get_irn_irg(cmp);
set_irn_n(cmp, cast_pos, get_Cast_op(cast));
fromtype = get_irn_typeinfo_type(get_Cast_op(cast));
- new_null = new_r_Const_type(irg, get_Const_tarval(null), fromtype);
+ new_null = new_r_Const(irg, get_Const_tarval(null));
set_irn_typeinfo_type(new_null, fromtype);
set_irn_n(cmp, null_pos, new_null);
++n_casts_removed;
{
int changed;
+#if 0
if (get_irp_typeinfo_state() != ir_typeinfo_consistent)
simple_analyse_types();
+#endif
changed = 0;
all_irg_walk(NULL, irn_optimize_class_cast, &changed);
int i;
ir_type *arrtp = get_entity_type(ent);
ir_node *val;
- ir_type *elttp = get_array_element_type(arrtp);
ir_graph *irg = get_const_code_irg();
assert(is_Array_type(arrtp));
assert(get_array_lower_bound (arrtp, 0) || get_array_upper_bound (arrtp, 0));
for (i = 0; i < num_vals; i++) {
- val = new_r_Const_type(irg, values[i], elttp);
+ val = new_r_Const(irg, values[i]);
add_compound_ent_value(ent, val, get_array_element_entity(arrtp));
set_compound_graph_path_array_index(get_compound_ent_value_path(ent, i), 0, i);
}
m = get_irn_mode(n);
switch (get_irn_opcode(n)) {
case iro_Const:
- nn = new_rd_Const_type(dbg, irg, get_Const_tarval(n), get_Const_type(n));
+ nn = new_rd_Const(dbg, irg, get_Const_tarval(n));
break;
case iro_SymConst:
- nn = new_rd_SymConst_type(dbg, irg, get_irn_mode(n), get_SymConst_symbol(n), get_SymConst_kind(n),
- get_SymConst_value_type(n));
+ nn = new_rd_SymConst(dbg, irg, get_irn_mode(n), get_SymConst_symbol(n), get_SymConst_kind(n));
break;
case iro_Add:
nn = new_rd_Add(dbg, block,