mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add predicates to check if a SILModule is representing the (optimized) OnoneSupport
It is cleaner to use these predicates rather than checking for a complex condition in different places.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "swift/SIL/FormalLinkage.h"
|
||||
#include "swift/SIL/SILDebugScope.h"
|
||||
#include "swift/SIL/SILModule.h"
|
||||
#include "swift/Strings.h"
|
||||
#include "Linker.h"
|
||||
#include "swift/SIL/SILVisitor.h"
|
||||
#include "swift/SIL/SILValue.h"
|
||||
@@ -750,3 +751,14 @@ bool SILModule::isNoReturnBuiltinOrIntrinsic(Identifier Name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// 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().Optimization >= SILOptions::SILOptMode::Optimize &&
|
||||
isOnoneSupportModule();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user