iana updated this revision to Diff 553677.
iana added a comment.

Modules don't support the #include #undef #include pattern to redefine macros, 
the second include has no effect. Move the #undef of NULL into __stddef_null.h 
so that the textual behavior is preserved, but the module behavior doesn't 
leave NULL undefined.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158709/new/

https://reviews.llvm.org/D158709

Files:
  clang-tools-extra/clang-include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
  clang-tools-extra/clangd/index/CanonicalIncludes.cpp
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/__stdarg___gnuc_va_list.h
  clang/lib/Headers/__stdarg___va_copy.h
  clang/lib/Headers/__stdarg_va_arg.h
  clang/lib/Headers/__stdarg_va_copy.h
  clang/lib/Headers/__stdarg_va_list.h
  clang/lib/Headers/__stddef_null.h
  clang/lib/Headers/__stddef_nullptr_t.h
  clang/lib/Headers/__stddef_offsetof.h
  clang/lib/Headers/__stddef_ptrdiff_t.h
  clang/lib/Headers/__stddef_rsize_t.h
  clang/lib/Headers/__stddef_size_t.h
  clang/lib/Headers/__stddef_unreachable.h
  clang/lib/Headers/__stddef_wchar_t.h
  clang/lib/Headers/__stddef_wint_t.h
  clang/lib/Headers/stdarg.h
  clang/lib/Headers/stddef.h
  clang/test/Headers/stddef.c
  clang/test/Headers/stddefneeds.c
  clang/test/Modules/stddef.c
  compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
  llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn

Index: llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
+++ llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
@@ -95,7 +95,21 @@
     "__clang_hip_math.h",
     "__clang_hip_runtime_wrapper.h",
     "__clang_hip_stdlib.h",
+    "__stdarg___gnuc_va_list.h",
+    "__stdarg___va_copy.h",
+    "__stdarg_va_arg.h",
+    "__stdarg_va_copy.h",
+    "__stdarg_va_list.h",
     "__stddef_max_align_t.h",
+    "__stddef_null.h",
+    "__stddef_nullptr_t.h",
+    "__stddef_offsetof.h",
+    "__stddef_ptrdiff_t.h",
+    "__stddef_rsize_t.h",
+    "__stddef_size_t.h",
+    "__stddef_unreachable.h",
+    "__stddef_wchar_t.h",
+    "__stddef_wint_t.h",
     "__wmmintrin_aes.h",
     "__wmmintrin_pclmul.h",
     "adxintrin.h",
Index: compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
===================================================================
--- compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
+++ compiler-rt/lib/gwp_asan/guarded_pool_allocator.h
@@ -20,6 +20,15 @@
 #include <stddef.h>
 #include <stdint.h>
 // IWYU pragma: no_include <__stddef_max_align_t.h>
+// IWYU pragma: no_include <__stddef_null.h>
+// IWYU pragma: no_include <__stddef_nullptr_t.h>
+// IWYU pragma: no_include <__stddef_offsetof.h>
+// IWYU pragma: no_include <__stddef_ptrdiff_t.h>
+// IWYU pragma: no_include <__stddef_rsize_t.h>
+// IWYU pragma: no_include <__stddef_size_t.h>
+// IWYU pragma: no_include <__stddef_unreachable.h>
+// IWYU pragma: no_include <__stddef_wchar_t.h>
+// IWYU pragma: no_include <__stddef_wint_t.h>
 
 namespace gwp_asan {
 // This class is the primary implementation of the allocator portion of GWP-
Index: clang/test/Modules/stddef.c
===================================================================
--- clang/test/Modules/stddef.c
+++ clang/test/Modules/stddef.c
@@ -6,7 +6,7 @@
 ptrdiff_t pdt;
 
 size_t st; // expected-error {{missing '#include "include_again.h"'; 'size_t' must be declared before it is used}}
-// expected-note@stddef.h:* {{here}}
+// expected-note@__stddef_size_t.h:* {{here}}
 
 #include "include_again.h"
 
Index: clang/test/Headers/stddefneeds.c
===================================================================
--- clang/test/Headers/stddefneeds.c
+++ clang/test/Headers/stddefneeds.c
@@ -38,7 +38,7 @@
 ptrdiff_t p2;
 size_t s2;
 rsize_t r2; // c99-error{{unknown type}} c23-error{{unknown type}}
-            // c99-note@stddef.h:*{{'size_t' declared here}} c23-note@stddef.h:*{{'size_t' declared here}}
+            // c99-note@__stddef_size_t.h:*{{'size_t' declared here}} c23-note@__stddef_size_t.h:*{{'size_t' declared here}}
 wchar_t wc2; // c99-error{{unknown type}} c23-error{{unknown type}}
 void *v2 = NULL; // c99-error{{undeclared identifier}} c23-error{{undeclared identifier}}
 nullptr_t n2; // c99-error{{unknown type}} c23-error{{unknown type}}
@@ -96,7 +96,7 @@
 // __need_nullptr_t generates an error in <C23 because its definition
 // depends on nullptr.
 #define __need_nullptr_t
-#include <stddef.h> // c99-error@stddef.h:*{{expected function body}}
+#include <stddef.h> // c99-error@__stddef_nullptr_t.h:*{{expected function body}}
 
 ptrdiff_t p6;
 size_t s6;
Index: clang/test/Headers/stddef.c
===================================================================
--- clang/test/Headers/stddef.c
+++ clang/test/Headers/stddef.c
@@ -22,7 +22,7 @@
 ptrdiff_t p1;
 size_t s1;
 rsize_t r1; // c99-error{{unknown type}} c11-error{{unknown type}} c23-error{{unknown type}}
-            // c99-note@stddef.h:*{{'size_t' declared here}} c11-note@stddef.h:*{{'size_t' declared here}} c23-note@stddef.h:*{{'size_t' declared here}}
+            // c99-note@__stddef_size_t.h:*{{'size_t' declared here}} c11-note@__stddef_size_t.h:*{{'size_t' declared here}} c23-note@__stddef_size_t.h:*{{'size_t' declared here}}
 wchar_t wc1;
 void *v1 = NULL;
 nullptr_t n1; // c99-error{{unknown type}} c11-error{{unknown type}}
Index: clang/lib/Headers/stddef.h
===================================================================
--- clang/lib/Headers/stddef.h
+++ clang/lib/Headers/stddef.h
@@ -51,107 +51,54 @@
 #endif
 
 #if defined(__need_ptrdiff_t)
-#if !defined(_PTRDIFF_T) || __has_feature(modules)
-/* Always define ptrdiff_t when modules are available. */
-#if !__has_feature(modules)
-#define _PTRDIFF_T
-#endif
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
-#endif
+#include <__stddef_ptrdiff_t.h>
 #undef __need_ptrdiff_t
 #endif /* defined(__need_ptrdiff_t) */
 
 #if defined(__need_size_t)
-#if !defined(_SIZE_T) || __has_feature(modules)
-/* Always define size_t when modules are available. */
-#if !__has_feature(modules)
-#define _SIZE_T
-#endif
-typedef __SIZE_TYPE__ size_t;
-#endif
+#include <__stddef_size_t.h>
 #undef __need_size_t
 #endif /*defined(__need_size_t) */
 
 #if defined(__need_rsize_t)
-#if !defined(_RSIZE_T) || __has_feature(modules)
-/* Always define rsize_t when modules are available. */
-#if !__has_feature(modules)
-#define _RSIZE_T
-#endif
-typedef __SIZE_TYPE__ rsize_t;
-#endif
+#include <__stddef_rsize_t.h>
 #undef __need_rsize_t
 #endif /* defined(__need_rsize_t) */
 
 #if defined(__need_wchar_t)
-#if !defined(__cplusplus) || (defined(_MSC_VER) && !_NATIVE_WCHAR_T_DEFINED)
-/* Always define wchar_t when modules are available. */
-#if !defined(_WCHAR_T) || __has_feature(modules)
-#if !__has_feature(modules)
-#define _WCHAR_T
-#if defined(_MSC_EXTENSIONS)
-#define _WCHAR_T_DEFINED
-#endif
-#endif
-typedef __WCHAR_TYPE__ wchar_t;
-#endif
-#endif
+#include <__stddef_wchar_t.h>
 #undef __need_wchar_t
 #endif /* defined(__need_wchar_t) */
 
 #if defined(__need_NULL)
-#undef NULL
-#ifdef __cplusplus
-#  if !defined(__MINGW32__) && !defined(_MSC_VER)
-#    define NULL __null
-#  else
-#    define NULL 0
-#  endif
-#else
-#  define NULL ((void*)0)
-#endif
+#include <__stddef_null.h>
 #undef __need_NULL
 #endif /* defined(__need_NULL) */
 
 #if defined(__need_nullptr_t)
-#ifdef __cplusplus
-#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
-namespace std {
-typedef decltype(nullptr) nullptr_t;
-}
-using ::std::nullptr_t;
-#endif
-#else
-typedef typeof(nullptr) nullptr_t;
-#endif
+#include <__stddef_nullptr_t.h>
 #undef __need_nullptr_t
 #endif /* defined(__need_nullptr_t) */
 
 #if defined(__need_unreachable)
-#define unreachable() __builtin_unreachable()
+#include <__stddef_unreachable.h>
 #undef __need_unreachable
 #endif /* defined(__need_unreachable) */
 
 #if defined(__need_max_align_t)
-#include "__stddef_max_align_t.h"
+#include <__stddef_max_align_t.h>
 #undef __need_max_align_t
 #endif /* defined(__need_max_align_t) */
 
 #if defined(__need_offsetof)
-#define offsetof(t, d) __builtin_offsetof(t, d)
+#include <__stddef_offsetof.h>
 #undef __need_offsetof
 #endif /* defined(__need_offsetof) */
 
 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
 __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
 #if defined(__need_wint_t)
-/* Always define wint_t when modules are available. */
-#if !defined(_WINT_T) || __has_feature(modules)
-#if !__has_feature(modules)
-#define _WINT_T
-#endif
-typedef __WINT_TYPE__ wint_t;
-#endif
+#include <__stddef_wint_t.h>
 #undef __need_wint_t
 #endif /* __need_wint_t */
 
Index: clang/lib/Headers/stdarg.h
===================================================================
--- clang/lib/Headers/stdarg.h
+++ clang/lib/Headers/stdarg.h
@@ -30,41 +30,27 @@
 #endif
 
 #ifdef __need___va_list
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-typedef __builtin_va_list __gnuc_va_list;
-#endif
+#include <__stdarg___gnuc_va_list.h>
 #undef __need___va_list
 #endif /* defined(__need___va_list) */
 
 #ifdef __need_va_list
-#ifndef _VA_LIST
-typedef __builtin_va_list va_list;
-#define _VA_LIST
-#endif
+#include <__stdarg_va_list.h>
 #undef __need_va_list
 #endif /* defined(__need_va_list) */
 
 #ifdef __need_va_arg
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
-/* C23 does not require the second parameter for va_start. */
-#define va_start(ap, ...) __builtin_va_start(ap, 0)
-#else
-/* Versions before C23 do require the second parameter. */
-#define va_start(ap, param) __builtin_va_start(ap, param)
-#endif
-#define va_end(ap)          __builtin_va_end(ap)
-#define va_arg(ap, type)    __builtin_va_arg(ap, type)
+#include <__stdarg_va_arg.h>
 #undef __need_va_arg
 #endif /* defined(__need_va_arg) */
 
 #ifdef __need___va_copy
-#define __va_copy(d,s) __builtin_va_copy(d,s)
+#include <__stdarg___va_copy.h>
 #undef __need___va_copy
 #endif /* defined(__need___va_copy) */
 
 #ifdef __need_va_copy
-#define va_copy(dest, src)  __builtin_va_copy(dest, src)
+#include <__stdarg_va_copy.h>
 #undef __need_va_copy
 #endif /* defined(__need_va_copy) */
 
Index: clang/lib/Headers/__stddef_wint_t.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_wint_t.h
@@ -0,0 +1,16 @@
+/*===---- __stddef_wint.h - Definition of wint_t ---------------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+/* Always define wint_t when modules are available. */
+#if !defined(_WINT_T) || __has_feature(modules)
+#if !__has_feature(modules)
+#define _WINT_T
+#endif
+typedef __WINT_TYPE__ wint_t;
+#endif
Index: clang/lib/Headers/__stddef_wchar_t.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_wchar_t.h
@@ -0,0 +1,21 @@
+/*===---- __stddef_wchar.h - Definition of wchar_t -------------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(__cplusplus) || (defined(_MSC_VER) && !_NATIVE_WCHAR_T_DEFINED)
+/* Always define wchar_t when modules are available. */
+#if !defined(_WCHAR_T) || __has_feature(modules)
+#if !__has_feature(modules)
+#define _WCHAR_T
+#if defined(_MSC_EXTENSIONS)
+#define _WCHAR_T_DEFINED
+#endif
+#endif
+typedef __WCHAR_TYPE__ wchar_t;
+#endif
+#endif
Index: clang/lib/Headers/__stddef_unreachable.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_unreachable.h
@@ -0,0 +1,13 @@
+/*===---- __stddef_unreachable.h - Definition of unreachable ---------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(unreachable) || __has_feature(modules)
+/* Always define unreachable when modules are available. */
+#define unreachable() __builtin_unreachable()
+#endif
Index: clang/lib/Headers/__stddef_size_t.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_size_t.h
@@ -0,0 +1,16 @@
+/*===---- __stddef_size_t.h - Definition of size_t -------------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(_SIZE_T) || __has_feature(modules)
+/* Always define size_t when modules are available. */
+#if !__has_feature(modules)
+#define _SIZE_T
+#endif
+typedef __SIZE_TYPE__ size_t;
+#endif
Index: clang/lib/Headers/__stddef_rsize_t.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_rsize_t.h
@@ -0,0 +1,16 @@
+/*===---- __stddef_rsize_t.h - Definition of rsize_t -----------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(_RSIZE_T) || __has_feature(modules)
+/* Always define rsize_t when modules are available. */
+#if !__has_feature(modules)
+#define _RSIZE_T
+#endif
+typedef __SIZE_TYPE__ rsize_t;
+#endif
Index: clang/lib/Headers/__stddef_ptrdiff_t.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_ptrdiff_t.h
@@ -0,0 +1,16 @@
+/*===---- __stddef_ptrdiff_t.h - Definition of ptrdiff_t -------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(_PTRDIFF_T) || __has_feature(modules)
+/* Always define ptrdiff_t when modules are available. */
+#if !__has_feature(modules)
+#define _PTRDIFF_T
+#endif
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif
Index: clang/lib/Headers/__stddef_offsetof.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_offsetof.h
@@ -0,0 +1,13 @@
+/*===---- __stddef_offsetof.h - Definition of offsetof ---------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(offsetof) || __has_feature(modules)
+/* Always define offsetof when modules are available. */
+#define offsetof(t, d) __builtin_offsetof(t, d)
+#endif
Index: clang/lib/Headers/__stddef_nullptr_t.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_nullptr_t.h
@@ -0,0 +1,25 @@
+/*===---- __stddef_nullptr_t.h - Definition of nullptr_t -------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#if !defined(_NULLPTR_T) || __has_feature(modules)
+/* Always define nullptr_t when modules are available. */
+#if !__has_feature(modules)
+#define _NULLPTR_T
+#endif
+#ifdef __cplusplus
+#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
+namespace std {
+typedef decltype(nullptr) nullptr_t;
+}
+using ::std::nullptr_t;
+#endif
+#else
+typedef typeof(nullptr) nullptr_t;
+#endif
+#endif
Index: clang/lib/Headers/__stddef_null.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stddef_null.h
@@ -0,0 +1,19 @@
+/*===---- __stddef_null.h - Definition of NULL -----------------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#undef NULL
+#ifdef __cplusplus
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
+#define NULL __null
+#else
+#define NULL 0
+#endif
+#else
+#define NULL ((void *)0)
+#endif
Index: clang/lib/Headers/__stdarg_va_list.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stdarg_va_list.h
@@ -0,0 +1,13 @@
+/*===---- __stdarg_va_list.h - Definition of va_list -----------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef _VA_LIST
+#define _VA_LIST
+typedef __builtin_va_list va_list;
+#endif
Index: clang/lib/Headers/__stdarg_va_copy.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stdarg_va_copy.h
@@ -0,0 +1,12 @@
+/*===---- __stdarg_va_copy.h - Definition of va_copy------------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef va_copy
+#define va_copy(dest, src) __builtin_va_copy(dest, src)
+#endif
Index: clang/lib/Headers/__stdarg_va_arg.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stdarg_va_arg.h
@@ -0,0 +1,22 @@
+/*===---- __stdarg_va_arg.h - Definitions of va_start, va_arg, va_end-------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef va_arg
+
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
+/* C23 does not require the second parameter for va_start. */
+#define va_start(ap, ...) __builtin_va_start(ap, 0)
+#else
+/* Versions before C23 do require the second parameter. */
+#define va_start(ap, param) __builtin_va_start(ap, param)
+#endif
+#define va_end(ap) __builtin_va_end(ap)
+#define va_arg(ap, type) __builtin_va_arg(ap, type)
+
+#endif
Index: clang/lib/Headers/__stdarg___va_copy.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stdarg___va_copy.h
@@ -0,0 +1,12 @@
+/*===---- __stdarg___va_copy.h - Definition of __va_copy -------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __va_copy
+#define __va_copy(d, s) __builtin_va_copy(d, s)
+#endif
Index: clang/lib/Headers/__stdarg___gnuc_va_list.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/__stdarg___gnuc_va_list.h
@@ -0,0 +1,13 @@
+/*===---- __stdarg___gnuc_va_list.h - Definition of __gnuc_va_list ---------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+typedef __builtin_va_list __gnuc_va_list;
+#endif
Index: clang/lib/Headers/CMakeLists.txt
===================================================================
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -10,10 +10,24 @@
   module.modulemap
   stdalign.h
   stdarg.h
+  __stdarg___gnuc_va_list.h
+  __stdarg___va_copy.h
+  __stdarg_va_arg.h
+  __stdarg_va_copy.h
+  __stdarg_va_list.h
   stdatomic.h
   stdbool.h
   stddef.h
   __stddef_max_align_t.h
+  __stddef_null.h
+  __stddef_nullptr_t.h
+  __stddef_offsetof.h
+  __stddef_ptrdiff_t.h
+  __stddef_rsize_t.h
+  __stddef_size_t.h
+  __stddef_unreachable.h
+  __stddef_wchar_t.h
+  __stddef_wint_t.h
   stdint.h
   stdnoreturn.h
   tgmath.h
Index: clang-tools-extra/clangd/index/CanonicalIncludes.cpp
===================================================================
--- clang-tools-extra/clangd/index/CanonicalIncludes.cpp
+++ clang-tools-extra/clangd/index/CanonicalIncludes.cpp
@@ -16,7 +16,21 @@
 namespace clangd {
 namespace {
 const std::pair<llvm::StringRef, llvm::StringRef> IncludeMappings[] = {
+    {"include/__stdarg___gnuc_va_list.h", "<cstdarg>"},
+    {"include/__stdarg___va_copy.h", "<cstdarg>"},
+    {"include/__stdarg_va_arg.h", "<cstdarg>"},
+    {"include/__stdarg_va_copy.h", "<cstdarg>"},
+    {"include/__stdarg_va_list.h", "<cstdarg>"},
     {"include/__stddef_max_align_t.h", "<cstddef>"},
+    {"include/__stddef_null.h", "<cstddef>"},
+    {"include/__stddef_nullptr_t.h", "<cstddef>"},
+    {"include/__stddef_offsetof.h", "<cstddef>"},
+    {"include/__stddef_ptrdiff_t.h", "<cstddef>"},
+    {"include/__stddef_rsize_t.h", "<cstddef>"},
+    {"include/__stddef_size_t.h", "<cstddef>"},
+    {"include/__stddef_unreachable.h", "<cstddef>"},
+    {"include/__stddef_wchar_t.h", "<cstddef>"},
+    {"include/__stddef_wint_t.h", "<cstddef>"},
     {"include/__wmmintrin_aes.h", "<wmmintrin.h>"},
     {"include/__wmmintrin_pclmul.h", "<wmmintrin.h>"},
     {"include/adxintrin.h", "<immintrin.h>"},
Index: clang-tools-extra/clang-include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
===================================================================
--- clang-tools-extra/clang-include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
+++ clang-tools-extra/clang-include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp
@@ -13,7 +13,21 @@
 
 const HeaderMapCollector::RegexHeaderMap *getSTLPostfixHeaderMap() {
   static const HeaderMapCollector::RegexHeaderMap STLPostfixHeaderMap = {
+      {"include/__stdarg___gnuc_va_list.h$", "<cstdarg>"},
+      {"include/__stdarg___va_copy.h$", "<cstdarg>"},
+      {"include/__stdarg_va_arg.h$", "<cstdarg>"},
+      {"include/__stdarg_va_copy.h$", "<cstdarg>"},
+      {"include/__stdarg_va_list.h$", "<cstdarg>"},
       {"include/__stddef_max_align_t.h$", "<cstddef>"},
+      {"include/__stddef_null.h$", "<cstddef>"},
+      {"include/__stddef_nullptr_t.h$", "<cstddef>"},
+      {"include/__stddef_offsetof.h$", "<cstddef>"},
+      {"include/__stddef_ptrdiff_t.h$", "<cstddef>"},
+      {"include/__stddef_rsize_t.h$", "<cstddef>"},
+      {"include/__stddef_size_t.h$", "<cstddef>"},
+      {"include/__stddef_unreachable.h$", "<cstddef>"},
+      {"include/__stddef_wchar_t.h$", "<cstddef>"},
+      {"include/__stddef_wint_t.h$", "<cstddef>"},
       {"include/__wmmintrin_aes.h$", "<wmmintrin.h>"},
       {"include/__wmmintrin_pclmul.h$", "<wmmintrin.h>"},
       {"include/adxintrin.h$", "<immintrin.h>"},
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to