Skip to content

Commit b471cd3

Browse files
committed
TypeDecoder: Don't demangle freestanding PackExpansionTypes
1 parent fb14aef commit b471cd3

File tree

5 files changed

+2
-28
lines changed

5 files changed

+2
-28
lines changed

include/swift/AST/ASTDemangler.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ class ASTBuilder {
124124

125125
Type createSILPackType(ArrayRef<Type> eltTypes, bool isElementAddress);
126126

127-
Type createPackExpansionType(Type patternType, Type countType);
128-
129127
size_t beginPackExpansion(Type countType);
130128

131129
void advancePackExpansion(size_t index);

include/swift/Demangling/TypeDecoder.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,16 +1106,8 @@ class TypeDecoder {
11061106
}
11071107

11081108
case NodeKind::PackExpansion: {
1109-
if (Node->getNumChildren() < 2)
1110-
return MAKE_NODE_TYPE_ERROR(Node,
1111-
"fewer children (%zu) than required (2)",
1112-
Node->getNumChildren());
1113-
1114-
auto patternType = decodeMangledType(Node->getChild(0), depth + 1);
1115-
auto countType = decodeMangledType(Node->getChild(1), depth + 1);
1116-
1117-
return Builder.createPackExpansionType(patternType.getType(),
1118-
countType.getType());
1109+
return MAKE_NODE_TYPE_ERROR0(Node,
1110+
"pack expansion type in unsupported position");
11191111
}
11201112

11211113
case NodeKind::DependentGenericType: {

include/swift/RemoteInspection/TypeRefBuilder.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,6 @@ class TypeRefBuilder {
758758
return nullptr;
759759
}
760760

761-
const TypeRef *createPackExpansionType(const TypeRef *patternType,
762-
const TypeRef *countType) {
763-
// FIXME: Remote mirrors support for variadic generics.
764-
return nullptr;
765-
}
766-
767761
size_t beginPackExpansion(const TypeRef *countType) {
768762
// FIXME: Remote mirrors support for variadic generics.
769763
return 0;

lib/AST/ASTDemangler.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,6 @@ Type ASTBuilder::createSILPackType(ArrayRef<Type> eltTypes,
355355
return SILPackType::get(Ctx, extInfo, elements);
356356
}
357357

358-
Type ASTBuilder::createPackExpansionType(Type patternType, Type countType) {
359-
return PackExpansionType::get(patternType, countType);
360-
}
361-
362358
size_t ASTBuilder::beginPackExpansion(Type countType) {
363359
ActivePackExpansions.push_back(countType);
364360

stdlib/public/runtime/MetadataLookup.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,12 +2021,6 @@ class DecodedMetadataBuilder {
20212021
return TYPE_LOOKUP_ERROR_FMT("Lowered SILPackType cannot be demangled");
20222022
}
20232023

2024-
TypeLookupErrorOr<BuiltType>
2025-
createPackExpansionType(BuiltType patternType, BuiltType countType) const {
2026-
// FIXME: Runtime support for variadic generics.
2027-
return BuiltType();
2028-
}
2029-
20302024
size_t beginPackExpansion(BuiltType countType) {
20312025
if (!countType.isMetadataPack()) {
20322026
swift::fatalError(0, "Pack expansion count type should be a pack\n");

0 commit comments

Comments
 (0)