Added option: -enable-ossa-complete-lifetimes

Disabled by default during initial testing.
This commit is contained in:
Andrew Trick
2023-03-01 18:31:55 -08:00
parent ccd08ca4b4
commit 2743b83b8e
4 changed files with 14 additions and 0 deletions

View File

@@ -173,6 +173,9 @@ public:
/// If set to true, compile with the SIL Opaque Values enabled. /// If set to true, compile with the SIL Opaque Values enabled.
bool EnableSILOpaqueValues = false; bool EnableSILOpaqueValues = false;
/// Require linear OSSA lifetimes after SILGen
bool OSSACompleteLifetimes = false;
// The kind of function bodies to skip emitting. // The kind of function bodies to skip emitting.
FunctionBodySkipping SkipFunctionBodies = FunctionBodySkipping::None; FunctionBodySkipping SkipFunctionBodies = FunctionBodySkipping::None;

View File

@@ -1165,4 +1165,8 @@ def enable_emit_generic_class_ro_t_list :
def experimental_spi_only_imports : def experimental_spi_only_imports :
Flag<["-"], "experimental-spi-only-imports">, Flag<["-"], "experimental-spi-only-imports">,
HelpText<"Enable use of @_spiOnly imports">; HelpText<"Enable use of @_spiOnly imports">;
def enable_ossa_complete_lifetimes :
Flag<["-"], "enable-ossa-complete-lifetimes">,
HelpText<"Require linear OSSA lifetimes after SILGen">;
} // end let Flags = [FrontendOption, NoDriverOption, HelpHidden] } // end let Flags = [FrontendOption, NoDriverOption, HelpHidden]

View File

@@ -1985,6 +1985,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
parseExclusivityEnforcementOptions(A, Opts, Diags); parseExclusivityEnforcementOptions(A, Opts, Diags);
} }
Opts.OSSACompleteLifetimes |= Args.hasArg(OPT_enable_ossa_complete_lifetimes);
return false; return false;
} }

View File

@@ -109,6 +109,10 @@ static llvm::cl::opt<bool>
EnableSILOpaqueValues("enable-sil-opaque-values", EnableSILOpaqueValues("enable-sil-opaque-values",
llvm::cl::desc("Compile the module with sil-opaque-values enabled.")); llvm::cl::desc("Compile the module with sil-opaque-values enabled."));
static llvm::cl::opt<bool>
EnableOSSACompleteLifetimes("enable-ossa-complete-lifetimes",
llvm::cl::desc("Compile the module with sil-opaque-values enabled."));
static llvm::cl::opt<bool> static llvm::cl::opt<bool>
EnableObjCInterop("enable-objc-interop", EnableObjCInterop("enable-objc-interop",
llvm::cl::desc("Enable Objective-C interoperability.")); llvm::cl::desc("Enable Objective-C interoperability."));
@@ -659,6 +663,7 @@ int main(int argc, char **argv) {
SILOpts.IgnoreAlwaysInline = IgnoreAlwaysInline; SILOpts.IgnoreAlwaysInline = IgnoreAlwaysInline;
SILOpts.EnableOSSAModules = EnableOSSAModules; SILOpts.EnableOSSAModules = EnableOSSAModules;
SILOpts.EnableSILOpaqueValues = EnableSILOpaqueValues; SILOpts.EnableSILOpaqueValues = EnableSILOpaqueValues;
SILOpts.OSSACompleteLifetimes = EnableOSSACompleteLifetimes;
if (CopyPropagationState) { if (CopyPropagationState) {
SILOpts.CopyPropagation = *CopyPropagationState; SILOpts.CopyPropagation = *CopyPropagationState;