void checkType(IRGS& env, const Location& loc, Type type, Offset dest, bool outerOnly) { assertx(type <= TGen); switch (loc.tag()) { case LTag::Stack: checkTypeStack(env, offsetFromBCSP(env, loc.stackIdx()), type, dest, outerOnly); break; case LTag::Local: checkTypeLocal(env, loc.localId(), type, dest, outerOnly); break; } }
void checkTypeLocation(IRGS& env, const RegionDesc::Location& loc, Type type, Offset dest, bool outerOnly) { assertx(type <= TGen); using T = RegionDesc::Location::Tag; switch (loc.tag()) { case T::Stack: checkTypeStack(env, offsetFromBCSP(env, loc.offsetFromFP()), type, dest, outerOnly); break; case T::Local: checkTypeLocal(env, loc.localId(), type, dest, outerOnly); break; } }