if (get_atomic_type_size(s_rank) > get_atomic_type_size(u_rank))
return s_type;
+ /* FIXME ugly */
type_t *const type = allocate_type_zero(TYPE_ATOMIC, &builtin_source_position);
- type->atomic.akind = find_unsigned_int_atomic_type_kind_for_size(s_rank);
+ switch (s_rank) {
+ case ATOMIC_TYPE_INT: type->atomic.akind = ATOMIC_TYPE_UINT; break;
+ case ATOMIC_TYPE_LONG: type->atomic.akind = ATOMIC_TYPE_ULONG; break;
+ case ATOMIC_TYPE_LONGLONG: type->atomic.akind = ATOMIC_TYPE_ULONGLONG; break;
+
+ default: panic("invalid atomic type");
+ }
type_t* const result = typehash_insert(type);
if (result != type)