+int (get_type_size_bytes)(const ir_type *tp) {
+ return _get_type_size_bytes(tp);
+}
+
+int (get_type_size_bits)(const ir_type *tp) {
+ return _get_type_size_bits(tp);
+}
+
+
+ir_visibility get_type_visibility (const ir_type *tp) {
+#if 0
+ visibility res = visibility_local;
+ if (is_compound_type(tp)) {
+
+ if (is_Array_type(tp)) {
+ ir_entity *mem = get_array_element_entity(tp);
+ if (get_entity_visibility(mem) != visibility_local)
+ res = visibility_external_visible;
+ } else {
+ int i, n_mems = get_compound_n_members(tp);
+ for (i = 0; i < n_mems; ++i) {
+ ir_entity *mem = get_compound_member(tp, i);
+ if (get_entity_visibility(mem) != visibility_local)
+ res = visibility_external_visible;
+ }
+ }
+ }
+ return res;
+#endif
+ assert(is_type(tp));
+ return tp->visibility;
+}
+
+void set_type_visibility (ir_type *tp, ir_visibility v) {
+ assert(is_type(tp));
+#if 0
+ /* check for correctness */
+ if (v != visibility_external_allocated) {
+ visibility res = visibility_local;
+ if (is_compound_type(tp)) {
+ if (is_Array_type(tp)) {
+ ir_entity *mem = get_array_element_entity(tp);
+ if (get_entity_visibility(mem) > res)
+ res = get_entity_visibility(mem);
+ } else {
+ int i, n_mems = get_compound_n_members(tp);
+ for (i = 0; i < n_mems; ++i) {
+ ir_entity *mem = get_compound_member(tp, i);
+ if (get_entity_visibility(mem) > res)
+ res = get_entity_visibility(mem);
+ }
+ }
+ }
+ assert(res < v);
+ }
+#endif
+ tp->visibility = v;
+}
+
+void
+set_type_size_bits(ir_type *tp, int size) {
+ const tp_op *tpop = get_type_tpop(tp);
+
+ if (tpop->ops.set_type_size)
+ tpop->ops.set_type_size(tp, size);
+ else
+ assert(0 && "Cannot set size for this type");