}
INLINE ir_node *
-new_rd_SymConst (dbg_info* db, ir_graph *irg, ir_node *block, symconst_symbol value,
- symconst_kind symkind)
+new_rd_SymConst_type (dbg_info* db, ir_graph *irg, ir_node *block, symconst_symbol value,
+ symconst_kind symkind, type *tp)
{
ir_node *res;
ir_mode *mode;
res->attr.i.num = symkind;
res->attr.i.sym = value;
- /*
- if (symkind == symconst_addr_name) {
- res->attr.i.sym.ident_p = (ident *)value;
- } else if (symkind == symconst_addr_ent) {
- res->attr.i.sym.entity = (entity *)value;
- } else {
- assert ( ( (symkind ==symconst_type_tag)
- || (symkind == symconst_size))
- && (is_type(value)));
- res->attr.i.sym.typ = (type *)value;
- }
- */
+ res->attr.i.tp = tp;
+
res = optimize_node (res);
irn_vrfy_irg (res, irg);
return res;
}
+INLINE ir_node *
+new_rd_SymConst (dbg_info* db, ir_graph *irg, ir_node *block, symconst_symbol value,
+ symconst_kind symkind)
+{
+ ir_node *res = new_rd_SymConst_type (db, irg, block, value, symkind, unknown_type);
+ return res;
+}
+
INLINE ir_node *
new_rd_Sync (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **in)
{
store, objptr, ent));
}
+ir_node *
+new_d_SymConst_type (dbg_info* db, symconst_symbol value, symconst_kind kind, type *tp)
+{
+ return new_rd_SymConst_type (db, current_ir_graph, current_ir_graph->start_block,
+ value, kind, tp);
+}
+
ir_node *
new_d_SymConst (dbg_info* db, symconst_symbol value, symconst_kind kind)
{
ir_node *new_rd_Const (dbg_info *db, ir_graph *irg, ir_node *block,
ir_mode *mode, tarval *con);
-/** Constructor for a SymConst node.
+/** Constructor for a SymConst_type node.
*
* This is the constructor for a symbolic constant.
* There are four kinds of symbolic constants:
* @param *block The ir block the node belongs to.
* @param symkind The kind of the symbolic constant: type_tag, size, addr_name or addr_ent.
* @param value A type, entity or a ident depending on the SymConst kind.
+ * @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,
+ 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);
*/
ir_node *new_d_Const (dbg_info* db, ir_mode *mode, tarval *con);
-/** Constructor for a SymConst node.
+/** Constructor for a SymConst_type node.
*
* Adds the node to the block in current_ir_block.
* This is the constructor for a symbolic constant.
*
* @param *db A pointer for debug information.
* @param value A type, entity or ident depending on the SymConst kind.
- * @param symkind The kind of the symbolic constant: symconst_type_tag, symconst_size or symconst_addr_name.
+ * @param symkind The kind of the symbolic constant: symconst_type_tag, symconst_size
+ * or symconst_addr_name.
+ * @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);
+
+/** 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);
/** Constructor for a simpleSel node.