mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #29741 from hamishknight/moving-states
Move PersistentParserState onto SourceFile
This commit is contained in:
@@ -400,8 +400,6 @@ class CompilerInstance {
|
||||
std::unique_ptr<Lowering::TypeConverter> TheSILTypes;
|
||||
std::unique_ptr<SILModule> TheSILModule;
|
||||
|
||||
std::unique_ptr<PersistentParserState> PersistentState;
|
||||
|
||||
/// Null if no tracker.
|
||||
std::unique_ptr<DependencyTracker> DepTracker;
|
||||
/// If there is no stats output directory by the time the
|
||||
@@ -431,6 +429,9 @@ class CompilerInstance {
|
||||
/// buffer will also have its buffer ID in PrimaryBufferIDs.
|
||||
std::vector<SourceFile *> PrimarySourceFiles;
|
||||
|
||||
/// The file that has been registered for code completion.
|
||||
NullablePtr<SourceFile> CodeCompletionFile;
|
||||
|
||||
/// Return whether there is an entry in PrimaryInputs for buffer \p BufID.
|
||||
bool isPrimaryInput(unsigned BufID) const {
|
||||
return PrimaryBufferIDs.count(BufID) != 0;
|
||||
@@ -550,12 +551,13 @@ public:
|
||||
return Invocation;
|
||||
}
|
||||
|
||||
bool hasPersistentParserState() const {
|
||||
return bool(PersistentState);
|
||||
}
|
||||
/// If a code completion buffer has been set, returns the corresponding source
|
||||
/// file.
|
||||
NullablePtr<SourceFile> getCodeCompletionFile() { return CodeCompletionFile; }
|
||||
|
||||
PersistentParserState &getPersistentParserState() {
|
||||
return *PersistentState.get();
|
||||
/// Set a new file that we're performing code completion on.
|
||||
void setCodeCompletionFile(SourceFile *file) {
|
||||
CodeCompletionFile = file;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user