Skip to content

Commit 19e3772

Browse files
Adjust to the new clang builtin modules
<__stddef_size_t.h> is now a modular header, and so will not be absorbed into Darwin. When that happens, Darwin.C.stddef no longer has a size_t declaration, instead it imports the declaration from _Builtin_stddef.size_t. Darwin still has its other size_t declaration though, Darwin.POSIX._types._size_t, and that's the one that will be found currently. If that one ever goes away though, allow for _Builtin_stddef.size_t being found in C-typedef-Darwin.
1 parent 9ea3146 commit 19e3772

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/DebugInfo/C-typedef-Darwin.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@ let blah = size_t(1024)
99
use(blah)
1010
// CHECK: !DIDerivedType(tag: DW_TAG_typedef,
1111
// CHECK-SAME: scope: ![[DARWIN_MODULE:[0-9]+]],
12-
// CHECK: ![[DARWIN_MODULE]] = !DIModule({{.*}}, name: "stddef"
12+
// size_t is defined in clang by <__stddef_size_t.h> (_Builtin_stddef.size_t)
13+
// and in macOS by <sys/_types/_size_t.h> (Darwin.POSIX._types._size_t). When
14+
// Darwin builds, Darwin.C.stddef will precompile clang's <stddef.h>, which will
15+
// include <__stddef_size_t.h> so that declaration will be visible via the
16+
// `export *`. Darwin.POSIX._types._size_t will precompile <sys/_types/_size_t.h>
17+
// into the Darwin pcm, making it the likely source of size_t. However, if Apple
18+
// stops redeclaring size_t, then the clang one will be the only one, so check
19+
// for either module.
20+
// CHECK: ![[DARWIN_MODULE]] = !DIModule({{.*}}, name: "{{_?size_t}}"

0 commit comments

Comments
 (0)