RequirementMachine: Add flags for completion depth and step limits

This commit is contained in:
Slava Pestov
2021-06-01 23:17:47 -04:00
parent 44eb0cfe0f
commit 20d5d773f6
4 changed files with 41 additions and 2 deletions

View File

@@ -798,6 +798,28 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.DebugRequirementMachine = Args.hasArg(
OPT_debug_requirement_machine);
if (const Arg *A = Args.getLastArg(OPT_requirement_machine_step_limit)) {
unsigned limit;
if (StringRef(A->getValue()).getAsInteger(10, limit)) {
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
A->getAsString(Args), A->getValue());
HadError = true;
} else {
Opts.RequirementMachineStepLimit = limit;
}
}
if (const Arg *A = Args.getLastArg(OPT_requirement_machine_depth_limit)) {
unsigned limit;
if (StringRef(A->getValue()).getAsInteger(10, limit)) {
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
A->getAsString(Args), A->getValue());
HadError = true;
} else {
Opts.RequirementMachineDepthLimit = limit;
}
}
return HadError || UnsupportedOS || UnsupportedArch;
}