Skip to content

Commit e44c11f

Browse files
committed
[Macros] Remove the ExpandConformanceMacros request.
1 parent c3e214c commit e44c11f

File tree

4 files changed

+0
-56
lines changed

4 files changed

+0
-56
lines changed

include/swift/AST/TypeCheckRequests.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,28 +4031,6 @@ class ExpandAccessorMacros
40314031
void noteCycleStep(DiagnosticEngine &diags) const;
40324032
};
40334033

4034-
/// Expand all conformance macros attached to the given declaration.
4035-
///
4036-
/// Produces the set of macro expansion buffer IDs.
4037-
class ExpandConformanceMacros
4038-
: public SimpleRequest<ExpandConformanceMacros,
4039-
ArrayRef<unsigned>(NominalTypeDecl *),
4040-
RequestFlags::Cached> {
4041-
public:
4042-
using SimpleRequest::SimpleRequest;
4043-
4044-
private:
4045-
friend SimpleRequest;
4046-
4047-
ArrayRef<unsigned> evaluate(Evaluator &evaluator,
4048-
NominalTypeDecl *nominal) const;
4049-
4050-
public:
4051-
bool isCached() const { return true; }
4052-
void diagnoseCycle(DiagnosticEngine &diags) const;
4053-
void noteCycleStep(DiagnosticEngine &diags) const;
4054-
};
4055-
40564034
/// Expand all extension macros attached to the given declaration.
40574035
///
40584036
/// Produces the set of macro expansion buffer IDs.

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,6 @@ SWIFT_REQUEST(TypeChecker, ExpandMemberAttributeMacros,
457457
SWIFT_REQUEST(TypeChecker, ExpandAccessorMacros,
458458
ArrayRef<unsigned>(AbstractStorageDecl *),
459459
Cached, NoLocationInfo)
460-
SWIFT_REQUEST(TypeChecker, ExpandConformanceMacros,
461-
ArrayRef<unsigned>(NominalTypeDecl *),
462-
Cached, NoLocationInfo)
463460
SWIFT_REQUEST(TypeChecker, ExpandExtensionMacros,
464461
ArrayRef<unsigned>(NominalTypeDecl *),
465462
Cached, NoLocationInfo)

lib/AST/TypeCheckRequests.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,22 +1857,6 @@ void ExpandAccessorMacros::noteCycleStep(DiagnosticEngine &diags) const {
18571857
decl->getName());
18581858
}
18591859

1860-
void ExpandConformanceMacros::diagnoseCycle(DiagnosticEngine &diags) const {
1861-
auto decl = std::get<0>(getStorage());
1862-
diags.diagnose(decl->getLoc(),
1863-
diag::macro_expand_circular_reference_entity,
1864-
"conformance",
1865-
decl->getName());
1866-
}
1867-
1868-
void ExpandConformanceMacros::noteCycleStep(DiagnosticEngine &diags) const {
1869-
auto decl = std::get<0>(getStorage());
1870-
diags.diagnose(decl->getLoc(),
1871-
diag::macro_expand_circular_reference_entity_through,
1872-
"conformance",
1873-
decl->getName());
1874-
}
1875-
18761860
void ExpandExtensionMacros::diagnoseCycle(DiagnosticEngine &diags) const {
18771861
auto decl = std::get<0>(getStorage());
18781862
diags.diagnose(decl->getLoc(),

lib/Sema/TypeCheckMacros.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,21 +1456,6 @@ llvm::Optional<unsigned> swift::expandPeers(CustomAttr *attr, MacroDecl *macro,
14561456
return macroSourceFile->getBufferID();
14571457
}
14581458

1459-
ArrayRef<unsigned>
1460-
ExpandConformanceMacros::evaluate(Evaluator &evaluator,
1461-
NominalTypeDecl *nominal) const {
1462-
SmallVector<unsigned, 2> bufferIDs;
1463-
nominal->forEachAttachedMacro(MacroRole::Conformance,
1464-
[&](CustomAttr *attr, MacroDecl *macro) {
1465-
if (auto bufferID = expandExtensions(attr, macro,
1466-
MacroRole::Conformance,
1467-
nominal))
1468-
bufferIDs.push_back(*bufferID);
1469-
});
1470-
1471-
return nominal->getASTContext().AllocateCopy(bufferIDs);
1472-
}
1473-
14741459
ArrayRef<unsigned>
14751460
ExpandExtensionMacros::evaluate(Evaluator &evaluator,
14761461
NominalTypeDecl *nominal) const {

0 commit comments

Comments
 (0)