mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
RequirementMachine: Add concrete nesting depth check
Configured with -requirement-machine-max-concrete-nesting= frontend flag.
This commit is contained in:
@@ -950,6 +950,17 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
}
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_requirement_machine_max_concrete_nesting)) {
|
||||
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.RequirementMachineMaxConcreteNesting = limit;
|
||||
}
|
||||
}
|
||||
|
||||
return HadError || UnsupportedOS || UnsupportedArch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user