Author: Volodymyr Sapsai
Date: 2025-05-22T18:34:30-07:00
New Revision: 720014f70841f0284d21ef8100c406d6c864ac9c

URL: 
https://github.com/llvm/llvm-project/commit/720014f70841f0284d21ef8100c406d6c864ac9c
DIFF: 
https://github.com/llvm/llvm-project/commit/720014f70841f0284d21ef8100c406d6c864ac9c.diff

LOG: 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.

Added: 
    

Modified: 
    clang/lib/Lex/ModuleMap.cpp
    clang/test/Modules/Inputs/submodules/module.modulemap
    clang/test/Modules/missing-header.m

Removed: 
    


################################################################################
diff  --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 4175959d8f55b..e899e0cbc6f35 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 9e8143b8101de..1c1b76a08969e 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 84d82e5ceda32..c162e1b5f08b3 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'


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to