Skip to content

Commit acbf927

Browse files
committed
[NFC] Delete ReferencedNameTracker
1 parent 537c386 commit acbf927

14 files changed

+22
-280
lines changed

include/swift/AST/Module.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "swift/AST/Identifier.h"
2323
#include "swift/AST/LookupKinds.h"
2424
#include "swift/AST/RawComment.h"
25-
#include "swift/AST/ReferencedNameTracker.h"
2625
#include "swift/AST/Type.h"
2726
#include "swift/Basic/Compiler.h"
2827
#include "swift/Basic/OptionSet.h"
@@ -69,7 +68,6 @@ namespace swift {
6968
class ProtocolConformance;
7069
class ProtocolDecl;
7170
struct PrintOptions;
72-
class ReferencedNameTracker;
7371
class Token;
7472
class TupleType;
7573
class Type;

include/swift/AST/ReferencedNameTracker.h

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

include/swift/AST/SourceFile.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ class SourceFile final : public FileUnit {
137137
/// This is set during type checking.
138138
TypeRefinementContext *TRC = nullptr;
139139

140-
/// If non-null, used to track name lookups that happen within this file.
141-
Optional<ReferencedNameTracker> RequestReferencedNames;
142-
143140
/// Either the class marked \@NS/UIApplicationMain or the synthesized FuncDecl
144141
/// that calls main on the type marked @main.
145142
Decl *MainDecl = nullptr;
@@ -439,25 +436,6 @@ class SourceFile final : public FileUnit {
439436

440437
virtual bool walk(ASTWalker &walker) override;
441438

442-
ReferencedNameTracker *getRequestBasedReferencedNameTracker() {
443-
return RequestReferencedNames ? RequestReferencedNames.getPointer() : nullptr;
444-
}
445-
const ReferencedNameTracker *getRequestBasedReferencedNameTracker() const {
446-
return RequestReferencedNames ? RequestReferencedNames.getPointer() : nullptr;
447-
}
448-
449-
/// Creates and installs the referenced name trackers in this source file.
450-
///
451-
/// This entrypoint must be called before incremental compilation can proceed,
452-
/// else reference dependencies will not be registered.
453-
void createReferencedNameTracker();
454-
455-
/// Retrieves the appropriate referenced name tracker instance.
456-
///
457-
/// If incremental dependencies tracking is not enabled or \c createReferencedNameTracker()
458-
/// has not been invoked on this source file, the result is \c nullptr.
459-
const ReferencedNameTracker *getConfiguredReferencedNameTracker() const;
460-
461439
/// The buffer ID for the file that was imported, or None if there
462440
/// is no associated buffer.
463441
Optional<unsigned> getBufferID() const {

include/swift/Frontend/DiagnosticVerifier.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ class SourceFile;
3030

3131
// MARK: - DependencyVerifier
3232

33-
bool verifyDependencies(SourceManager &SM, const DependencyTracker &DT,
34-
ArrayRef<FileUnit *> SFs);
35-
bool verifyDependencies(SourceManager &SM, const DependencyTracker &DT,
36-
ArrayRef<SourceFile *> SFs);
33+
bool verifyDependencies(SourceManager &SM, ArrayRef<FileUnit *> SFs);
34+
bool verifyDependencies(SourceManager &SM, ArrayRef<SourceFile *> SFs);
3735

3836
// MARK: - DiagnosticVerifier
3937
struct ExpectedFixIt;

lib/AST/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ add_swift_host_library(swiftAST STATIC
6767
PrettyStackTrace.cpp
6868
ProtocolConformance.cpp
6969
RawComment.cpp
70-
ReferencedNameTracker.cpp
7170
RequirementEnvironment.cpp
7271
SyntaxASTMap.cpp
7372
SILLayout.cpp

lib/AST/Module.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "swift/AST/PrettyStackTrace.h"
3737
#include "swift/AST/PrintOptions.h"
3838
#include "swift/AST/ProtocolConformance.h"
39-
#include "swift/AST/ReferencedNameTracker.h"
4039
#include "swift/AST/SourceFile.h"
4140
#include "swift/AST/SynthesizedFileUnit.h"
4241
#include "swift/AST/TypeCheckRequests.h"
@@ -2638,16 +2637,6 @@ void SourceFile::setTypeRefinementContext(TypeRefinementContext *Root) {
26382637
TRC = Root;
26392638
}
26402639

2641-
void SourceFile::createReferencedNameTracker() {
2642-
assert(!RequestReferencedNames && "This file already has a name tracker.");
2643-
RequestReferencedNames.emplace(ReferencedNameTracker());
2644-
}
2645-
2646-
const ReferencedNameTracker *
2647-
SourceFile::getConfiguredReferencedNameTracker() const {
2648-
return getRequestBasedReferencedNameTracker();
2649-
}
2650-
26512640
ArrayRef<OpaqueTypeDecl *> SourceFile::getOpaqueReturnTypeDecls() {
26522641
for (auto *vd : UnvalidatedDeclsWithOpaqueReturnTypes.takeVector()) {
26532642
if (auto opaqueDecl = vd->getOpaqueResultTypeDecl()) {

lib/AST/NameLookup.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "swift/AST/ModuleNameLookup.h"
2828
#include "swift/AST/NameLookupRequests.h"
2929
#include "swift/AST/ParameterList.h"
30-
#include "swift/AST/ReferencedNameTracker.h"
3130
#include "swift/AST/SourceFile.h"
3231
#include "swift/Basic/Debug.h"
3332
#include "swift/Basic/SourceManager.h"

lib/AST/ReferencedNameTracker.cpp

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

lib/AST/UnqualifiedLookup.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "swift/AST/NameLookup.h"
2828
#include "swift/AST/NameLookupRequests.h"
2929
#include "swift/AST/ParameterList.h"
30-
#include "swift/AST/ReferencedNameTracker.h"
3130
#include "swift/AST/SourceFile.h"
3231
#include "swift/Basic/Debug.h"
3332
#include "swift/Basic/STLExtras.h"

lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,6 @@ SourceFile *CompilerInstance::createSourceFileForMainModule(
893893
if (isPrimary) {
894894
PrimarySourceFiles.push_back(inputFile);
895895
inputFile->enableInterfaceHash();
896-
inputFile->createReferencedNameTracker();
897896
}
898897

899898
if (bufferID == SourceMgr.getCodeCompletionBufferID()) {

0 commit comments

Comments
 (0)