Absorb the TypeCheckerFlags into the Frontend

De-duplicate TypeCheckingFlags, TypeChecker's Options, and the TypeChecker-Oriented FrontendOptions into a dedicated TypeCheckerOptions type.  This moves a bunch of configuration state out of the type checker and into the ASTContext where it belongs.
This commit is contained in:
Robert Widmann
2019-11-08 16:31:25 -08:00
parent 631305f649
commit 097726717e
5 changed files with 51 additions and 196 deletions

View File

@@ -912,27 +912,6 @@ void CompilerInstance::parseLibraryFile(
performNameBinding(*NextInput);
}
OptionSet<TypeCheckingFlags> CompilerInstance::computeTypeCheckingOptions() {
OptionSet<TypeCheckingFlags> TypeCheckOptions;
if (isWholeModuleCompilation()) {
TypeCheckOptions |= TypeCheckingFlags::DelayWholeModuleChecking;
}
const auto &options = Invocation.getFrontendOptions();
if (options.DebugTimeFunctionBodies) {
TypeCheckOptions |= TypeCheckingFlags::DebugTimeFunctionBodies;
}
if (FrontendOptions::isActionImmediate(options.RequestedAction)) {
TypeCheckOptions |= TypeCheckingFlags::ForImmediateMode;
}
if (options.DebugTimeExpressionTypeChecking) {
TypeCheckOptions |= TypeCheckingFlags::DebugTimeExpressions;
}
if (options.SkipNonInlinableFunctionBodies) {
TypeCheckOptions |= TypeCheckingFlags::SkipNonInlinableFunctionBodies;
}
return TypeCheckOptions;
}
bool CompilerInstance::parsePartialModulesAndLibraryFiles(
const ImplicitImports &implicitImports) {
FrontendStatsTracer tracer(Context->Stats,