Skip to content

Commit 720014f

Browse files
committed
Revert "[Modules] Don't fail when an unused textual header is missing. (#138227)"
This reverts commit 64bb60a. Revert to give more time affected parties to adjust to the change.
1 parent 0635ef8 commit 720014f

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

clang/lib/Lex/ModuleMap.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,8 @@ void ModuleMap::resolveHeader(Module *Mod,
310310
} else if (Header.HasBuiltinHeader && !Header.Size && !Header.ModTime) {
311311
// There's a builtin header but no corresponding on-disk header. Assume
312312
// this was supposed to modularize the builtin header alone.
313-
} else if ((Header.Kind == Module::HK_Excluded) ||
314-
(Header.Kind == Module::HK_Textual)) {
315-
// Ignore excluded and textual header files as a module can be built with
316-
// such headers missing.
313+
} else if (Header.Kind == Module::HK_Excluded) {
314+
// Ignore missing excluded header files. They're optional anyway.
317315
} else {
318316
// If we find a module that has a missing header, we mark this module as
319317
// unavailable and store the header directive for displaying diagnostics.

clang/test/Modules/Inputs/submodules/module.modulemap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,3 @@ module missing_umbrella_with_inferred_submodules {
3030
module * { export * }
3131
export *
3232
}
33-
34-
module missing_textual_header {
35-
textual header "missing_textual.h"
36-
}

clang/test/Modules/missing-header.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
@import missing_unavailable_headers.not_missing; // OK
99
// CHECK-NOT: missing_unavailable_headers
1010

11-
@import missing_textual_header; // OK
12-
// CHECK-NOT: missing_textual_header
13-
1411
@import missing_headers;
1512
// CHECK: module.modulemap:15:27: error: header 'missing.h' not found
1613
// CHECK: could not build module 'missing_headers'

0 commit comments

Comments
 (0)