return res;
}
+ir_node *new_rd_SymConst_addr_ent (dbg_info *db, ir_graph *irg, entity *symbol, type *tp) {
+ symconst_symbol sym = {(type *)symbol};
+ return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_addr_ent, tp);
+}
+
+ir_node *new_rd_SymConst_addr_name (dbg_info *db, ir_graph *irg, ident *symbol, type *tp) {
+ symconst_symbol sym = {(type *)symbol};
+ return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_addr_name, tp);
+}
+
+ir_node *new_rd_SymConst_type_tag (dbg_info *db, ir_graph *irg, type *symbol, type *tp) {
+ symconst_symbol sym = {symbol};
+ return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_type_tag, tp);
+}
+
+ir_node *new_rd_SymConst_size (dbg_info *db, ir_graph *irg, type *symbol, type *tp) {
+ symconst_symbol sym = {symbol};
+ return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_size, tp);
+}
+
INLINE ir_node *
new_rd_Sync (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **in)
{
* 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 *db A pointer for debug information.
* @param *irg The ir graph the node belongs to.
* @param *block The ir block the node belongs to.
* @param tp The source type of the constant.
*/
ir_node *
-new_rd_SymConst_type (dbg_info* db, ir_graph *irg, ir_node *block, symconst_symbol value,
+new_rd_SymConst_type (dbg_info* db, ir_graph *irg, ir_node *block, union symconst_symbol value,
symconst_kind symkind, type *tp);
/** Constructor for a SymConst node.
*
* Same as new_rd_SymConst_type, except that it sets the type to type_unknown. */
ir_node *new_rd_SymConst (dbg_info *db, ir_graph *irg, ir_node *block,
- symconst_symbol value, symconst_kind symkind);
+ union symconst_symbol value, symconst_kind symkind);
+
+/** Constructor for a SymConst addr_ent node.
+ *
+ * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * symconst_addr_ent.
+ * Adds the symconst to the start block of irg. */
+ir_node *new_rd_SymConst_addr_ent (dbg_info *db, ir_graph *irg, entity *symbol, type *tp);
+
+/** Constructor for a SymConst addr_name node.
+ *
+ * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * symconst_addr_ent.
+ * Adds the symconst to the start block of irg. */
+ir_node *new_rd_SymConst_addr_name (dbg_info *db, ir_graph *irg, ident *symbol, type *tp);
+
+/** Constructor for a SymConst type_tag node.
+ *
+ * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * symconst_addr_ent.
+ * Adds the symconst to the start block of irg. */
+ir_node *new_rd_SymConst_type_tag (dbg_info *db, ir_graph *irg, type *symbol, type *tp);
+
+/** Constructor for a SymConst size node.
+ *
+ * Same as new_rd_SymConst_type, except that the constructor is tailored for
+ * symconst_addr_ent.
+ * Adds the symconst to the start block of irg. */
+ir_node *new_rd_SymConst_size (dbg_info *db, ir_graph *irg, type *symbol, type *tp);
/** Constructor for a Sel node.
*
* @param symkind The kind of the symbolic constant: type_tag, size or link_info.
*/
ir_node *new_r_SymConst (ir_graph *irg, ir_node *block,
- symconst_symbol value, symconst_kind symkind);
+ union symconst_symbol value, symconst_kind symkind);
/** Constructor for a Sel node.
*
* @param tp The source type of the constant.
*
*/
-ir_node *new_d_SymConst_type (dbg_info* db, symconst_symbol value, symconst_kind kind, type* tp);
+ir_node *new_d_SymConst_type (dbg_info* db, union symconst_symbol value, symconst_kind kind, type* tp);
/** Constructor for a SymConst node.
*
* Same as new_d_SymConst_type, except that it sets the type to type_unknown. */
-ir_node *new_d_SymConst (dbg_info* db, symconst_symbol value, symconst_kind kind);
+ir_node *new_d_SymConst (dbg_info* db, union symconst_symbol value, symconst_kind kind);
/** Constructor for a simpleSel node.
*
* @param symkind The kind of the symbolic constant: symconst_type_tag, symconst_size or symconst_addr_name.
*
*/
-ir_node *new_SymConst (symconst_symbol value, symconst_kind kind);
+ir_node *new_SymConst (union symconst_symbol value, symconst_kind kind);
/** Constructor for a simpelSel node.
*
void set_SymConst_type (ir_node *node, type *tp);
/** Only to access SymConst of kind addr_name. Else assertion: */
-/* old:
-ident *get_SymConst_ptrinfo (ir_node *node);
-void set_SymConst_ptrinfo (ir_node *node, ident *ptrinfo);
-*/
#define get_SymConst_ptrinfo get_SymConst_name
#define set_SymConst_ptrinfo set_SymConst_name
ident *get_SymConst_name (ir_node *node);
/** Sets both: type and ptrinfo. Needed to treat the node independent of
its semantics. Does a memcpy for the memory sym points to. */
-#define get_SymConst_type_or_id get_SymConst_symbol
-#define set_SymConst_type_or_id set_SymConst_symbol
-symconst_symbol get_SymConst_symbol (ir_node *node);
-void set_SymConst_symbol (ir_node *node, symconst_symbol sym);
+/* write 'union': firmjni then does not create a method... */
+union symconst_symbol get_SymConst_symbol (ir_node *node);
+void set_SymConst_symbol (ir_node *node,
+ union symconst_symbol sym);
ir_node *get_Sel_mem (ir_node *node);
void set_Sel_mem (ir_node *node, ir_node *mem);