Skip to content

Commit d9cc0f0

Browse files
committed
TypeDecoder: Don't demangle freestanding PackExpansionTypes
1 parent 50859d8 commit d9cc0f0

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
@@ -123,8 +123,6 @@ class ASTBuilder {
123123

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

126-
Type createPackExpansionType(Type patternType, Type countType);
127-
128126
size_t beginPackExpansion(Type countType);
129127

130128
void advancePackExpansion(size_t index);

include/swift/Demangling/TypeDecoder.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,16 +1103,8 @@ class TypeDecoder {
11031103
}
11041104

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

11181110
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
@@ -2010,12 +2010,6 @@ class DecodedMetadataBuilder {
20102010
return TYPE_LOOKUP_ERROR_FMT("Lowered SILPackType cannot be demangled");
20112011
}
20122012

2013-
TypeLookupErrorOr<BuiltType>
2014-
createPackExpansionType(BuiltType patternType, BuiltType countType) const {
2015-
// FIXME: Runtime support for variadic generics.
2016-
return BuiltType();
2017-
}
2018-
20192013
size_t beginPackExpansion(BuiltType countType) {
20202014
if (!countType.isMetadataPack()) {
20212015
swift::fatalError(0, "Pack expansion count type should be a pack\n");

0 commit comments

Comments
 (0)