[ownership] Make whether or not we serialize in OSSA form based off of the flag -enable-ossa-modules.

I added a change to CMake so that the stdlib still gets the option passed in so
should be NFC.
This commit is contained in:
Michael Gottesman
2021-02-17 21:44:26 -08:00
parent 0d9ca2044f
commit 91317c723c
11 changed files with 38 additions and 15 deletions

View File

@@ -110,6 +110,12 @@ DisableASTDump("sil-disable-ast-dump", llvm::cl::Hidden,
llvm::cl::init(false),
llvm::cl::desc("Do not dump AST."));
static llvm::cl::opt<bool> EnableOSSAModules(
"enable-ossa-modules",
llvm::cl::desc("Do we always serialize SIL in OSSA form? If "
"this is disabled we do not serialize in OSSA "
"form when optimizing."));
// This function isn't referenced outside its translation unit, but it
// can't use the "static" keyword because its address is used for
// getMainExecutable (since some platforms don't support taking the
@@ -247,6 +253,7 @@ int main(int argc, char **argv) {
SILOptions &Opts = Invocation.getSILOptions();
Opts.EmitVerboseSIL = EmitVerboseSIL;
Opts.EmitSortedSIL = EmitSortedSIL;
Opts.EnableOSSAModules = EnableOSSAModules;
serialization::ExtendedValidationInfo extendedInfo;
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileBufOrErr =