Skip to content

Enable serialization of witness tables by default #12493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ function(_compile_swift_files
"-Xfrontend" "${GROUP_INFO_JSON_FILE}")
if (NOT SWIFT_STDLIB_ENABLE_RESILIENCE)
if (SWIFT_STDLIB_SIL_SERIALIZE_ALL)
list(APPEND swift_flags "-Xfrontend" "-sil-serialize-witness-tables"
"-Xfrontend" "-sil-serialize-vtables")
list(APPEND swift_flags "-Xfrontend" "-sil-serialize-vtables")
endif()
endif()
endif()
Expand Down
6 changes: 0 additions & 6 deletions include/swift/AST/SILOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ class SILOptions {
/// \brief Enable large loadable types IRGen pass.
bool EnableLargeLoadableTypes = true;

/// If set, SIL witness tables will be serialized.
///
/// It is supposed to be used only for compiling overlays.
/// User code should never be compiled with this flag set.
bool SILSerializeWitnessTables = false;

/// If set, SIL vtables will be serialized.
///
/// It is supposed to be used only for compiling overlays.
Expand Down
3 changes: 0 additions & 3 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,6 @@ def sil_merge_partial_modules : Flag<["-"], "sil-merge-partial-modules">,
def sil_link_all : Flag<["-"], "sil-link-all">,
HelpText<"Link all SIL functions">;

def sil_serialize_witness_tables : Flag<["-"], "sil-serialize-witness-tables">,
HelpText<"Serialize eligible SIL witness tables">;

def sil_serialize_vtables : Flag<["-"], "sil-serialize-vtables">,
HelpText<"Serialize eligible SIL vtables">;

Expand Down
3 changes: 1 addition & 2 deletions include/swift/SIL/SILWitnessTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ class SILWitnessTable : public llvm::ilist_node<SILWitnessTable>,

// Whether a conformance should be serialized.
static bool conformanceIsSerialized(ProtocolConformance *conformance,
ResilienceStrategy strategy,
bool silSerializeWitnessTables);
ResilienceStrategy strategy);

/// Print the witness table.
void print(llvm::raw_ostream &OS, bool Verbose = false) const;
Expand Down
8 changes: 3 additions & 5 deletions include/swift/TBDGen/TBDGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ class FileUnit;
class ModuleDecl;

void enumeratePublicSymbols(FileUnit *module, llvm::StringSet<> &symbols,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables);
bool hasMultipleIRGenThreads);
void enumeratePublicSymbols(ModuleDecl *module, llvm::StringSet<> &symbols,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables);
bool hasMultipleIRGenThreads);

void writeTBDFile(ModuleDecl *M, llvm::raw_ostream &os,
bool hasMultipleIRGenThreads, bool silSerializeWitnessTables,
bool hasMultipleIRGenThreads,
llvm::StringRef installName);

} // end namespace swift
Expand Down
2 changes: 0 additions & 2 deletions lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
if (Args.hasArg(OPT_sil_merge_partial_modules))
Opts.MergePartialModules = true;

Opts.SILSerializeWitnessTables |=
Args.hasArg(OPT_sil_serialize_witness_tables);
Opts.SILSerializeVTables |=
Args.hasArg(OPT_sil_serialize_vtables);

Expand Down
6 changes: 3 additions & 3 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ static bool performCompile(CompilerInstance &Instance,
: opts.TBDInstallName;

if (writeTBD(Instance.getMainModule(), hasMultipleIRGenThreads,
silOpts.SILSerializeWitnessTables, opts.TBDPath, installName))
opts.TBDPath, installName))
return true;
}

Expand Down Expand Up @@ -1064,11 +1064,11 @@ static bool performCompile(CompilerInstance &Instance,
bool error;
if (PrimarySourceFile)
error = validateTBD(PrimarySourceFile, *IRModule, hasMultipleIRGenThreads,
silOpts.SILSerializeWitnessTables, allSymbols);
allSymbols);
else
error = validateTBD(Instance.getMainModule(), *IRModule,
hasMultipleIRGenThreads,
silOpts.SILSerializeWitnessTables, allSymbols);
allSymbols);
if (error)
return true;

Expand Down
13 changes: 4 additions & 9 deletions lib/FrontendTool/TBD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static std::vector<StringRef> sortSymbols(llvm::StringSet<> &symbols) {
}

bool swift::writeTBD(ModuleDecl *M, bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables, StringRef OutputFilename,
StringRef OutputFilename,
StringRef installName) {
std::error_code EC;
llvm::raw_fd_ostream OS(OutputFilename, EC, llvm::sys::fs::F_None);
Expand All @@ -49,8 +49,7 @@ bool swift::writeTBD(ModuleDecl *M, bool hasMultipleIRGenThreads,
return true;
}

writeTBDFile(M, OS, hasMultipleIRGenThreads, silSerializeWitnessTables,
installName);
writeTBDFile(M, OS, hasMultipleIRGenThreads, installName);

return false;
}
Expand Down Expand Up @@ -120,23 +119,19 @@ static bool validateSymbolSet(DiagnosticEngine &diags,

bool swift::validateTBD(ModuleDecl *M, llvm::Module &IRModule,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables,
bool diagnoseExtraSymbolsInTBD) {
llvm::StringSet<> symbols;
enumeratePublicSymbols(M, symbols, hasMultipleIRGenThreads,
silSerializeWitnessTables);
enumeratePublicSymbols(M, symbols, hasMultipleIRGenThreads);

return validateSymbolSet(M->getASTContext().Diags, symbols, IRModule,
diagnoseExtraSymbolsInTBD);
}

bool swift::validateTBD(FileUnit *file, llvm::Module &IRModule,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables,
bool diagnoseExtraSymbolsInTBD) {
llvm::StringSet<> symbols;
enumeratePublicSymbols(file, symbols, hasMultipleIRGenThreads,
silSerializeWitnessTables);
enumeratePublicSymbols(file, symbols, hasMultipleIRGenThreads);

return validateSymbolSet(file->getParentModule()->getASTContext().Diags,
symbols, IRModule, diagnoseExtraSymbolsInTBD);
Expand Down
6 changes: 3 additions & 3 deletions lib/FrontendTool/TBD.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class FileUnit;
class FrontendOptions;

bool writeTBD(ModuleDecl *M, bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables, llvm::StringRef OutputFilename,
llvm::StringRef OutputFilename,
llvm::StringRef installName);
bool inputFileKindCanHaveTBDValidated(InputFileKind kind);
bool validateTBD(ModuleDecl *M, llvm::Module &IRModule,
bool hasMultipleIRGenThreads, bool silSerializeWitnessTables,
bool hasMultipleIRGenThreads,
bool diagnoseExtraSymbolsInTBD);
bool validateTBD(FileUnit *M, llvm::Module &IRModule,
bool hasMultipleIRGenThreads, bool silSerializeWitnessTables,
bool hasMultipleIRGenThreads,
bool diagnoseExtraSymbolsInTBD);
}

Expand Down
6 changes: 2 additions & 4 deletions lib/SIL/SILWitnessTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ Identifier SILWitnessTable::getIdentifier() const {
}

bool SILWitnessTable::conformanceIsSerialized(ProtocolConformance *conformance,
ResilienceStrategy strategy,
bool silSerializeWitnessTables) {
ResilienceStrategy strategy) {
// Serialize witness tables for conformances synthesized by
// the ClangImporter.
if (isa<ClangModuleUnit>(conformance->getDeclContext()->getModuleScopeContext()))
Expand All @@ -174,6 +173,5 @@ bool SILWitnessTable::conformanceIsSerialized(ProtocolConformance *conformance,
auto protocolIsPublic =
conformance->getProtocol()->getEffectiveAccess() >= AccessLevel::Public;
auto typeIsPublic = nominal->getEffectiveAccess() >= AccessLevel::Public;
return (moduleIsResilient || silSerializeWitnessTables) &&
nominal->hasFixedLayout() && protocolIsPublic && typeIsPublic;
return nominal->hasFixedLayout() && protocolIsPublic && typeIsPublic;
}
3 changes: 1 addition & 2 deletions lib/SILGen/SILGenType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {

// ... or if the conformance itself thinks it should be.
if (SILWitnessTable::conformanceIsSerialized(
Conformance, SGM.M.getSwiftModule()->getResilienceStrategy(),
SGM.M.getOptions().SILSerializeWitnessTables))
Conformance, SGM.M.getSwiftModule()->getResilienceStrategy()))
Serialized = IsSerialized;

// Not all protocols use witness tables; in this case we just skip
Expand Down
4 changes: 1 addition & 3 deletions lib/Serialization/SerializeSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2294,9 +2294,7 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) {

// Write out fragile WitnessTables.
for (const SILWitnessTable &wt : SILMod->getWitnessTables()) {
if ((ShouldSerializeAll || SILMod->getOptions().SILSerializeWitnessTables ||
wt.isSerialized()) &&
wt.getConformance()->getDeclContext()->isChildContextOf(assocDC))
if (wt.getConformance()->getDeclContext()->isChildContextOf(assocDC))
writeSILWitnessTable(wt);
}

Expand Down
21 changes: 7 additions & 14 deletions lib/TBDGen/TBDGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ void TBDGenVisitor::addConformances(DeclContext *DC) {
// sometimes witness thunks need to be manually made public.

auto conformanceIsFixed = SILWitnessTable::conformanceIsSerialized(
normalConformance, SwiftModule->getResilienceStrategy(),
SILSerializeWitnessTables);
normalConformance, SwiftModule->getResilienceStrategy());
auto addSymbolIfNecessary = [&](ValueDecl *valueReq,
SILLinkage witnessLinkage) {
if (conformanceIsFixed &&
Expand Down Expand Up @@ -329,15 +328,13 @@ void TBDGenVisitor::visitProtocolDecl(ProtocolDecl *PD) {
static void enumeratePublicSymbolsAndWrite(ModuleDecl *M, FileUnit *singleFile,
StringSet &symbols,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables,
llvm::raw_ostream *os,
StringRef installName) {
auto isWholeModule = singleFile == nullptr;
const auto &target = M->getASTContext().LangOpts.Target;
UniversalLinkageInfo linkInfo(target, hasMultipleIRGenThreads, isWholeModule);

TBDGenVisitor visitor(symbols, target, linkInfo, M, silSerializeWitnessTables,
installName);
TBDGenVisitor visitor(symbols, target, linkInfo, M, installName);

auto visitFile = [&](FileUnit *file) {
SmallVector<Decl *, 16> decls;
Expand Down Expand Up @@ -372,24 +369,20 @@ static void enumeratePublicSymbolsAndWrite(ModuleDecl *M, FileUnit *singleFile,
}

void swift::enumeratePublicSymbols(FileUnit *file, StringSet &symbols,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables) {
bool hasMultipleIRGenThreads) {
enumeratePublicSymbolsAndWrite(
file->getParentModule(), file, symbols, hasMultipleIRGenThreads,
silSerializeWitnessTables, nullptr, StringRef());
nullptr, StringRef());
}
void swift::enumeratePublicSymbols(ModuleDecl *M, StringSet &symbols,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables) {
bool hasMultipleIRGenThreads) {
enumeratePublicSymbolsAndWrite(M, nullptr, symbols, hasMultipleIRGenThreads,
silSerializeWitnessTables, nullptr,
StringRef());
nullptr, StringRef());
}
void swift::writeTBDFile(ModuleDecl *M, llvm::raw_ostream &os,
bool hasMultipleIRGenThreads,
bool silSerializeWitnessTables,
StringRef installName) {
StringSet symbols;
enumeratePublicSymbolsAndWrite(M, nullptr, symbols, hasMultipleIRGenThreads,
silSerializeWitnessTables, &os, installName);
&os, installName);
}
8 changes: 2 additions & 6 deletions lib/TBDGen/TBDGenVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class TBDGenVisitor : public ASTVisitor<TBDGenVisitor> {

private:
bool FileHasEntryPoint = false;
bool SILSerializeWitnessTables;

bool InsideAbstractStorageDecl = false;

void addSymbol(StringRef name) {
Expand Down Expand Up @@ -74,11 +72,9 @@ class TBDGenVisitor : public ASTVisitor<TBDGenVisitor> {
public:
TBDGenVisitor(StringSet &symbols, const llvm::Triple &triple,
const UniversalLinkageInfo &universalLinkInfo,
ModuleDecl *swiftModule, bool silSerializeWitnessTables,
StringRef installName)
ModuleDecl *swiftModule, StringRef installName)
: Symbols(symbols), Triple(triple), UniversalLinkInfo(universalLinkInfo),
SwiftModule(swiftModule), InstallName(installName),
SILSerializeWitnessTables(silSerializeWitnessTables) {}
SwiftModule(swiftModule), InstallName(installName) {}

void setFileHasEntryPoint(bool hasEntryPoint) {
FileHasEntryPoint = hasEntryPoint;
Expand Down
6 changes: 1 addition & 5 deletions stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,14 @@ add_custom_target(swift-test-stdlib ALL

if(SWIFT_STDLIB_ENABLE_RESILIENCE)
set(STDLIB_SIL_SERIALIZE_ALL)
set(STDLIB_SIL_SERIALIZE_WITNESS_TABLES)
set(STDLIB_SIL_SERIALIZE_VTABLES)
else()
if(SWIFT_STDLIB_SIL_SERIALIZE_ALL)
set(STDLIB_SIL_SERIALIZE_ALL)
set(STDLIB_SIL_SERIALIZE_WITNESS_TABLES "-Xfrontend" "-sil-serialize-witness-tables")
set(STDLIB_SIL_SERIALIZE_VTABLES "-Xfrontend" "-sil-serialize-vtables")
list(APPEND STDLIB_SIL_SERIALIZE_ALL ${STDLIB_SIL_SERIALIZE_WITNESS_TABLES}
${STDLIB_SIL_SERIALIZE_VTABLES})
list(APPEND STDLIB_SIL_SERIALIZE_ALL ${STDLIB_SIL_SERIALIZE_VTABLES})
else()
set(STDLIB_SIL_SERIALIZE_ALL)
set(STDLIB_SIL_SERIALIZE_WITNESS_TABLES)
set(STDLIB_SIL_SERIALIZE_VTABLES)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibCollectionUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(swift_stdlib_unittest_compile_flags)
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-witness-tables" "-Xfrontend" "-sil-serialize-vtables")
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-vtables")
endif()

# TODO: support this on non-POSIX platforms. It cannot be currently as it
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(swift_stdlib_unittest_compile_flags)
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-witness-tables" "-Xfrontend" "-sil-serialize-vtables")
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-vtables")
endif()

# TODO: support this on non-POSIX platforms. It cannot be currently as it
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (SWIFT_RUNTIME_ENABLE_LEAK_CHECKER)
list(APPEND swift_stdlib_unittest_compile_flags "-DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER")
endif()
if(SWIFT_SERIALIZE_STDLIB_UNITTEST)
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-witness-tables" "-Xfrontend" "-sil-serialize-vtables")
list(APPEND swift_stdlib_unittest_compile_flags "-Xfrontend" "-sil-serialize-vtables")
endif()

is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" IS_BUILD_TYPE_OPTIMIZED)
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/SDK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ if(SWIFT_BUILD_STATIC_SDK_OVERLAY)
list(APPEND SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES STATIC)
endif()

list(APPEND SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS "${STDLIB_SIL_SERIALIZE_WITNESS_TABLES}")
list(APPEND SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS "${STDLIB_SIL_SERIALIZE_VTABLES}")

set(all_overlays "Accelerate;AppKit;ARKit;AssetsLibrary;AVFoundation;CallKit;CloudKit;Contacts;CoreAudio;CoreData;CoreFoundation;CoreGraphics;CoreImage;CoreLocation;CoreMedia;CryptoTokenKit;Dispatch;Foundation;GameplayKit;GLKit;HomeKit;IOKit;Intents;MapKit;MediaPlayer;Metal;MetalKit;ModelIO;ObjectiveC;OpenCL;os;Photos;QuartzCore;SafariServices;SceneKit;simd;SpriteKit;UIKit;Vision;WatchKit;XCTest;XPC")
Expand Down
2 changes: 1 addition & 1 deletion test/Frontend/sil-merge-partial-modules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ public class CircleManager : ShapeManager {

// NEGATIVE-NOT: sil {{.*}}internalFunction

// NEGATIVE-NOT: sil_witness_table {{.*}}Circle: Shape
// NEGATIVE: sil_witness_table {{.*}}Circle: Shape

// NEGATIVE-NOT: sil_vtable
2 changes: 1 addition & 1 deletion test/IRGen/sil_witness_tables_external_witnesstable.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %S/Inputs/sil_witness_tables_external_input.swift -o %t/Swift.swiftmodule -parse-stdlib -parse-as-library -module-name Swift -sil-serialize-witness-tables -sil-serialize-vtables -module-link-name swiftCore
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %S/Inputs/sil_witness_tables_external_input.swift -o %t/Swift.swiftmodule -parse-stdlib -parse-as-library -module-name Swift -sil-serialize-vtables -module-link-name swiftCore
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -I %t -primary-file %s -emit-ir | %FileCheck %s

import Swift
Expand Down
2 changes: 1 addition & 1 deletion test/SIL/Serialization/deserialize_generic.sil
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -sil-serialize-witness-tables -sil-serialize-vtables -o %t %S/Inputs/def_generic.swift
// RUN: %target-swift-frontend -emit-module -sil-serialize-vtables -o %t %S/Inputs/def_generic.swift
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -linker -I %t %s | %FileCheck %s

// Make sure that SILFunctionType with GenericSignature can match up with
Expand Down
2 changes: 1 addition & 1 deletion test/SIL/Serialization/deserialize_generic_marker.sil
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -sil-serialize-witness-tables -sil-serialize-vtables -o %t %S/Inputs/def_generic_marker.swift
// RUN: %target-swift-frontend -emit-module -sil-serialize-vtables -o %t %S/Inputs/def_generic_marker.swift
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -linker -I %t %s | %FileCheck %s

// Make sure that SILFunctionType with GenericSignature can match up with
Expand Down
2 changes: 1 addition & 1 deletion test/SIL/Serialization/function_param_convention.sil
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -parse-sil -sil-inline-threshold 0 %S/Inputs/function_param_convention_input.sil -o %t/FunctionInput.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-name FunctionInput -sil-serialize-witness-tables -sil-serialize-vtables -O
// RUN: %target-swift-frontend -parse-sil -sil-inline-threshold 0 %S/Inputs/function_param_convention_input.sil -o %t/FunctionInput.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-name FunctionInput -sil-serialize-vtables -O
// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -I %t -linker %s -o - | %FileCheck %s

import Swift
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -sil-inline-threshold 0 %S/Inputs/init_existential_inst_deserializes_witness_tables_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -sil-serialize-witness-tables -O
// RUN: %target-swift-frontend -sil-inline-threshold 0 %S/Inputs/init_existential_inst_deserializes_witness_tables_input.swift -o %t/Swift.swiftmodule -emit-module -parse-as-library -parse-stdlib -module-link-name swiftCore -module-name Swift -O
// RUN: %target-swift-frontend -I %t -O %s -emit-sil -o - | %FileCheck %s

// CHECK: sil_witness_table public_external [serialized] X: P module Swift {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module %S/Inputs/nontransparent.swift -O -sil-serialize-witness-tables -sil-serialize-vtables -parse-stdlib -parse-as-library -emit-module -o %t/Swift.swiftmodule -module-name=Swift -module-link-name swiftCore
// RUN: %target-swift-frontend -emit-module %S/Inputs/nontransparent.swift -O -sil-serialize-vtables -parse-stdlib -parse-as-library -emit-module -o %t/Swift.swiftmodule -module-name=Swift -module-link-name swiftCore
// RUN: %target-swift-frontend %s -O -I %t -emit-sil -o - | %FileCheck %s

import Swift
Expand Down
2 changes: 1 addition & 1 deletion test/SIL/Serialization/projection_lowered_type_parse.sil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %s -module-name Swift -sil-serialize-witness-tables -sil-serialize-vtables -module-link-name swiftCore -parse-as-library -parse-sil -parse-stdlib -o - | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name=Swift
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-module %s -module-name Swift -sil-serialize-vtables -module-link-name swiftCore -parse-as-library -parse-sil -parse-stdlib -o - | %target-sil-opt -assume-parsing-unqualified-ownership-sil -module-name=Swift

struct A {
var f : () -> ()
Expand Down
Loading