From 1985b6cceb294175740f3051bf9e518637624dd8 Mon Sep 17 00:00:00 2001 From: Meghana Gupta Date: Thu, 31 Oct 2024 13:35:18 -0700 Subject: [PATCH] [NFC] Add SerializationOptions to ASTContext --- include/swift/AST/ASTContext.h | 12 +++++-- include/swift/Frontend/Frontend.h | 6 ++++ .../Serialization/SerializationOptions.h | 5 ++- lib/AST/ASTContext.cpp | 31 ++++++++++--------- .../ModuleDependencyScanner.cpp | 1 + lib/DriverTool/modulewrap_main.cpp | 3 +- lib/DriverTool/swift_parse_test_main.cpp | 14 +++++---- lib/Frontend/Frontend.cpp | 3 +- lib/IDETool/CompileInstance.cpp | 3 +- lib/IDETool/IDEInspectionInstance.cpp | 4 ++- lib/IDETool/SyntacticMacroExpansion.cpp | 3 +- lib/Parse/Parser.cpp | 5 +-- unittests/AST/TestContext.cpp | 2 +- unittests/AST/TestContext.h | 1 + .../ClangImporter/ClangImporterTests.cpp | 14 +++++---- unittests/FrontendTool/ModuleLoadingTests.cpp | 3 +- unittests/Sema/SemaFixture.cpp | 6 ++-- unittests/Sema/SemaFixture.h | 1 + 18 files changed, 73 insertions(+), 44 deletions(-) diff --git a/include/swift/AST/ASTContext.h b/include/swift/AST/ASTContext.h index 85ecdf55f77..d3638bb3219 100644 --- a/include/swift/AST/ASTContext.h +++ b/include/swift/AST/ASTContext.h @@ -27,11 +27,12 @@ #include "swift/AST/Type.h" #include "swift/AST/TypeAlignments.h" #include "swift/AST/Types.h" +#include "swift/Basic/BlockList.h" #include "swift/Basic/CASOptions.h" #include "swift/Basic/LangOptions.h" #include "swift/Basic/Located.h" #include "swift/Basic/Malloc.h" -#include "swift/Basic/BlockList.h" +#include "swift/Serialization/SerializationOptions.h" #include "swift/SymbolGraphGen/SymbolGraphOptions.h" #include "clang/AST/DeclTemplate.h" #include "clang/Basic/DarwinSDKInfo.h" @@ -266,7 +267,8 @@ class ASTContext final { SILOptions &silOpts, SearchPathOptions &SearchPathOpts, ClangImporterOptions &ClangImporterOpts, symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts, CASOptions &casOpts, - SourceManager &SourceMgr, DiagnosticEngine &Diags, + SerializationOptions &serializationOpts, SourceManager &SourceMgr, + DiagnosticEngine &Diags, llvm::IntrusiveRefCntPtr OutBackend = nullptr); public: @@ -283,7 +285,8 @@ public: SILOptions &silOpts, SearchPathOptions &SearchPathOpts, ClangImporterOptions &ClangImporterOpts, symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts, CASOptions &casOpts, - SourceManager &SourceMgr, DiagnosticEngine &Diags, + SerializationOptions &serializationOpts, SourceManager &SourceMgr, + DiagnosticEngine &Diags, llvm::IntrusiveRefCntPtr OutBackend = nullptr); ~ASTContext(); @@ -314,6 +317,9 @@ public: /// The CAS options used by this AST context. const CASOptions &CASOpts; + /// Options for Serialization + const SerializationOptions &SerializationOpts; + /// The source manager object. SourceManager &SourceMgr; diff --git a/include/swift/Frontend/Frontend.h b/include/swift/Frontend/Frontend.h index 0919940dde6..02a69ecfe08 100644 --- a/include/swift/Frontend/Frontend.h +++ b/include/swift/Frontend/Frontend.h @@ -104,6 +104,7 @@ class CompilerInvocation { TBDGenOptions TBDGenOpts; ModuleInterfaceOptions ModuleInterfaceOpts; CASOptions CASOpts; + SerializationOptions SerializationOpts; llvm::MemoryBuffer *IDEInspectionTargetBuffer = nullptr; /// The offset that IDEInspection wants to further examine in offset of bytes @@ -327,6 +328,11 @@ public: IRGenOptions &getIRGenOptions() { return IRGenOpts; } const IRGenOptions &getIRGenOptions() const { return IRGenOpts; } + SerializationOptions &getSerializationOptions() { return SerializationOpts; } + const SerializationOptions &getSerializationOptions() const { + return SerializationOpts; + } + void setParseStdlib() { FrontendOpts.ParseStdlib = true; } diff --git a/include/swift/Serialization/SerializationOptions.h b/include/swift/Serialization/SerializationOptions.h index 24751d0ddcf..206717a9654 100644 --- a/include/swift/Serialization/SerializationOptions.h +++ b/include/swift/Serialization/SerializationOptions.h @@ -25,13 +25,12 @@ namespace swift { class SerializationOptions { - SerializationOptions(const SerializationOptions &) = delete; - void operator=(const SerializationOptions &) = delete; - public: SerializationOptions() = default; SerializationOptions(SerializationOptions &&) = default; SerializationOptions &operator=(SerializationOptions &&) = default; + SerializationOptions(const SerializationOptions &) = default; + SerializationOptions &operator=(const SerializationOptions &) = default; ~SerializationOptions() = default; StringRef OutputPath; diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 6608ef8a527..779da48bc71 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -757,7 +757,8 @@ ASTContext *ASTContext::get( SILOptions &silOpts, SearchPathOptions &SearchPathOpts, ClangImporterOptions &ClangImporterOpts, symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts, CASOptions &casOpts, - SourceManager &SourceMgr, DiagnosticEngine &Diags, + SerializationOptions &serializationOpts, SourceManager &SourceMgr, + DiagnosticEngine &Diags, llvm::IntrusiveRefCntPtr OutputBackend) { // If more than two data structures are concatentated, then the aggregate // size math needs to become more complicated due to per-struct alignment @@ -771,8 +772,8 @@ ASTContext *ASTContext::get( new (impl) Implementation(); return new (mem) ASTContext(langOpts, typecheckOpts, silOpts, SearchPathOpts, - ClangImporterOpts, SymbolGraphOpts, casOpts, SourceMgr, Diags, - std::move(OutputBackend)); + ClangImporterOpts, SymbolGraphOpts, casOpts, serializationOpts, + SourceMgr, Diags, std::move(OutputBackend)); } ASTContext::ASTContext( @@ -780,17 +781,19 @@ ASTContext::ASTContext( SILOptions &silOpts, SearchPathOptions &SearchPathOpts, ClangImporterOptions &ClangImporterOpts, symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts, CASOptions &casOpts, - SourceManager &SourceMgr, DiagnosticEngine &Diags, + SerializationOptions &SerializationOpts, SourceManager &SourceMgr, + DiagnosticEngine &Diags, llvm::IntrusiveRefCntPtr OutBackend) : LangOpts(langOpts), TypeCheckerOpts(typecheckOpts), SILOpts(silOpts), SearchPathOpts(SearchPathOpts), ClangImporterOpts(ClangImporterOpts), - SymbolGraphOpts(SymbolGraphOpts), CASOpts(casOpts), SourceMgr(SourceMgr), - Diags(Diags), OutputBackend(std::move(OutBackend)), - evaluator(Diags, langOpts), TheBuiltinModule(createBuiltinModule(*this)), + SymbolGraphOpts(SymbolGraphOpts), CASOpts(casOpts), + SerializationOpts(SerializationOpts), SourceMgr(SourceMgr), Diags(Diags), + OutputBackend(std::move(OutBackend)), evaluator(Diags, langOpts), + TheBuiltinModule(createBuiltinModule(*this)), StdlibModuleName(getIdentifier(STDLIB_NAME)), SwiftShimsModuleName(getIdentifier(SWIFT_SHIMS_NAME)), blockListConfig(SourceMgr), - TheErrorType(new (*this, AllocationArena::Permanent) ErrorType( + TheErrorType(new(*this, AllocationArena::Permanent) ErrorType( *this, Type(), RecursiveTypeProperties::HasError)), TheUnresolvedType(new(*this, AllocationArena::Permanent) UnresolvedType(*this)), @@ -801,17 +804,17 @@ ASTContext::ASTContext( The##SHORT_ID##Type(new (*this, AllocationArena::Permanent) \ ID##Type(*this)), #include "swift/AST/TypeNodes.def" - TheIEEE32Type(new (*this, AllocationArena::Permanent) + TheIEEE32Type(new(*this, AllocationArena::Permanent) BuiltinFloatType(BuiltinFloatType::IEEE32, *this)), - TheIEEE64Type(new (*this, AllocationArena::Permanent) + TheIEEE64Type(new(*this, AllocationArena::Permanent) BuiltinFloatType(BuiltinFloatType::IEEE64, *this)), - TheIEEE16Type(new (*this, AllocationArena::Permanent) + TheIEEE16Type(new(*this, AllocationArena::Permanent) BuiltinFloatType(BuiltinFloatType::IEEE16, *this)), - TheIEEE80Type(new (*this, AllocationArena::Permanent) + TheIEEE80Type(new(*this, AllocationArena::Permanent) BuiltinFloatType(BuiltinFloatType::IEEE80, *this)), - TheIEEE128Type(new (*this, AllocationArena::Permanent) + TheIEEE128Type(new(*this, AllocationArena::Permanent) BuiltinFloatType(BuiltinFloatType::IEEE128, *this)), - ThePPC128Type(new (*this, AllocationArena::Permanent) + ThePPC128Type(new(*this, AllocationArena::Permanent) BuiltinFloatType(BuiltinFloatType::PPC128, *this)) { // Initialize all of the known identifiers. diff --git a/lib/DependencyScan/ModuleDependencyScanner.cpp b/lib/DependencyScan/ModuleDependencyScanner.cpp index c9f8045fd7a..93af8aa0c90 100644 --- a/lib/DependencyScan/ModuleDependencyScanner.cpp +++ b/lib/DependencyScan/ModuleDependencyScanner.cpp @@ -180,6 +180,7 @@ ModuleDependencyScanningWorker::ModuleDependencyScanningWorker( workerCompilerInvocation->getClangImporterOptions(), workerCompilerInvocation->getSymbolGraphOptions(), workerCompilerInvocation->getCASOptions(), + workerCompilerInvocation->getSerializationOptions(), ScanASTContext.SourceMgr, Diagnostics)); auto loader = std::make_unique( *workerASTContext, /*DepTracker=*/nullptr, diff --git a/lib/DriverTool/modulewrap_main.cpp b/lib/DriverTool/modulewrap_main.cpp index 77d1168f451..fd19c47e692 100644 --- a/lib/DriverTool/modulewrap_main.cpp +++ b/lib/DriverTool/modulewrap_main.cpp @@ -188,11 +188,12 @@ int modulewrap_main(ArrayRef Args, const char *Argv0, ClangImporterOptions ClangImporterOpts; symbolgraphgen::SymbolGraphOptions SymbolGraphOpts; CASOptions CASOpts; + SerializationOptions SerializationOpts; LangOpts.Target = Invocation.getTargetTriple(); LangOpts.EnableObjCInterop = Invocation.enableObjCInterop(); ASTContext &ASTCtx = *ASTContext::get( LangOpts, TypeCheckOpts, SILOpts, SearchPathOpts, ClangImporterOpts, - SymbolGraphOpts, CASOpts, SrcMgr, Instance.getDiags(), + SymbolGraphOpts, CASOpts, SerializationOpts, SrcMgr, Instance.getDiags(), llvm::makeIntrusiveRefCnt()); registerParseRequestFunctions(ASTCtx.evaluator); registerTypeCheckerRequestFunctions(ASTCtx.evaluator); diff --git a/lib/DriverTool/swift_parse_test_main.cpp b/lib/DriverTool/swift_parse_test_main.cpp index edb69f8c378..3d0a0774fd0 100644 --- a/lib/DriverTool/swift_parse_test_main.cpp +++ b/lib/DriverTool/swift_parse_test_main.cpp @@ -82,9 +82,10 @@ struct LibParseExecutor { ClangImporterOptions clangOpts; symbolgraphgen::SymbolGraphOptions symbolOpts; CASOptions casOpts; - std::unique_ptr ctx( - ASTContext::get(langOpts, typeckOpts, silOpts, searchPathOpts, - clangOpts, symbolOpts, casOpts, SM, diagEngine)); + SerializationOptions serializationOpts; + std::unique_ptr ctx(ASTContext::get( + langOpts, typeckOpts, silOpts, searchPathOpts, clangOpts, symbolOpts, + casOpts, serializationOpts, SM, diagEngine)); SourceFile::ParsingOptions parseOpts; parseOpts |= SourceFile::ParsingFlags::DisablePoundIfEvaluation; @@ -153,13 +154,14 @@ struct ASTGenExecutor { ClangImporterOptions clangOpts; CASOptions casOpts; symbolgraphgen::SymbolGraphOptions symbolOpts; + SerializationOptions serializationOpts; // Enable ASTGen. langOpts.enableFeature(Feature::ParserASTGen); - std::unique_ptr ctx( - ASTContext::get(langOpts, typeckOpts, silOpts, searchPathOpts, - clangOpts, symbolOpts, casOpts, SM, diagEngine)); + std::unique_ptr ctx(ASTContext::get( + langOpts, typeckOpts, silOpts, searchPathOpts, clangOpts, symbolOpts, + casOpts, serializationOpts, SM, diagEngine)); registerParseRequestFunctions(ctx->evaluator); registerTypeCheckerRequestFunctions(ctx->evaluator); diff --git a/lib/Frontend/Frontend.cpp b/lib/Frontend/Frontend.cpp index 121b137f5cb..3e508f42672 100644 --- a/lib/Frontend/Frontend.cpp +++ b/lib/Frontend/Frontend.cpp @@ -302,7 +302,8 @@ bool CompilerInstance::setUpASTContextIfNeeded() { Invocation.getLangOptions(), Invocation.getTypeCheckerOptions(), Invocation.getSILOptions(), Invocation.getSearchPathOptions(), Invocation.getClangImporterOptions(), Invocation.getSymbolGraphOptions(), - Invocation.getCASOptions(), SourceMgr, Diagnostics, OutputBackend)); + Invocation.getCASOptions(), Invocation.getSerializationOptions(), + SourceMgr, Diagnostics, OutputBackend)); if (!Invocation.getFrontendOptions().ModuleAliasMap.empty()) Context->setModuleAliases(Invocation.getFrontendOptions().ModuleAliasMap); diff --git a/lib/IDETool/CompileInstance.cpp b/lib/IDETool/CompileInstance.cpp index b8350281520..437598c8ded 100644 --- a/lib/IDETool/CompileInstance.cpp +++ b/lib/IDETool/CompileInstance.cpp @@ -128,11 +128,12 @@ getModifiedFunctionDeclList(const SourceFile &SF, SourceManager &tmpSM, SILOptions silOpts = ctx.SILOpts; CASOptions casOpts = ctx.CASOpts; symbolgraphgen::SymbolGraphOptions symbolOpts = ctx.SymbolGraphOpts; + SerializationOptions serializationOpts = ctx.SerializationOpts; DiagnosticEngine tmpDiags(tmpSM); auto &tmpCtx = *ASTContext::get(langOpts, typeckOpts, silOpts, searchPathOpts, clangOpts, - symbolOpts, casOpts, tmpSM, tmpDiags); + symbolOpts, casOpts, serializationOpts, tmpSM, tmpDiags); registerParseRequestFunctions(tmpCtx.evaluator); registerTypeCheckerRequestFunctions(tmpCtx.evaluator); diff --git a/lib/IDETool/IDEInspectionInstance.cpp b/lib/IDETool/IDEInspectionInstance.cpp index 1d1d780fc95..2a332c5ef47 100644 --- a/lib/IDETool/IDEInspectionInstance.cpp +++ b/lib/IDETool/IDEInspectionInstance.cpp @@ -241,9 +241,11 @@ bool IDEInspectionInstance::performCachedOperationIfPossible( ClangImporterOptions clangOpts; symbolgraphgen::SymbolGraphOptions symbolOpts; CASOptions casOpts; + SerializationOptions serializationOpts = + CachedCI->getASTContext().SerializationOpts; std::unique_ptr tmpCtx( ASTContext::get(langOpts, typeckOpts, silOpts, searchPathOpts, clangOpts, - symbolOpts, casOpts, tmpSM, tmpDiags)); + symbolOpts, casOpts, serializationOpts, tmpSM, tmpDiags)); tmpCtx->CancellationFlag = CancellationFlag; registerParseRequestFunctions(tmpCtx->evaluator); registerIDERequestFunctions(tmpCtx->evaluator); diff --git a/lib/IDETool/SyntacticMacroExpansion.cpp b/lib/IDETool/SyntacticMacroExpansion.cpp index 681fac2f397..f761360955a 100644 --- a/lib/IDETool/SyntacticMacroExpansion.cpp +++ b/lib/IDETool/SyntacticMacroExpansion.cpp @@ -63,7 +63,8 @@ bool SyntacticMacroExpansionInstance::setup( invocation.getLangOptions(), invocation.getTypeCheckerOptions(), invocation.getSILOptions(), invocation.getSearchPathOptions(), invocation.getClangImporterOptions(), invocation.getSymbolGraphOptions(), - invocation.getCASOptions(), SourceMgr, Diags)); + invocation.getCASOptions(), invocation.getSerializationOptions(), + SourceMgr, Diags)); registerParseRequestFunctions(Ctx->evaluator); registerTypeCheckerRequestFunctions(Ctx->evaluator); diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index f9a5d6b914d..bae7280cd28 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -1126,6 +1126,7 @@ struct ParserUnit::Implementation { ClangImporterOptions clangImporterOpts; symbolgraphgen::SymbolGraphOptions symbolGraphOpts; CASOptions CASOpts; + SerializationOptions SerializationOpts; DiagnosticEngine Diags; ASTContext &Ctx; SourceFile *SF; @@ -1136,8 +1137,8 @@ struct ParserUnit::Implementation { const SILOptions &silOpts, StringRef ModuleName) : LangOpts(Opts), TypeCheckerOpts(TyOpts), SILOpts(silOpts), Diags(SM), Ctx(*ASTContext::get(LangOpts, TypeCheckerOpts, SILOpts, SearchPathOpts, - clangImporterOpts, symbolGraphOpts, CASOpts, SM, - Diags)) { + clangImporterOpts, symbolGraphOpts, CASOpts, + SerializationOpts, SM, Diags)) { registerParseRequestFunctions(Ctx.evaluator); auto parsingOpts = SourceFile::getDefaultParsingOptions(LangOpts); diff --git a/unittests/AST/TestContext.cpp b/unittests/AST/TestContext.cpp index a9935db6883..73b83b112fe 100644 --- a/unittests/AST/TestContext.cpp +++ b/unittests/AST/TestContext.cpp @@ -36,7 +36,7 @@ static Decl *createOptionalType(ASTContext &ctx, SourceFile *fileForLookups, TestContext::TestContext(ShouldDeclareOptionalTypes optionals) : Ctx(*ASTContext::get(LangOpts, TypeCheckerOpts, SILOpts, SearchPathOpts, ClangImporterOpts, SymbolGraphOpts, CASOpts, - SourceMgr, Diags)) { + SerializationOpts, SourceMgr, Diags)) { registerParseRequestFunctions(Ctx.evaluator); registerTypeCheckerRequestFunctions(Ctx.evaluator); registerClangImporterRequestFunctions(Ctx.evaluator); diff --git a/unittests/AST/TestContext.h b/unittests/AST/TestContext.h index 3025a38fdd7..60588278b29 100644 --- a/unittests/AST/TestContext.h +++ b/unittests/AST/TestContext.h @@ -36,6 +36,7 @@ public: ClangImporterOptions ClangImporterOpts; symbolgraphgen::SymbolGraphOptions SymbolGraphOpts; CASOptions CASOpts; + SerializationOptions SerializationOpts; SourceManager SourceMgr; DiagnosticEngine Diags; diff --git a/unittests/ClangImporter/ClangImporterTests.cpp b/unittests/ClangImporter/ClangImporterTests.cpp index e716aceec16..cb20746a8f3 100644 --- a/unittests/ClangImporter/ClangImporterTests.cpp +++ b/unittests/ClangImporter/ClangImporterTests.cpp @@ -80,11 +80,12 @@ TEST(ClangImporterTest, emitPCHInMemory) { swift::SearchPathOptions searchPathOpts; swift::symbolgraphgen::SymbolGraphOptions symbolGraphOpts; swift::CASOptions casOpts; + swift::SerializationOptions serializationOpts; swift::SourceManager sourceMgr; swift::DiagnosticEngine diags(sourceMgr); - std::unique_ptr context( - ASTContext::get(langOpts, typecheckOpts, silOpts, searchPathOpts, options, - symbolGraphOpts, casOpts, sourceMgr, diags)); + std::unique_ptr context(ASTContext::get( + langOpts, typecheckOpts, silOpts, searchPathOpts, options, + symbolGraphOpts, casOpts, serializationOpts, sourceMgr, diags)); auto importer = ClangImporter::create(*context); std::string PCH = createFilename(cache, "bridging.h.pch"); @@ -197,14 +198,15 @@ TEST(ClangImporterTest, libStdCxxInjectionTest) { swift::DiagnosticEngine diags(sourceMgr); ClangImporterOptions options; CASOptions casOpts; + SerializationOptions serializationOpts; options.clangPath = "/usr/bin/clang"; options.ExtraArgs.push_back( (llvm::Twine("--gcc-toolchain=") + "/opt/rh/devtoolset-9/root/usr") .str()); options.ExtraArgs.push_back("--gcc-toolchain"); - std::unique_ptr context( - ASTContext::get(langOpts, typecheckOpts, silOpts, searchPathOpts, options, - symbolGraphOpts, casOpts, sourceMgr, diags)); + std::unique_ptr context(ASTContext::get( + langOpts, typecheckOpts, silOpts, searchPathOpts, options, + symbolGraphOpts, casOpts, serializationOpts, sourceMgr, diags)); { LibStdCxxInjectionVFS vfs; diff --git a/unittests/FrontendTool/ModuleLoadingTests.cpp b/unittests/FrontendTool/ModuleLoadingTests.cpp index 2198ccef4c6..8dd785f3dbe 100644 --- a/unittests/FrontendTool/ModuleLoadingTests.cpp +++ b/unittests/FrontendTool/ModuleLoadingTests.cpp @@ -104,9 +104,10 @@ protected: symbolgraphgen::SymbolGraphOptions symbolGraphOpts; SILOptions silOpts; CASOptions casOpts; + SerializationOptions serializationOpts; auto ctx = ASTContext::get(langOpts, typecheckOpts, silOpts, searchPathOpts, clangImpOpts, symbolGraphOpts, casOpts, - sourceMgr, diags); + serializationOpts, sourceMgr, diags); ctx->addModuleInterfaceChecker( std::make_unique(*ctx, cacheDir, diff --git a/unittests/Sema/SemaFixture.cpp b/unittests/Sema/SemaFixture.cpp index b9250549430..b74389dfa03 100644 --- a/unittests/Sema/SemaFixture.cpp +++ b/unittests/Sema/SemaFixture.cpp @@ -29,9 +29,9 @@ using namespace swift::unittest; using namespace swift::constraints::inference; SemaTest::SemaTest() - : Context(*ASTContext::get(LangOpts, TypeCheckerOpts, SILOpts, - SearchPathOpts, ClangImporterOpts, - SymbolGraphOpts, CASOpts, SourceMgr, Diags)) { + : Context(*ASTContext::get( + LangOpts, TypeCheckerOpts, SILOpts, SearchPathOpts, ClangImporterOpts, + SymbolGraphOpts, CASOpts, SerializationOpts, SourceMgr, Diags)) { INITIALIZE_LLVM(); registerParseRequestFunctions(Context.evaluator); diff --git a/unittests/Sema/SemaFixture.h b/unittests/Sema/SemaFixture.h index 6658ad01b2d..715978082d4 100644 --- a/unittests/Sema/SemaFixture.h +++ b/unittests/Sema/SemaFixture.h @@ -43,6 +43,7 @@ public: ClangImporterOptions ClangImporterOpts; symbolgraphgen::SymbolGraphOptions SymbolGraphOpts; CASOptions CASOpts; + SerializationOptions SerializationOpts; SourceManager SourceMgr; DiagnosticEngine Diags;