Simplify Hack array migration logic with arrLikeVal
Summary:
If t is a jit::Type* and t->hasConstVal(TArrLike), we can use t->arrLikeVal() to handle array-likes uniformly. Doing so makes the code simpler and should help with projects that plan on adding or changing array types, such as the Hack array migration (HAM).
There are a few places which are truly constrained to dicts, vecs, or keysets, where I left the current usage alone. I also did a quick audit of the code calling arrLikeVal to check whether it was indeed layout-agnostic, which was true except in a handful of places that got the value and then asserted e.g. hasMixedLayout. Packed and mixed layout assertions should work equally well before and after HAM.
Reviewed By: jjgriego
Differential Revision:
D19248981
fbshipit-source-id:
9ab7f43ea15e6fb102a12e74425e40dfde39cda9