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:
Roman Levenstein
2017-09-29 10:59:06 -07:00
parent a8083a08eb
commit fb0761d97a
4 changed files with 20 additions and 4 deletions

View File

@@ -2440,8 +2440,7 @@ static bool linkSpecialization(SILModule &M, SILFunction *F) {
// Do not remove functions that are known prespecializations.
// Keep them around. Change their linkage to public, so that other
// applications can refer to them.
if (M.getOptions().Optimization >= SILOptions::SILOptMode::Optimize &&
F->getModule().getSwiftModule()->getName().str() == SWIFT_ONONE_SUPPORT) {
if (M.isOptimizedOnoneSupportModule()) {
if (isKnownPrespecialization(F->getName())) {
keepSpecializationAsPublic(F);
return true;