+void
+set_array_entity_values(entity *ent, tarval **values, int num_vals) {
+ int i;
+ ir_graph *rem = current_ir_graph;
+ type *arrtp = get_entity_type(ent);
+ ir_node *val;
+
+ assert(is_array_type(arrtp));
+ assert(get_array_n_dimensions(arrtp) == 1);
+ /* One bound is sufficient, the nunmber of constant fields makes the
+ size. */
+ assert(get_array_lower_bound (arrtp, 0) || get_array_upper_bound (arrtp, 0));
+ assert(get_entity_variability(ent) != uninitialized);
+ current_ir_graph = get_const_code_irg();
+
+ for (i = 0; i < num_vals; i++) {
+ val = new_Const(get_tv_mode (values[i]), values[i]);
+ add_compound_ent_value(ent, val, get_array_element_entity(arrtp));
+ }
+ current_ir_graph = rem;
+}
+
+INLINE int