@@ -573,18 +573,6 @@ CheckRedeclarationRequest::evaluate(Evaluator &eval, ValueDecl *current) const {
573573 &wouldBeSwift5Redeclaration);
574574 // If there is another conflict, complain.
575575 if (isRedeclaration || wouldBeSwift5Redeclaration) {
576- // If the two declarations occur in the same source file, make sure
577- // we get the diagnostic ordering to be sensible.
578- if (auto otherFile = other->getDeclContext ()->getParentSourceFile ()) {
579- if (currentFile == otherFile &&
580- current->getLoc ().isValid () &&
581- other->getLoc ().isValid () &&
582- ctx.SourceMgr .isBeforeInBuffer (current->getLoc (),
583- other->getLoc ())) {
584- std::swap (current, other);
585- }
586- }
587-
588576 // If we're currently looking at a .sil and the conflicting declaration
589577 // comes from a .sib, don't error since we won't be considering the sil
590578 // from the .sib. So it's fine for the .sil to shadow it, since that's the
@@ -798,11 +786,6 @@ CheckRedeclarationRequest::evaluate(Evaluator &eval, ValueDecl *current) const {
798786 }
799787 }
800788
801- // Make sure we don't do this checking again for the same decl. We also
802- // set this at the beginning of the function, but we might have swapped
803- // the decls for diagnostics; so ensure we also set this for the actual
804- // decl we diagnosed on.
805- current->setCheckedRedeclaration ();
806789 break ;
807790 }
808791 }
0 commit comments