aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2025-05-22 18:34:30 -0700
committerVolodymyr Sapsai <vsapsai@apple.com>2025-05-22 18:34:30 -0700
commit720014f70841f0284d21ef8100c406d6c864ac9c (patch)
tree1d98a5feeef7e7510941323f4dbf914af8fc99cd
parent0635ef8240ffe493169fb353fb004df2fb20353b (diff)
downloadllvm-720014f70841f0284d21ef8100c406d6c864ac9c.zip
llvm-720014f70841f0284d21ef8100c406d6c864ac9c.tar.gz
llvm-720014f70841f0284d21ef8100c406d6c864ac9c.tar.bz2
Revert "[Modules] Don't fail when an unused textual header is missing. (#138227)"
This reverts commit 64bb60a471a5ddc9c9bec413c65fdab730a1e4b0. Revert to give more time affected parties to adjust to the change.
-rw-r--r--clang/lib/Lex/ModuleMap.cpp6
-rw-r--r--clang/test/Modules/Inputs/submodules/module.modulemap4
-rw-r--r--clang/test/Modules/missing-header.m3
3 files changed, 2 insertions, 11 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 4175959..e899e0c 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -310,10 +310,8 @@ void ModuleMap::resolveHeader(Module *Mod,
} else if (Header.HasBuiltinHeader && !Header.Size && !Header.ModTime) {
// There's a builtin header but no corresponding on-disk header. Assume
// this was supposed to modularize the builtin header alone.
- } else if ((Header.Kind == Module::HK_Excluded) ||
- (Header.Kind == Module::HK_Textual)) {
- // Ignore excluded and textual header files as a module can be built with
- // such headers missing.
+ } else if (Header.Kind == Module::HK_Excluded) {
+ // Ignore missing excluded header files. They're optional anyway.
} else {
// If we find a module that has a missing header, we mark this module as
// unavailable and store the header directive for displaying diagnostics.
diff --git a/clang/test/Modules/Inputs/submodules/module.modulemap b/clang/test/Modules/Inputs/submodules/module.modulemap
index 9e8143b..1c1b76a 100644
--- a/clang/test/Modules/Inputs/submodules/module.modulemap
+++ b/clang/test/Modules/Inputs/submodules/module.modulemap
@@ -30,7 +30,3 @@ module missing_umbrella_with_inferred_submodules {
module * { export * }
export *
}
-
-module missing_textual_header {
- textual header "missing_textual.h"
-}
diff --git a/clang/test/Modules/missing-header.m b/clang/test/Modules/missing-header.m
index 84d82e5..c162e1b5 100644
--- a/clang/test/Modules/missing-header.m
+++ b/clang/test/Modules/missing-header.m
@@ -8,9 +8,6 @@
@import missing_unavailable_headers.not_missing; // OK
// CHECK-NOT: missing_unavailable_headers
-@import missing_textual_header; // OK
-// CHECK-NOT: missing_textual_header
-
@import missing_headers;
// CHECK: module.modulemap:15:27: error: header 'missing.h' not found
// CHECK: could not build module 'missing_headers'