mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Dependency Scanning] Keep track of whether a given Swift 'import' statement is '@_exported'
This commit is contained in:
@@ -154,12 +154,14 @@ struct ScannerImportStatementInfo {
|
||||
uint32_t columnNumber;
|
||||
};
|
||||
|
||||
ScannerImportStatementInfo(std::string importIdentifier)
|
||||
: importLocations(), importIdentifier(importIdentifier) {}
|
||||
ScannerImportStatementInfo(std::string importIdentifier, bool isExported)
|
||||
: importLocations(), importIdentifier(importIdentifier),
|
||||
isExported(isExported) {}
|
||||
|
||||
ScannerImportStatementInfo(std::string importIdentifier,
|
||||
ScannerImportStatementInfo(std::string importIdentifier, bool isExported,
|
||||
ImportDiagnosticLocationInfo location)
|
||||
: importLocations({location}), importIdentifier(importIdentifier) {}
|
||||
: importLocations({location}), importIdentifier(importIdentifier),
|
||||
isExported(isExported) {}
|
||||
|
||||
void addImportLocation(ImportDiagnosticLocationInfo location) {
|
||||
importLocations.push_back(location);
|
||||
@@ -169,6 +171,8 @@ struct ScannerImportStatementInfo {
|
||||
SmallVector<ImportDiagnosticLocationInfo, 4> importLocations;
|
||||
/// Imported module string. e.g. "Foo.Bar" in 'import Foo.Bar'
|
||||
std::string importIdentifier;
|
||||
/// Is this an @_exported import
|
||||
bool isExported;
|
||||
};
|
||||
|
||||
/// Base class for the variant storage of ModuleDependencyInfo.
|
||||
@@ -927,7 +931,7 @@ public:
|
||||
|
||||
/// Add a dependency on the given module, if it was not already in the set.
|
||||
void
|
||||
addOptionalModuleImport(StringRef module,
|
||||
addOptionalModuleImport(StringRef module, bool isExported,
|
||||
llvm::StringSet<> *alreadyAddedModules = nullptr);
|
||||
|
||||
/// Add all of the module imports in the given source
|
||||
@@ -937,13 +941,13 @@ public:
|
||||
const SourceManager *sourceManager);
|
||||
|
||||
/// Add a dependency on the given module, if it was not already in the set.
|
||||
void addModuleImport(ImportPath::Module module,
|
||||
void addModuleImport(ImportPath::Module module, bool isExported,
|
||||
llvm::StringSet<> *alreadyAddedModules = nullptr,
|
||||
const SourceManager *sourceManager = nullptr,
|
||||
SourceLoc sourceLocation = SourceLoc());
|
||||
|
||||
/// Add a dependency on the given module, if it was not already in the set.
|
||||
void addModuleImport(StringRef module,
|
||||
void addModuleImport(StringRef module, bool isExported,
|
||||
llvm::StringSet<> *alreadyAddedModules = nullptr,
|
||||
const SourceManager *sourceManager = nullptr,
|
||||
SourceLoc sourceLocation = SourceLoc());
|
||||
|
||||
Reference in New Issue
Block a user