[AutoDiff] Simplify conditions enabling differentiable programming. (#30765)

Previously, two conditions were necessary to enable differentiable programming:
- Using the `-enable-experimental-differentiable-programming` frontend flag.
- Importing the `_Differentiation` module.

Importing the `_Differentiation` module is the true condition because it
contains the required compiler-known `Differentiable` protocol. The frontend
flag is redundant and cumbersome.

Now, the frontend flag is removed.
Importing `_Differentiation` is the only condition.
This commit is contained in:
Dan Zheng
2020-04-02 03:24:03 -07:00
committed by GitHub
parent e94f01d7e6
commit 1308fc69c5
43 changed files with 133 additions and 106 deletions

View File

@@ -449,13 +449,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (Args.hasArg(OPT_enable_experimental_additive_arithmetic_derivation))
Opts.EnableExperimentalAdditiveArithmeticDerivedConformances = true;
if (Args.hasArg(OPT_enable_experimental_differentiable_programming)) {
Opts.EnableExperimentalDifferentiableProgramming = true;
// Differentiable programming implies `AdditiveArithmetic` derived
// conformances.
Opts.EnableExperimentalAdditiveArithmeticDerivedConformances = true;
}
Opts.DebuggerSupport |= Args.hasArg(OPT_debugger_support);
if (Opts.DebuggerSupport)
Opts.EnableDollarIdentifiers = true;