mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Remove some unnecessary calls to setGenericSignature()
This commit is contained in:
@@ -3876,9 +3876,6 @@ GetDestructorRequest::evaluate(Evaluator &evaluator, ClassDecl *CD) const {
|
||||
// Propagate access control and versioned-ness.
|
||||
DD->copyFormalAccessFrom(CD, /*sourceIsParentContext*/true);
|
||||
|
||||
// Wire up generic environment of DD.
|
||||
DD->setGenericSignature(CD->getGenericSignatureOfContext());
|
||||
|
||||
// Mark DD as ObjC, as all dtors are.
|
||||
DD->setIsObjC(ctx.LangOpts.EnableObjCInterop);
|
||||
if (ctx.LangOpts.EnableObjCInterop)
|
||||
|
||||
@@ -1715,7 +1715,6 @@ buildSubscriptGetterDecl(ClangImporter::Implementation &Impl,
|
||||
TypeLoc::withoutLoc(elementTy), dc,
|
||||
getter->getClangNode());
|
||||
|
||||
thunk->setGenericSignature(dc->getGenericSignatureOfContext());
|
||||
thunk->computeType();
|
||||
|
||||
thunk->setAccess(getOverridableAccessLevel(dc));
|
||||
@@ -1769,7 +1768,6 @@ buildSubscriptSetterDecl(ClangImporter::Implementation &Impl,
|
||||
valueIndicesPL,
|
||||
TypeLoc::withoutLoc(TupleType::getEmpty(C)), dc,
|
||||
setter->getClangNode());
|
||||
thunk->setGenericSignature(dc->getGenericSignatureOfContext());
|
||||
thunk->computeType();
|
||||
|
||||
thunk->setAccess(getOverridableAccessLevel(dc));
|
||||
@@ -3735,8 +3733,6 @@ namespace {
|
||||
nameLoc, bodyParams, resultTy,
|
||||
/*throws*/ false, dc, decl);
|
||||
|
||||
result->setGenericSignature(dc->getGenericSignatureOfContext());
|
||||
|
||||
if (!dc->isModuleScopeContext()) {
|
||||
if (selfIsInOut)
|
||||
result->setSelfAccessKind(SelfAccessKind::Mutating);
|
||||
@@ -4324,8 +4320,6 @@ namespace {
|
||||
// Record the return type.
|
||||
result->getBodyResultTypeLoc().setType(resultTy);
|
||||
|
||||
result->setGenericSignature(dc->getGenericSignatureOfContext());
|
||||
|
||||
// Optional methods in protocols.
|
||||
if (decl->getImplementationControl() == clang::ObjCMethodDecl::Optional &&
|
||||
isa<ProtocolDecl>(dc))
|
||||
@@ -6331,7 +6325,6 @@ ConstructorDecl *SwiftDeclConverter::importConstructor(
|
||||
addObjCAttribute(result, selector);
|
||||
|
||||
// Calculate the function type of the result.
|
||||
result->setGenericSignature(dc->getGenericSignatureOfContext());
|
||||
result->computeType();
|
||||
|
||||
Impl.recordImplicitUnwrapForDecl(result,
|
||||
@@ -6762,8 +6755,6 @@ SwiftDeclConverter::importSubscript(Decl *decl,
|
||||
if (setterObjCMethod)
|
||||
Impl.importAttributes(setterObjCMethod, setterThunk);
|
||||
|
||||
subscript->setGenericSignature(dc->getGenericSignatureOfContext());
|
||||
|
||||
subscript->setIsSetterMutating(false);
|
||||
makeComputed(subscript, getterThunk, setterThunk);
|
||||
subscript->computeType();
|
||||
|
||||
@@ -750,7 +750,6 @@ static FuncDecl *deriveEncodable_encode(DerivedConformance &derived) {
|
||||
encodeDecl->getAttrs().add(attr);
|
||||
}
|
||||
|
||||
encodeDecl->setGenericSignature(conformanceDC->getGenericSignatureOfContext());
|
||||
encodeDecl->computeType(FunctionType::ExtInfo().withThrows());
|
||||
|
||||
encodeDecl->copyFormalAccessFrom(derived.Nominal,
|
||||
@@ -1031,7 +1030,6 @@ static ValueDecl *deriveDecodable_init(DerivedConformance &derived) {
|
||||
initDecl->getAttrs().add(reqAttr);
|
||||
}
|
||||
|
||||
initDecl->setGenericSignature(conformanceDC->getGenericSignatureOfContext());
|
||||
initDecl->computeType(AnyFunctionType::ExtInfo().withThrows());
|
||||
|
||||
initDecl->copyFormalAccessFrom(derived.Nominal,
|
||||
|
||||
@@ -144,7 +144,6 @@ static ValueDecl *deriveInitDecl(DerivedConformance &derived, Type paramType,
|
||||
synthesizer(initDecl);
|
||||
|
||||
// Compute the interface type of the initializer.
|
||||
initDecl->setGenericSignature(parentDC->getGenericSignatureOfContext());
|
||||
initDecl->computeType();
|
||||
|
||||
initDecl->setAccess(derived.Nominal->getFormalAccess());
|
||||
|
||||
@@ -765,7 +765,6 @@ deriveEquatable_eq(
|
||||
eqDecl->setBodySynthesizer(bodySynthesizer);
|
||||
|
||||
// Compute the interface type.
|
||||
eqDecl->setGenericSignature(parentDC->getGenericSignatureOfContext());
|
||||
eqDecl->computeType();
|
||||
|
||||
eqDecl->copyFormalAccessFrom(derived.Nominal, /*sourceIsParentContext*/ true);
|
||||
@@ -890,7 +889,6 @@ deriveHashable_hashInto(
|
||||
hashDecl->setImplicit();
|
||||
hashDecl->setBodySynthesizer(bodySynthesizer);
|
||||
|
||||
hashDecl->setGenericSignature(parentDC->getGenericSignatureOfContext());
|
||||
hashDecl->computeType();
|
||||
hashDecl->copyFormalAccessFrom(derived.Nominal);
|
||||
|
||||
@@ -1240,7 +1238,6 @@ static ValueDecl *deriveHashable_hashValue(DerivedConformance &derived) {
|
||||
getterDecl->setIsTransparent(false);
|
||||
|
||||
// Compute the interface type of hashValue().
|
||||
getterDecl->setGenericSignature(parentDC->getGenericSignatureOfContext());
|
||||
getterDecl->computeType();
|
||||
|
||||
getterDecl->copyFormalAccessFrom(derived.Nominal,
|
||||
|
||||
@@ -430,7 +430,6 @@ deriveRawRepresentable_init(DerivedConformance &derived) {
|
||||
initDecl->setBodySynthesizer(&deriveBodyRawRepresentable_init);
|
||||
|
||||
// Compute the interface type of the initializer.
|
||||
initDecl->setGenericSignature(parentDC->getGenericSignatureOfContext());
|
||||
initDecl->computeType();
|
||||
|
||||
initDecl->copyFormalAccessFrom(enumDecl, /*sourceIsParentContext*/true);
|
||||
|
||||
@@ -309,7 +309,6 @@ DerivedConformance::declareDerivedPropertyGetter(VarDecl *property,
|
||||
getterDecl->setIsTransparent(false);
|
||||
|
||||
// Compute the interface type of the getter.
|
||||
getterDecl->setGenericSignature(parentDC->getGenericSignatureOfContext());
|
||||
getterDecl->computeType();
|
||||
|
||||
getterDecl->copyFormalAccessFrom(property);
|
||||
|
||||
@@ -2470,7 +2470,6 @@ void ConformanceChecker::recordTypeWitness(AssociatedTypeDecl *assocType,
|
||||
SourceLoc(),
|
||||
/*genericparams*/nullptr,
|
||||
DC);
|
||||
aliasDecl->setGenericSignature(DC->getGenericSignatureOfContext());
|
||||
aliasDecl->setUnderlyingType(type);
|
||||
aliasDecl->computeType();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user