AST: Introduce ModuleDecl::isClangHeaderImportModule() convenience.

This commit is contained in:
Allan Shortlidge
2024-09-27 11:28:23 -07:00
parent a2d9808128
commit 07b84fccfb
6 changed files with 15 additions and 13 deletions

View File

@@ -2471,6 +2471,14 @@ bool ModuleDecl::getRequiredBystandersIfCrossImportOverlay(
return false;
}
bool ModuleDecl::isClangHeaderImportModule() const {
auto importer = getASTContext().getClangModuleLoader();
if (!importer)
return false;
return this == importer->getImportedHeaderModule();
}
namespace {
struct OverlayFileContents {
struct Module {