Skip to content

Commit ce0083b

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents ebd20ad + 1f023c6 commit ce0083b

File tree

2 files changed

+152
-61
lines changed

2 files changed

+152
-61
lines changed

include/swift/AST/Module.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ namespace swift {
6060
class InfixOperatorDecl;
6161
class LazyResolver;
6262
class LinkLibrary;
63-
class LookupCache;
6463
class ModuleLoader;
6564
class NominalTypeDecl;
6665
class EnumElementDecl;
@@ -80,6 +79,7 @@ namespace swift {
8079
class VisibleDeclConsumer;
8180
class SyntaxParsingCache;
8281
class ASTScope;
82+
class SourceLookupCache;
8383

8484
namespace syntax {
8585
class SourceFileSyntax;
@@ -204,6 +204,9 @@ class ModuleDecl : public DeclContext, public TypeDecl {
204204

205205
SmallVector<FileUnit *, 2> Files;
206206

207+
std::unique_ptr<SourceLookupCache> Cache;
208+
SourceLookupCache &getSourceLookupCache() const;
209+
207210
/// Tracks the file that will generate the module's entry point, either
208211
/// because it contains a class marked with \@UIApplicationMain
209212
/// or \@NSApplicationMain, or because it is a script file.
@@ -378,6 +381,12 @@ class ModuleDecl : public DeclContext, public TypeDecl {
378381
VisibleDeclConsumer &Consumer,
379382
NLKind LookupKind) const;
380383

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+
381390
/// @{
382391

383392
/// Look up the given operator in this module.
@@ -913,7 +922,6 @@ static inline unsigned alignOfFileUnit() {
913922
/// IR generation.
914923
class SourceFile final : public FileUnit {
915924
public:
916-
class LookupCache;
917925
class Impl;
918926
struct SourceFileSyntaxInfo;
919927

@@ -962,8 +970,8 @@ class SourceFile final : public FileUnit {
962970
};
963971

964972
private:
965-
std::unique_ptr<LookupCache> Cache;
966-
LookupCache &getCache() const;
973+
std::unique_ptr<SourceLookupCache> Cache;
974+
SourceLookupCache &getCache() const;
967975

968976
/// This is the list of modules that are imported by this module.
969977
///
@@ -1118,6 +1126,10 @@ class SourceFile final : public FileUnit {
11181126

11191127
bool isImportedImplementationOnly(const ModuleDecl *module) const;
11201128

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.
11211133
void clearLookupCache();
11221134

11231135
void cacheVisibleDecls(SmallVectorImpl<ValueDecl *> &&globals) const;

0 commit comments

Comments
 (0)