void assertTypeLocation(IRGS& env, const Location& loc, Type type) { assertx(type <= TStkElem); switch (loc.tag()) { case LTag::Stack: assertTypeStack(env, offsetFromBCSP(env, loc.stackIdx()), type); break; case LTag::Local: assertTypeLocal(env, loc.localId(), type); break; } }
void assertTypeLocation(IRGS& env, const RegionDesc::Location& loc, Type type) { assertx(type <= TStkElem); using T = RegionDesc::Location::Tag; switch (loc.tag()) { case T::Stack: assertTypeStack(env, offsetFromBCSP(env, loc.offsetFromFP()), type); break; case T::Local: assertTypeLocal(env, loc.localId(), type); break; } }
void emitAssertRATStk(IRGS& env, int32_t offset, RepoAuthType rat) { if (auto const t = ratToAssertType(env, rat)) { assertTypeStack(env, BCSPRelOffset{offset}, *t); } }