@@ -60,7 +60,6 @@ namespace swift {
60
60
class InfixOperatorDecl ;
61
61
class LazyResolver ;
62
62
class LinkLibrary ;
63
- class LookupCache ;
64
63
class ModuleLoader ;
65
64
class NominalTypeDecl ;
66
65
class EnumElementDecl ;
@@ -80,6 +79,7 @@ namespace swift {
80
79
class VisibleDeclConsumer ;
81
80
class SyntaxParsingCache ;
82
81
class ASTScope ;
82
+ class SourceLookupCache ;
83
83
84
84
namespace syntax {
85
85
class SourceFileSyntax ;
@@ -204,6 +204,9 @@ class ModuleDecl : public DeclContext, public TypeDecl {
204
204
205
205
SmallVector<FileUnit *, 2 > Files;
206
206
207
+ std::unique_ptr<SourceLookupCache> Cache;
208
+ SourceLookupCache &getSourceLookupCache () const ;
209
+
207
210
// / Tracks the file that will generate the module's entry point, either
208
211
// / because it contains a class marked with \@UIApplicationMain
209
212
// / or \@NSApplicationMain, or because it is a script file.
@@ -378,6 +381,12 @@ class ModuleDecl : public DeclContext, public TypeDecl {
378
381
VisibleDeclConsumer &Consumer,
379
382
NLKind LookupKind) const ;
380
383
384
+ // / This is a hack for 'main' file parsing and the integrated REPL.
385
+ // /
386
+ // / FIXME: Refactor main file parsing to not pump the parser incrementally.
387
+ // / FIXME: Remove the integrated REPL.
388
+ void clearLookupCache ();
389
+
381
390
// / @{
382
391
383
392
// / Look up the given operator in this module.
@@ -913,7 +922,6 @@ static inline unsigned alignOfFileUnit() {
913
922
// / IR generation.
914
923
class SourceFile final : public FileUnit {
915
924
public:
916
- class LookupCache ;
917
925
class Impl ;
918
926
struct SourceFileSyntaxInfo ;
919
927
@@ -962,8 +970,8 @@ class SourceFile final : public FileUnit {
962
970
};
963
971
964
972
private:
965
- std::unique_ptr<LookupCache > Cache;
966
- LookupCache &getCache () const ;
973
+ std::unique_ptr<SourceLookupCache > Cache;
974
+ SourceLookupCache &getCache () const ;
967
975
968
976
// / This is the list of modules that are imported by this module.
969
977
// /
@@ -1118,6 +1126,10 @@ class SourceFile final : public FileUnit {
1118
1126
1119
1127
bool isImportedImplementationOnly (const ModuleDecl *module ) const ;
1120
1128
1129
+ // / This is a hack for 'main' file parsing and the integrated REPL.
1130
+ // /
1131
+ // / FIXME: Refactor main file parsing to not pump the parser incrementally.
1132
+ // / FIXME: Remove the integrated REPL.
1121
1133
void clearLookupCache ();
1122
1134
1123
1135
void cacheVisibleDecls (SmallVectorImpl<ValueDecl *> &&globals) const ;
0 commit comments