Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@ namespace find_all_symbols {

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>"},
Expand Down
14 changes: 14 additions & 0 deletions clang-tools-extra/clangd/index/CanonicalIncludes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@ namespace clang {
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>"},
Expand Down
14 changes: 14 additions & 0 deletions clang/lib/Headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ set(core_files
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
Expand Down
13 changes: 13 additions & 0 deletions clang/lib/Headers/__stdarg___gnuc_va_list.h
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions clang/lib/Headers/__stdarg___va_copy.h
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions clang/lib/Headers/__stdarg_va_arg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*===---- __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

/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
/* C2x does not require the second parameter for va_start. */
#define va_start(ap, ...) __builtin_va_start(ap, 0)
#else
/* Versions before C2x 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
12 changes: 12 additions & 0 deletions clang/lib/Headers/__stdarg_va_copy.h
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions clang/lib/Headers/__stdarg_va_list.h
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions clang/lib/Headers/__stddef_null.h
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions clang/lib/Headers/__stddef_nullptr_t.h
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions clang/lib/Headers/__stddef_offsetof.h
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions clang/lib/Headers/__stddef_ptrdiff_t.h
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions clang/lib/Headers/__stddef_rsize_t.h
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions clang/lib/Headers/__stddef_size_t.h
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions clang/lib/Headers/__stddef_unreachable.h
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions clang/lib/Headers/__stddef_wchar_t.h
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions clang/lib/Headers/__stddef_wint_t.h
Original file line number Diff line number Diff line change
@@ -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
26 changes: 5 additions & 21 deletions clang/lib/Headers/stdarg.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +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
/* FIXME: This is using the placeholder dates Clang produces for these macros
in C2x mode; switch to the correct values once they've been published. */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
/* C2x does not require the second parameter for va_start. */
#define va_start(ap, ...) __builtin_va_start(ap, 0)
#else
/* Versions before C2x 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) */

Expand Down
Loading