+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);
+}
+
+
+visibility get_type_visibility (const ir_type *tp) {
+#if 0
+ visibility res = visibility_local;
+ if (is_compound_type(tp)) {
+
+ if (is_Array_type(tp)) {
+ 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) {
+ 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, 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)) {
+ 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) {
+ 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;