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:
@@ -22,7 +22,6 @@
|
||||
#include "swift/SIL/SILValue.h"
|
||||
#include "swift/SIL/SILVisitor.h"
|
||||
#include "swift/Serialization/SerializedSILLoader.h"
|
||||
#include "swift/Strings.h"
|
||||
#include "llvm/ADT/FoldingSet.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
@@ -634,14 +633,10 @@ shouldSerializeEntitiesAssociatedWithDeclContext(const DeclContext *DC) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Returns true if it is the OnoneSupport module.
|
||||
bool SILModule::isOnoneSupportModule() const {
|
||||
return getSwiftModule()->getName().str() == SWIFT_ONONE_SUPPORT;
|
||||
}
|
||||
|
||||
/// Returns true if it is the optimized OnoneSupport module.
|
||||
bool SILModule::isOptimizedOnoneSupportModule() const {
|
||||
return getOptions().shouldOptimize() && isOnoneSupportModule();
|
||||
return getOptions().shouldOptimize() &&
|
||||
getSwiftModule()->isOnoneSupportModule();
|
||||
}
|
||||
|
||||
void SILModule::setSerializeSILAction(SILModule::ActionCallback Action) {
|
||||
|
||||
Reference in New Issue
Block a user