void set_atomic_ent_value(ir_entity *entity, ir_node *val) { assert(is_atomic_entity(entity)); assert(is_Dummy(val) || get_irn_mode(val) == get_type_mode(entity->type)); ir_initializer_t *initializer = create_initializer_const(val); entity->initializer = initializer; }
static void set_compound_init_node(ir_initializer_t *init, size_t idx, ir_node *value) { if (value == NULL) { set_compound_init_null(init, idx); return; } ir_initializer_t *value_init = create_initializer_const(value); set_initializer_compound_value(init, idx, value_init); }
static void add_pointer_in_jcr_segment(ir_entity *entity) { if (!create_jcr_segment) return; ir_type *segment = get_segment_type(IR_SEGMENT_JCR); ident *id = id_unique("jcr_ptr"); ir_entity *ptr = new_entity(segment, id, type_reference); ir_graph *irg = get_const_code_irg(); ir_node *val = new_r_Address(irg, entity); set_entity_ld_ident(ptr, new_id_from_chars("", 0)); set_entity_visibility(ptr, ir_visibility_private); set_entity_linkage(ptr, IR_LINKAGE_CONSTANT|IR_LINKAGE_HIDDEN_USER); set_entity_alignment(ptr, 1); ir_initializer_t *const init = create_initializer_const(val); set_entity_initializer(ptr, init); }