Merge pull request #38615 from apple/extract-rename-decl

[NFC] Refactor `getRenameDecl` to use the request evaluator
This commit is contained in:
Ben Barham
2021-07-27 09:51:17 +10:00
committed by GitHub
14 changed files with 185 additions and 139 deletions

View File

@@ -2126,30 +2126,3 @@ CompilerInvocation::setUpInputForSILTool(
}
return fileBufOrErr;
}
bool CompilerInvocation::isModuleExternallyConsumed(
const ModuleDecl *mod) const {
// Modules for executables aren't expected to be consumed by other modules.
// This picks up all kinds of entrypoints, including script mode,
// @UIApplicationMain and @NSApplicationMain.
if (mod->hasEntryPoint()) {
return false;
}
// If an implicit Objective-C header was needed to construct this module, it
// must be the product of a library target.
if (!getFrontendOptions().ImplicitObjCHeaderPath.empty()) {
return false;
}
// App extensions are special beasts because they build without entrypoints
// like library targets, but they behave like executable targets because
// their associated modules are not suitable for distribution.
if (mod->getASTContext().LangOpts.EnableAppExtensionRestrictions) {
return false;
}
// FIXME: This is still a lousy approximation of whether the module file will
// be externally consumed.
return true;
}