fixed SymConst handling
[r8262]
ident *
get_SymConst_name (ir_node *node) {
ident *
get_SymConst_name (ir_node *node) {
- assert( (node->op == op_SymConst)
- && (get_SymConst_kind(node) == symconst_addr_name));
+ assert(node->op == op_SymConst && SYMCONST_HAS_ID(get_SymConst_kind(node)));
return node->attr.symc.sym.ident_p;
}
void
set_SymConst_name (ir_node *node, ident *name) {
return node->attr.symc.sym.ident_p;
}
void
set_SymConst_name (ir_node *node, ident *name) {
- assert( (node->op == op_SymConst)
- && (get_SymConst_kind(node) == symconst_addr_name));
+ assert(node->op == op_SymConst && SYMCONST_HAS_ID(get_SymConst_kind(node)));
node->attr.symc.sym.ident_p = name;
}
/* Only to access SymConst of kind symconst_addr_ent. Else assertion: */
entity *get_SymConst_entity (ir_node *node) {
node->attr.symc.sym.ident_p = name;
}
/* Only to access SymConst of kind symconst_addr_ent. Else assertion: */
entity *get_SymConst_entity (ir_node *node) {
- assert( (node->op == op_SymConst)
- && (get_SymConst_kind (node) == symconst_addr_ent));
+ assert(node->op == op_SymConst && SYMCONST_HAS_ENT(get_SymConst_kind(node)));
return node->attr.symc.sym.entity_p;
}
void set_SymConst_entity (ir_node *node, entity *ent) {
return node->attr.symc.sym.entity_p;
}
void set_SymConst_entity (ir_node *node, entity *ent) {
- assert( (node->op == op_SymConst)
- && (get_SymConst_kind(node) == symconst_addr_ent));
+ assert(node->op == op_SymConst && SYMCONST_HAS_ENT(get_SymConst_kind(node)));
node->attr.symc.sym.entity_p = ent;
}
ir_enum_const *get_SymConst_enum (ir_node *node) {
node->attr.symc.sym.entity_p = ent;
}
ir_enum_const *get_SymConst_enum (ir_node *node) {
- assert( (node->op == op_SymConst)
- && (get_SymConst_kind (node) == symconst_enum_const));
+ assert(node->op == op_SymConst && SYMCONST_HAS_ENUM(get_SymConst_kind(node)));
return node->attr.symc.sym.enum_p;
}
void set_SymConst_enum (ir_node *node, ir_enum_const *ec) {
return node->attr.symc.sym.enum_p;
}
void set_SymConst_enum (ir_node *node, ir_enum_const *ec) {
- assert( (node->op == op_SymConst)
- && (get_SymConst_kind(node) == symconst_enum_const));
+ assert(node->op == op_SymConst && SYMCONST_HAS_ENUM(get_SymConst_kind(node)));
node->attr.symc.sym.enum_p = ec;
}
node->attr.symc.sym.enum_p = ec;
}
symconst_addr_ent, /**< The SymConst is a symbolic pointer to be filled in
by the linker. The pointer is represented by an entity.
symconst_symbol is entity *. */
symconst_addr_ent, /**< The SymConst is a symbolic pointer to be filled in
by the linker. The pointer is represented by an entity.
symconst_symbol is entity *. */
+ symconst_ofs_ent, /**< The SymConst is the offset of its entity in the entities
+ owner type. */
symconst_enum_const /**< The SymConst is a enumeration constant of an
enumeration type. */
} symconst_kind;
symconst_enum_const /**< The SymConst is a enumeration constant of an
enumeration type. */
} symconst_kind;
#define SYMCONST_HAS_ID(kind) ((kind) == symconst_addr_name)
/** Returns non-zero if s symconst kind has an entity attribute */
#define SYMCONST_HAS_ID(kind) ((kind) == symconst_addr_name)
/** Returns non-zero if s symconst kind has an entity attribute */
-#define SYMCONST_HAS_ENT(kind) ((kind) == symconst_addr_ent)
+#define SYMCONST_HAS_ENT(kind) ((kind) == symconst_addr_ent || (kind) == symconst_ofs_ent)
/** Returns non-zero if s symconst kind has an enum_const attribute */
#define SYMCONST_HAS_ENUM(kind) ((kind) == symconst_enum_const)
/** Returns non-zero if s symconst kind has an enum_const attribute */
#define SYMCONST_HAS_ENUM(kind) ((kind) == symconst_enum_const)
* This union contains the symbolic information represented by the node.
*/
typedef union symconst_symbol {
* This union contains the symbolic information represented by the node.
*/
typedef union symconst_symbol {
- ir_type *type_p;
- ident *ident_p;
- entity *entity_p;
- ir_enum_const *enum_p;
+ ir_type *type_p; /**< the type of a symconst */
+ ident *ident_p; /**< the ident of a symconst */
+ entity *entity_p; /**< the entity of a symconst */
+ ir_enum_const *enum_p; /**< the enumeration constant of a symconst */
} symconst_symbol;
/** Get the kind of the SymConst. */
} symconst_symbol;
/** Get the kind of the SymConst. */