Skip to content

Commit d94abcc

Browse files
authored
Merge pull request llvm#8467 from kavon/ncgenerics-next-cherries
[next][llvm] use new noncopyable infrastructure
2 parents 011866c + a770507 commit d94abcc

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
@@ -1069,9 +1069,6 @@ static const char *getImportFailureString(swift::serialization::Status status) {
10691069
case swift::serialization::Status::NotInOSSA:
10701070
return "The module file was not compiled with -enable-ossa-modules when it "
10711071
"was required to do so.";
1072-
case swift::serialization::Status::NoncopyableGenericsMismatch:
1073-
return "The module file was compiled with a mismatching "
1074-
"-enable-experimental-feature NoncopyableGenerics setting.";
10751072
case swift::serialization::Status::SDKMismatch:
10761073
return "The module file was built with a different SDK version.";
10771074
}
@@ -1266,7 +1263,6 @@ static bool DeserializeAllCompilerFlags(swift::CompilerInvocation &invocation,
12661263
auto &langOpts = invocation.getLangOptions();
12671264
info = swift::serialization::validateSerializedAST(
12681265
buf, invocation.getSILOptions().EnableOSSAModules,
1269-
langOpts.hasFeature(swift::Feature::NoncopyableGenerics),
12701266
/*requiredSDK*/ StringRef(), &extended_validation_info,
12711267
/*dependencies*/ nullptr, &searchPaths);
12721268
bool invalid_ast = info.status != swift::serialization::Status::Valid;
@@ -3486,8 +3482,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
34863482
std::make_unique<swift::ModuleInterfaceCheckerImpl>(*m_ast_context_ap,
34873483
moduleCachePath, prebuiltModuleCachePath,
34883484
swift::ModuleInterfaceLoaderOptions(),
3489-
swift::RequireOSSAModules_t(GetSILOptions()),
3490-
swift::RequireNoncopyableGenerics_t(GetLanguageOptions())));
3485+
swift::RequireOSSAModules_t(GetSILOptions())));
34913486

34923487
// 2. Create and install the module interface loader.
34933488
//
@@ -5653,7 +5648,6 @@ bool SwiftASTContext::GetProtocolTypeInfo(const CompilerType &type,
56535648

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

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

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

0 commit comments

Comments
 (0)