@@ -156,30 +156,35 @@ struct ScannerImportStatementInfo {
156
156
uint32_t columnNumber;
157
157
};
158
158
159
- ScannerImportStatementInfo (std::string importIdentifier, bool isExported)
160
- : importLocations(), importIdentifier(importIdentifier),
161
- isExported(isExported) {}
159
+ ScannerImportStatementInfo (std::string importIdentifier, bool isExported,
160
+ AccessLevel accessLevel)
161
+ : importIdentifier(importIdentifier), importLocations(),
162
+ isExported(isExported), accessLevel(accessLevel) {}
162
163
163
164
ScannerImportStatementInfo (std::string importIdentifier, bool isExported,
165
+ AccessLevel accessLevel,
164
166
ImportDiagnosticLocationInfo location)
165
- : importLocations({location} ), importIdentifier(importIdentifier ),
166
- isExported(isExported) {}
167
+ : importIdentifier(importIdentifier ), importLocations({location} ),
168
+ isExported(isExported), accessLevel(accessLevel) {}
167
169
168
170
ScannerImportStatementInfo (std::string importIdentifier, bool isExported,
171
+ AccessLevel accessLevel,
169
172
SmallVector<ImportDiagnosticLocationInfo, 4 > locations)
170
- : importLocations(locations ), importIdentifier(importIdentifier ),
171
- isExported(isExported) {}
173
+ : importIdentifier(importIdentifier ), importLocations(locations ),
174
+ isExported(isExported), accessLevel(accessLevel) {}
172
175
173
176
void addImportLocation (ImportDiagnosticLocationInfo location) {
174
177
importLocations.push_back (location);
175
178
}
176
179
177
- // / Buffer, line & column number of the import statement
178
- SmallVector<ImportDiagnosticLocationInfo, 4 > importLocations;
179
180
// / Imported module string. e.g. "Foo.Bar" in 'import Foo.Bar'
180
181
std::string importIdentifier;
182
+ // / Buffer, line & column number of the import statement
183
+ SmallVector<ImportDiagnosticLocationInfo, 4 > importLocations;
181
184
// / Is this an @_exported import
182
185
bool isExported;
186
+ // / Access level of this dependency
187
+ AccessLevel accessLevel;
183
188
};
184
189
185
190
// / Base class for the variant storage of ModuleDependencyInfo.
@@ -942,6 +947,7 @@ class ModuleDependencyInfo {
942
947
// / Add a dependency on the given module, if it was not already in the set.
943
948
void
944
949
addOptionalModuleImport (StringRef module , bool isExported,
950
+ AccessLevel accessLevel,
945
951
llvm::StringSet<> *alreadyAddedModules = nullptr );
946
952
947
953
// / Add all of the module imports in the given source
@@ -952,12 +958,14 @@ class ModuleDependencyInfo {
952
958
953
959
// / Add a dependency on the given module, if it was not already in the set.
954
960
void addModuleImport (ImportPath::Module module , bool isExported,
961
+ AccessLevel accessLevel,
955
962
llvm::StringSet<> *alreadyAddedModules = nullptr ,
956
963
const SourceManager *sourceManager = nullptr ,
957
964
SourceLoc sourceLocation = SourceLoc());
958
965
959
966
// / Add a dependency on the given module, if it was not already in the set.
960
967
void addModuleImport (StringRef module , bool isExported,
968
+ AccessLevel accessLevel,
961
969
llvm::StringSet<> *alreadyAddedModules = nullptr ,
962
970
const SourceManager *sourceManager = nullptr ,
963
971
SourceLoc sourceLocation = SourceLoc());
0 commit comments