Naming_provider takes backend not ctx
Summary:
This diff is non-trivial. (It's just a trivial change of signatures, a minor refactoring, but it's non-trivial because of its implications).
Currently sIDE operates on a ctx. But this ctx has a complex role - (1) as a cache of ASTs and TASTs for all open files, (2) as context for TAST computation, (3) as a holder of forward-naming-table, (4) as a holder of local-memory backend including reverse-naming-table, (5) as a holder of tcopt and popt.
I need to disentangle roles (1) and (2). The way I'll do that in the type system is by making sIDE no longer store `ctx` in its state, since it would be ambiguous whether it was storing this ctx for (1) or for (2). Therefore, roles (3,4,5) have to be separated as well.
This has knock-on effects. The naming table updates will work with (3,4,5) but not with (1/2). Therefore, I'm changing the signature of relevant naming-table functions so they take `backend` explicitly (which they need to get at its reverse-namign-table) rather than `ctx`.
On the one hand it's a shame that the lovely ctx abstraction can't just exist universally. On the other hand, it's perhaps a nice bit of rigor that the Naming_provider and Namign_table functions now explicitly indicate which aspects of ctx they depend upon.
Reviewed By: arxanas
Differential Revision:
D20834153
fbshipit-source-id:
b43d132d3c0e085110590a1bc9eae98b20b93243