Skip to content

Commit 2743b83

Browse files
committed
Added option: -enable-ossa-complete-lifetimes
Disabled by default during initial testing.
1 parent ccd08ca commit 2743b83

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

include/swift/AST/SILOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ class SILOptions {
173173
/// If set to true, compile with the SIL Opaque Values enabled.
174174
bool EnableSILOpaqueValues = false;
175175

176+
/// Require linear OSSA lifetimes after SILGen
177+
bool OSSACompleteLifetimes = false;
178+
176179
// The kind of function bodies to skip emitting.
177180
FunctionBodySkipping SkipFunctionBodies = FunctionBodySkipping::None;
178181

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,4 +1165,8 @@ def enable_emit_generic_class_ro_t_list :
11651165
def experimental_spi_only_imports :
11661166
Flag<["-"], "experimental-spi-only-imports">,
11671167
HelpText<"Enable use of @_spiOnly imports">;
1168+
1169+
def enable_ossa_complete_lifetimes :
1170+
Flag<["-"], "enable-ossa-complete-lifetimes">,
1171+
HelpText<"Require linear OSSA lifetimes after SILGen">;
11681172
} // end let Flags = [FrontendOption, NoDriverOption, HelpHidden]

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
19851985
parseExclusivityEnforcementOptions(A, Opts, Diags);
19861986
}
19871987

1988+
Opts.OSSACompleteLifetimes |= Args.hasArg(OPT_enable_ossa_complete_lifetimes);
1989+
19881990
return false;
19891991
}
19901992

tools/sil-opt/SILOpt.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ static llvm::cl::opt<bool>
109109
EnableSILOpaqueValues("enable-sil-opaque-values",
110110
llvm::cl::desc("Compile the module with sil-opaque-values enabled."));
111111

112+
static llvm::cl::opt<bool>
113+
EnableOSSACompleteLifetimes("enable-ossa-complete-lifetimes",
114+
llvm::cl::desc("Compile the module with sil-opaque-values enabled."));
115+
112116
static llvm::cl::opt<bool>
113117
EnableObjCInterop("enable-objc-interop",
114118
llvm::cl::desc("Enable Objective-C interoperability."));
@@ -659,6 +663,7 @@ int main(int argc, char **argv) {
659663
SILOpts.IgnoreAlwaysInline = IgnoreAlwaysInline;
660664
SILOpts.EnableOSSAModules = EnableOSSAModules;
661665
SILOpts.EnableSILOpaqueValues = EnableSILOpaqueValues;
666+
SILOpts.OSSACompleteLifetimes = EnableOSSACompleteLifetimes;
662667

663668
if (CopyPropagationState) {
664669
SILOpts.CopyPropagation = *CopyPropagationState;

0 commit comments

Comments
 (0)