Remove typechecker-only options from GlobalOptions to avoid code duplication
commit34182c39b0f0085c99473ea5b3ad4406ef71aa00
authorLeo Osvald <leoo@fb.com>
Thu, 11 Aug 2022 00:10:58 +0000 (10 17:10 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 11 Aug 2022 00:10:58 +0000 (10 17:10 -0700)
tree8414fa1238383fa5048898793616ec4a357c00d3
parent988adb8e6945bca333d110e8a3a21a8e1d8a2bc8
Remove typechecker-only options from GlobalOptions to avoid code duplication

Summary:
Typechecker-only flags in `GlobalOptions` are prefixed with `tco_`.
However, they are used (inconsistently) through `GlobalOptions`,
which requires 2x definitions (`.ml` and `.mli` files)
and also defeats the purpose of why `typecheckerOptions` module exist.

This is the first step toward better encapsulation of `*Options`.
Later, we'd want to hide the representation of a set of related options in all but a single module
so that there is only a *single way* of reading/setting each option.
Currently, one can access *any* option through *any* of the following:
- `globalOptions`
- `parserOptions`
- `typecheckerOptions`
- `gleanOptions`
- `declParserOptions`
- `symbolWriteOptions`

Reviewed By: vassilmladenov

Differential Revision: D38281484

fbshipit-source-id: 09831124813528415a92f64c3ad62c02b9789df0
21 files changed:
hphp/hack/src/compare_folded_decls_file.ml
hphp/hack/src/decl/decl_fun_utils.ml
hphp/hack/src/decl/shallow_class_fanout.ml
hphp/hack/src/hh_single_ai.ml
hphp/hack/src/hh_single_decl.ml
hphp/hack/src/hh_single_type_check.ml
hphp/hack/src/options/globalOptions.ml
hphp/hack/src/options/globalOptions.mli
hphp/hack/src/options/parserOptions.ml
hphp/hack/src/options/typecheckerOptions.ml
hphp/hack/src/oxidized/gen/global_options.rs
hphp/hack/src/oxidized_by_ref/gen/global_options.rs
hphp/hack/src/server/serverConfig.ml
hphp/hack/src/server/serverInit.ml
hphp/hack/src/server/serverRefactor.ml
hphp/hack/src/typing/typing_check_service.ml
hphp/hack/src/typing/typing_debug.ml
hphp/hack/src/typing/typing_global_inference.ml
hphp/hack/src/typing/typing_helpers.ml
hphp/hack/src/typing/typing_log.ml
hphp/hack/src/typing/typing_phase.ml