From 52626915c1453594f11c08ab0f97cf75c36b935f Mon Sep 17 00:00:00 2001 From: Ian Anderson Date: Sun, 10 Dec 2023 22:39:58 -0800 Subject: [PATCH] [Modules] Allow any client to use the upcoming new clang modules In order to ease adoption of the new clang modules, allow them before they're actually introduced. rdar://105819340 --- clang/lib/Basic/Module.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 19d965ec6d2a2..6a6c1d2414ce1 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -305,8 +305,11 @@ bool Module::directlyUses(const Module *Requested) { if (Requested->isSubModuleOf(Use)) return true; - // Anyone is allowed to use our builtin stddef.h and its accompanying module. - if (!Requested->Parent && Requested->Name == "_Builtin_stddef_max_align_t") + // Anyone is allowed to use our builtin stdarg.h and stddef.h and their + // accompanying modules. + if (Requested->getTopLevelModuleName() == "_Builtin_stdarg" || + Requested->getTopLevelModuleName() == "_Builtin_stddef" || + (!Requested->Parent && Requested->Name == "_Builtin_stddef_max_align_t")) return true; if (NoUndeclaredIncludes)