Skip to content

Commit 7d94ea7

Browse files
committed
Update other places where the builtin header needs to be mentioned
1 parent 10cb78b commit 7d94ea7

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

clang/lib/Headers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set(core_files
1818
__stdarg_va_list.h
1919
stdatomic.h
2020
stdbool.h
21+
stdcountof.h
2122
stdckdint.h
2223
stddef.h
2324
__stddef_header_macro.h

clang/lib/Headers/module.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ module _Builtin_stdbool [system] {
231231
export *
232232
}
233233

234+
module _Builtin_stdcountof [system] {
235+
header "stdcountof.h"
236+
export *
237+
}
238+
234239
module _Builtin_stddef [system] {
235240
textual header "stddef.h"
236241

clang/lib/Lex/ModuleMap.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ static bool isBuiltinHeaderName(StringRef FileName) {
260260
.Case("stdarg.h", true)
261261
.Case("stdatomic.h", true)
262262
.Case("stdbool.h", true)
263+
.Case("stdcountof.h", true)
263264
.Case("stddef.h", true)
264265
.Case("stdint.h", true)
265266
.Case("tgmath.h", true)

clang/lib/Lex/PPDirectives.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ static bool warnByDefaultOnWrongCase(StringRef Include) {
252252
.Cases("assert.h", "complex.h", "ctype.h", "errno.h", "fenv.h", true)
253253
.Cases("float.h", "inttypes.h", "iso646.h", "limits.h", "locale.h", true)
254254
.Cases("math.h", "setjmp.h", "signal.h", "stdalign.h", "stdarg.h", true)
255-
.Cases("stdatomic.h", "stdbool.h", "stdckdint.h", "stddef.h", true)
256-
.Cases("stdint.h", "stdio.h", "stdlib.h", "stdnoreturn.h", true)
255+
.Cases("stdatomic.h", "stdbool.h", "stdckdint.h", "stdcountof.h", true)
256+
.Cases("stddef.h", "stdint.h", "stdio.h", "stdlib.h", "stdnoreturn.h", true)
257257
.Cases("string.h", "tgmath.h", "threads.h", "time.h", "uchar.h", true)
258258
.Cases("wchar.h", "wctype.h", true)
259259

clang/lib/Tooling/Inclusions/Stdlib/CSymbolMap.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ SYMBOL(cosh, None, <math.h>)
389389
SYMBOL(coshf, None, <math.h>)
390390
SYMBOL(coshl, None, <math.h>)
391391
SYMBOL(cosl, None, <math.h>)
392+
SYMBOL(countof, None, <stdcountof.h>)
392393
SYMBOL(cpow, None, <complex.h>)
393394
SYMBOL(cpowf, None, <complex.h>)
394395
SYMBOL(cpowl, None, <complex.h>)

clang/test/Modules/Inputs/builtin-headers/system-modules.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ module cstd [system] [no_undeclared_includes] {
4949
export *
5050
}
5151

52+
module stdcountof {
53+
header "stdcountof.h"
54+
export *
55+
}
56+
5257
module stddef {
5358
header "stddef.h"
5459
export *

0 commit comments

Comments
 (0)