Type relaxType(Type t, DataTypeCategory cat) { always_assert_flog(t <= TGen && t != TBottom, "t = {}", t); if (cat == DataTypeGeneric) return TGen; auto const relaxed = (t & TCell) <= TBottom ? TBottom : relaxCell(t & TCell, cat); return t <= TCell ? relaxed : relaxed | TBoxedInitCell; }
/* * Returns the least specific supertype of t that maintains the properties * required by tc. */ Type relaxType(Type t, TypeConstraint tc) { always_assert(t <= TGen && t != TBottom); if (tc.category == DataTypeGeneric) return TGen; auto const relaxed = (t & TCell) <= TBottom ? TBottom : relaxCell(t & TCell, tc); return t <= TCell ? relaxed : relaxed | TBoxedInitCell; }