mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add ModuleDecl::isOnoneSupportModule, and use it
A few places around the compiler were checking for this module by its name. The implementation still checks by name, but at least that only has to occur in one place. (Unfortunately I can't eliminate the string constant altogether, because the implicit import for SwiftOnoneSupport happens by name.) No functionality change.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "swift/Basic/SourceManager.h"
|
||||
#include "swift/Basic/Statistic.h"
|
||||
#include "swift/Parse/Token.h"
|
||||
#include "swift/Strings.h"
|
||||
#include "swift/Syntax/SyntaxNodes.h"
|
||||
#include "clang/Basic/Module.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
@@ -1034,6 +1035,10 @@ bool ModuleDecl::isSwiftShimsModule() const {
|
||||
return !getParent() && getName() == getASTContext().SwiftShimsModuleName;
|
||||
}
|
||||
|
||||
bool ModuleDecl::isOnoneSupportModule() const {
|
||||
return !getParent() && getName().str() == SWIFT_ONONE_SUPPORT;
|
||||
}
|
||||
|
||||
bool ModuleDecl::isBuiltinModule() const {
|
||||
return this == getASTContext().TheBuiltinModule;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user