Skip to content

Commit b047425

Browse files
authored
Merge pull request #8384 from kavon/ncgenerics-xfails-3-llvm
2 parents 2abff47 + 9b4bb07 commit b047425

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,6 @@ static const char *getImportFailureString(swift::serialization::Status status) {
10671067
case swift::serialization::Status::NotInOSSA:
10681068
return "The module file was not compiled with -enable-ossa-modules when it "
10691069
"was required to do so.";
1070-
case swift::serialization::Status::NoncopyableGenericsMismatch:
1071-
return "The module file was compiled with a mismatching "
1072-
"-enable-experimental-feature NoncopyableGenerics setting.";
10731070
case swift::serialization::Status::SDKMismatch:
10741071
return "The module file was built with a different SDK version.";
10751072
}
@@ -1264,7 +1261,6 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
12641261
auto &langOpts = invocation.getLangOptions();
12651262
info = swift::serialization::validateSerializedAST(
12661263
buf, invocation.getSILOptions().EnableOSSAModules,
1267-
langOpts.hasFeature(swift::Feature::NoncopyableGenerics),
12681264
/*requiredSDK*/ StringRef(), &extended_validation_info,
12691265
/*dependencies*/ nullptr, &searchPaths);
12701266
bool invalid_ast = info.status != swift::serialization::Status::Valid;
@@ -3488,8 +3484,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
34883484
std::make_unique<swift::ModuleInterfaceCheckerImpl>(*m_ast_context_ap,
34893485
moduleCachePath, prebuiltModuleCachePath,
34903486
swift::ModuleInterfaceLoaderOptions(),
3491-
swift::RequireOSSAModules_t(GetSILOptions()),
3492-
swift::RequireNoncopyableGenerics_t(GetLanguageOptions())));
3487+
swift::RequireOSSAModules_t(GetSILOptions())));
34933488

34943489
// 2. Create and install the module interface loader.
34953490
//
@@ -5654,7 +5649,6 @@ bool SwiftASTContext::GetProtocolTypeInfo(const CompilerType &type,
56545649

56555650
swift::ExistentialLayout layout = swift_can_type.getExistentialLayout();
56565651
protocol_info.m_is_class_only = layout.requiresClass();
5657-
protocol_info.m_num_protocols = layout.getProtocols().size();
56585652
protocol_info.m_is_objc = layout.isObjC();
56595653
protocol_info.m_is_anyobject = layout.isAnyObject();
56605654
protocol_info.m_is_errortype = layout.isErrorExistential();
@@ -5664,11 +5658,24 @@ bool SwiftASTContext::GetProtocolTypeInfo(const CompilerType &type,
56645658
}
56655659

56665660
unsigned num_witness_tables = 0;
5661+
unsigned num_protocols = 0;
56675662
for (auto protoDecl : layout.getProtocols()) {
5663+
// Ignore invertible protocols like Copyable entirely. They're marker
5664+
// protocols that are not mangled into generic signatures. Only their
5665+
// absence is mangled.
5666+
// FIXME: this should probably be filtering all marker protocols,
5667+
// including Sendable, since marker protocols lack a witness table.
5668+
if (protoDecl->getInvertibleProtocolKind())
5669+
continue;
5670+
5671+
num_protocols++;
5672+
56685673
if (!protoDecl->isObjC())
56695674
num_witness_tables++;
56705675
}
56715676

5677+
protocol_info.m_num_protocols = num_protocols;
5678+
56725679
if (layout.isErrorExistential()) {
56735680
// Error existential -- instance pointer only.
56745681
protocol_info.m_num_payload_words = 0;

0 commit comments

Comments
 (0)