From fbc93480ce71dede248e5334cee7c5658354d2be Mon Sep 17 00:00:00 2001 From: Ian Anderson Date: Fri, 20 Oct 2023 13:23:34 -0700 Subject: [PATCH] [Modules] textual headers in submodules never resolve their `use`s When an include from a textual header is resolved, the textual header's submodule is used as the requesting module. The submodule's uses are resolved, but that doesn't work because only top level modules have uses, and only the top level module uses are used for checking uses in Module::directlyUses. ModuleMap::resolveUses to resolve the top level module instead of the submodule. --- This fixes the build of std.pcm with MacOSX15.0.sdk. --- .../llvm-project/clang/lib/Lex/ModuleMap.cpp | 13 +++++++------ interpreter/llvm-project/llvm-project.tag | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/interpreter/llvm-project/clang/lib/Lex/ModuleMap.cpp b/interpreter/llvm-project/clang/lib/Lex/ModuleMap.cpp index 5474583a26938..52dcd3abd1c81 100644 --- a/interpreter/llvm-project/clang/lib/Lex/ModuleMap.cpp +++ b/interpreter/llvm-project/clang/lib/Lex/ModuleMap.cpp @@ -1370,16 +1370,17 @@ bool ModuleMap::resolveExports(Module *Mod, bool Complain) { } bool ModuleMap::resolveUses(Module *Mod, bool Complain) { - auto Unresolved = std::move(Mod->UnresolvedDirectUses); - Mod->UnresolvedDirectUses.clear(); + auto *Top = Mod->getTopLevelModule(); + auto Unresolved = std::move(Top->UnresolvedDirectUses); + Top->UnresolvedDirectUses.clear(); for (auto &UDU : Unresolved) { - Module *DirectUse = resolveModuleId(UDU, Mod, Complain); + Module *DirectUse = resolveModuleId(UDU, Top, Complain); if (DirectUse) - Mod->DirectUses.push_back(DirectUse); + Top->DirectUses.push_back(DirectUse); else - Mod->UnresolvedDirectUses.push_back(UDU); + Top->UnresolvedDirectUses.push_back(UDU); } - return !Mod->UnresolvedDirectUses.empty(); + return !Top->UnresolvedDirectUses.empty(); } bool ModuleMap::resolveConflicts(Module *Mod, bool Complain) { diff --git a/interpreter/llvm-project/llvm-project.tag b/interpreter/llvm-project/llvm-project.tag index 6043a0be2bc05..9d3b9b7924d1b 100644 --- a/interpreter/llvm-project/llvm-project.tag +++ b/interpreter/llvm-project/llvm-project.tag @@ -1 +1 @@ -ROOT-llvm16-20240614-01 +ROOT-llvm16-20240621-01