Skip to content

Commit a628b9c

Browse files
committed
AST: Remove InverseMarking.h
1 parent 7629d00 commit a628b9c

File tree

6 files changed

+0
-132
lines changed

6 files changed

+0
-132
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "swift/AST/IfConfigClause.h"
3333
#include "swift/AST/Import.h"
3434
#include "swift/AST/Initializer.h"
35-
#include "swift/AST/InverseMarking.h"
3635
#include "swift/AST/LayoutConstraint.h"
3736
#include "swift/AST/LifetimeAnnotation.h"
3837
#include "swift/AST/ReferenceCounting.h"
@@ -96,7 +95,6 @@ namespace swift {
9695
class NamedPattern;
9796
class EnumCaseDecl;
9897
class EnumElementDecl;
99-
struct InverseMarking;
10098
class ParameterList;
10199
class ParameterTypeFlags;
102100
class Pattern;

include/swift/AST/InverseMarking.h

Lines changed: 0 additions & 90 deletions
This file was deleted.

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "swift/AST/GenericEnvironment.h"
3030
#include "swift/AST/GenericParamList.h"
3131
#include "swift/AST/GenericSignature.h"
32-
#include "swift/AST/InverseMarking.h"
3332
#include "swift/AST/MacroDefinition.h"
3433
#include "swift/AST/Module.h"
3534
#include "swift/AST/NameLookup.h"

lib/AST/Decl.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "swift/AST/GenericSignature.h"
3333
#include "swift/AST/ImportCache.h"
3434
#include "swift/AST/Initializer.h"
35-
#include "swift/AST/InverseMarking.h"
3635
#include "swift/AST/LazyResolver.h"
3736
#include "swift/AST/MacroDefinition.h"
3837
#include "swift/AST/MacroDiscriminatorContext.h"
@@ -6615,42 +6614,6 @@ bool ProtocolDecl::inheritsFrom(const ProtocolDecl *super) const {
66156614
return (llvm::find(allInherited, super) != allInherited.end());
66166615
}
66176616

6618-
static void findInheritedType(
6619-
InheritedTypes inherited,
6620-
llvm::function_ref<bool(Type, NullablePtr<TypeRepr>)> isMatch) {
6621-
for (size_t i = 0; i < inherited.size(); i++) {
6622-
auto type = inherited.getResolvedType(i, TypeResolutionStage::Structural);
6623-
if (!type)
6624-
continue;
6625-
6626-
if (isMatch(type, inherited.getTypeRepr(i)))
6627-
break;
6628-
}
6629-
}
6630-
6631-
static InverseMarking::Mark
6632-
findInverseInInheritance(InheritedTypes inherited,
6633-
InvertibleProtocolKind target) {
6634-
auto isInverseOfTarget = [&](Type t) {
6635-
if (auto pct = t->getAs<ProtocolCompositionType>())
6636-
return pct->getInverses().contains(target);
6637-
return false;
6638-
};
6639-
6640-
InverseMarking::Mark inverse;
6641-
findInheritedType(inherited,
6642-
[&](Type inheritedTy, NullablePtr<TypeRepr> repr) {
6643-
if (!isInverseOfTarget(inheritedTy))
6644-
return false;
6645-
6646-
inverse = InverseMarking::Mark(
6647-
InverseMarking::Kind::Explicit,
6648-
repr.isNull() ? SourceLoc() : repr.get()->getLoc());
6649-
return true;
6650-
});
6651-
return inverse;
6652-
}
6653-
66546617
bool ProtocolDecl::requiresClass() const {
66556618
return evaluateOrDefault(getASTContext().evaluator,
66566619
ProtocolRequiresClassRequest{const_cast<ProtocolDecl *>(this)}, false);

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "swift/AST/ForeignErrorConvention.h"
3838
#include "swift/AST/GenericEnvironment.h"
3939
#include "swift/AST/Initializer.h"
40-
#include "swift/AST/InverseMarking.h"
4140
#include "swift/AST/NameLookup.h"
4241
#include "swift/AST/NameLookupRequests.h"
4342
#include "swift/AST/OperatorNameLookup.h"

lib/Sema/TypeCheckRequestFunctions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "swift/AST/ProtocolConformance.h"
2323
#include "swift/AST/TypeLoc.h"
2424
#include "swift/AST/Types.h"
25-
#include "swift/AST/InverseMarking.h"
2625
#include "swift/Subsystems.h"
2726

2827
using namespace swift;

0 commit comments

Comments
 (0)