#
8a334af4 |
| 29-Jan-2025 |
Matheus Izvekov <mizvekov@gmail.com> |
[clang] Remove the deprecated flag `-frelaxed-template-template-args`. (#111894)
This flag has been deprecated since Clang 19, having been the default since then.
It has remained because its negati
[clang] Remove the deprecated flag `-frelaxed-template-template-args`. (#111894)
This flag has been deprecated since Clang 19, having been the default since then.
It has remained because its negation was still useful to work around backwards compatibility breaking changes from P0522.
However, in Clang 20 we have landed various changes which implemented P3310R2 and beyond, which solve almost all of the expected issues, the known remaining few being a bit obscure.
So this change removes the flag completely and all of its implementation and support code.
Hopefully any remaining users can just stop using the flag. If there are still important issues remaining, this removal will also shake the tree and help us know.
show more ...
|
#
978e0839 |
| 29-Jan-2025 |
Zahira Ammarguellat <zahira.ammarguellat@intel.com> |
[OpenMP] Allow OMP6.0 features. (#122108)
Add support for the `-fopenmp-version=60` command line argument. It is
needed for https://github.com/llvm/llvm-project/pull/119891 (`#pragma
omp stripe`)
[OpenMP] Allow OMP6.0 features. (#122108)
Add support for the `-fopenmp-version=60` command line argument. It is
needed for https://github.com/llvm/llvm-project/pull/119891 (`#pragma
omp stripe`) which will be the first OpenMP 6.0 directive implemented.
Add regression tests for Clang in `-fopenmp-version=60` mode.
show more ...
|
Revision tags: llvmorg-21-init |
|
#
33ad474c |
| 26-Jan-2025 |
Manuel Sainz de Baranda y Goñi <manuel@zxe.io> |
[Clang] Add predefined macros for integer constants (#123514)
This adds predefined macros for integer constants to implement section 7.18.4 of ISO/IEC 9899:1999 in `<stdint.h>` in a safe way:
``` _
[Clang] Add predefined macros for integer constants (#123514)
This adds predefined macros for integer constants to implement section 7.18.4 of ISO/IEC 9899:1999 in `<stdint.h>` in a safe way:
``` __INT8_C(c) __INT16_C(c) __INT32_C(c) __INT64_C(c) __INTMAX_C(c) __UINT8_C(c) __UINT16_C(c) __UINT32_C(c) __UINT64_C(c) __UINTMAX_C(c) ```
Which improves compatibility with GCC and makes it trivial to implement section 7.18.4 of ISO/IEC 9899:1999.
Clang defines `__INT<N>_C_SUFFIX__`, `__UINT<N>_C_SUFFIX__`, `__INTAX_C_SUFFIX__` and `__UINTMAX_C_SUFFIX__`, but these macros are useless for this purpose.
Let's say, for example, that `__INT64_C_SUFFIX__` expands to `L` or `LL`. If the user defines them as a macros, the compiler will produce errors if `INT64_C` is implemented in `<stdint.h>` using `__INT64_C_SUFFIX__`:
**minimal-test.c:** ```cpp #if defined(__clang__) & !defined(__INT64_C) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wreserved-identifier" # define __PSTDC_INT_C_(literal, suffix) literal##suffix # define __PSTDC_INT_C(literal, suffix) __PSTDC_INT_C_(literal, suffix) # define INT64_C(literal) __PSTDC_INT_C(literal, __INT64_C_SUFFIX__) # pragma clang diagnostic pop #elif defined(__GNUC__) # define INT64_C __INT64_C #endif
typedef __INT64_TYPE__ int64_t;
#define L "Make Clang produce an error" #define LL "Make Clang produce an error"
int main(int argc, char **argv) { (void)argc; (void)argv; int64_t v = INT64_C(9223372036854775807); (void)v; return 0; }
```
<img width="697" alt="imagen" src="https://github.com/user-attachments/assets/6df97af6-7cfd-4cf9-85b7-d7c854509325" />
**test.c:** ```cpp #if defined(__clang__) && !defined(__INT8_C) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wreserved-identifier"
# define __PSTDC_INT_C_(literal, suffix) literal##suffix # define __PSTDC_INT_C(literal, suffix) __PSTDC_INT_C_(literal, suffix)
# define INT8_C(literal) __PSTDC_INT_C(literal, __INT8_C_SUFFIX__) # define INT16_C(literal) __PSTDC_INT_C(literal, __INT16_C_SUFFIX__) # define INT32_C(literal) __PSTDC_INT_C(literal, __INT32_C_SUFFIX__) # define INT64_C(literal) __PSTDC_INT_C(literal, __INT64_C_SUFFIX__) # define INTMAX_C(literal) __PSTDC_INT_C(literal, __INTMAX_C_SUFFIX__) # define UINT8_C(literal) __PSTDC_INT_C(literal, __UINT8_C_SUFFIX__) # define UINT16_C(literal) __PSTDC_INT_C(literal, __UINT16_C_SUFFIX__) # define UINT32_C(literal) __PSTDC_INT_C(literal, __UINT32_C_SUFFIX__) # define UINT64_C(literal) __PSTDC_INT_C(literal, __UINT64_C_SUFFIX__) # define UINTMAX_C(literal) __PSTDC_INT_C(literal, __UINTMAX_C_SUFFIX__)
# pragma clang diagnostic pop
#else # define INT8_C __INT8_C # define INT16_C __INT16_C # define INT32_C __INT32_C # define INT64_C __INT64_C # define INTMAX_C __INTMAX_C # define UINT8_C __UINT8_C # define UINT16_C __UINT16_C # define UINT32_C __UINT32_C # define UINT64_C __UINT64_C # define UINTMAX_C __UINTMAX_C #endif
typedef __INT8_TYPE__ int8_t; typedef __INT16_TYPE__ int16_t; typedef __INT32_TYPE__ int32_t; typedef __INT64_TYPE__ int64_t; typedef __INTMAX_TYPE__ intmax_t; typedef __UINT8_TYPE__ uint8_t; typedef __UINT16_TYPE__ uint16_t; typedef __UINT32_TYPE__ uint32_t; typedef __UINT64_TYPE__ uint64_t; typedef __UINTMAX_TYPE__ uintmax_t;
#define L "Make Clang produce an error" #define LL "Make Clang produce an error" #define U "Make Clang produce an error" #define UL "Make Clang produce an error" #define ULL "Make Clang produce an error"
int main(int argc, char **argv) { (void)argc; (void)argv;
int8_t a = INT8_C (127); int16_t b = INT16_C (32767); int32_t c = INT32_C (2147483647); int64_t d = INT64_C (9223372036854775807); intmax_t e = INTMAX_C (9223372036854775807); uint8_t f = UINT8_C (255); uint16_t g = UINT16_C (65535); uint32_t h = UINT32_C (4294967295); uint64_t i = UINT64_C (18446744073709551615); uintmax_t j = UINTMAX_C(18446744073709551615);
(void)a; (void)b; (void)c; (void)d; (void)e; (void)f; (void)g; (void)h; (void)i; (void)j; return 0; } ```
show more ...
|
Revision tags: llvmorg-19.1.7 |
|
#
8a1174f0 |
| 10-Jan-2025 |
Ian Anderson <iana@apple.com> |
[Darwin][Driver][clang] arm64-apple-none-macho is missing the Apple macros from arm-apple-none-macho (#122427)
arm-apple-none-macho uses DarwinTargetInfo which provides several Apple
specific macro
[Darwin][Driver][clang] arm64-apple-none-macho is missing the Apple macros from arm-apple-none-macho (#122427)
arm-apple-none-macho uses DarwinTargetInfo which provides several Apple
specific macros. arm64-apple-none-macho however just uses the generic
AArch64leTargetInfo and doesn't get any of those macros. It's not clear
if everything from DarwinTargetInfo is desirable for
arm64-apple-none-macho, so make an AppleMachOTargetInfo to hold the
generic Apple macros and a few other basic things.
show more ...
|
#
d6bfe10a |
| 08-Jan-2025 |
Ian Anderson <iana@apple.com> |
[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#122035)
Embedded development often needs to use a different C standar
[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#122035)
Embedded development often needs to use a different C standard library,
replacing the existing one normally passed as -internal-externc-isystem.
This works fine for an apple-macos target, but apple-none-macho doesn't
work because the MachO driver doesn't implement
AddClangSystemIncludeArgs to add the resource directory as
-internal-isystem like most other drivers do. Move most of the search
path logic from Darwin and DarwinClang down into an AppleMachO toolchain
between the MachO and Darwin toolchains.
Also define __MACH__ for apple-none-macho, as Swift expects all MachO
targets to have that defined.
show more ...
|
#
ab5133bb |
| 07-Jan-2025 |
Nico Weber <thakis@chromium.org> |
Revert "[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#120507)"
This reverts commit 653a54727eaa18c43447ad686c987db6
Revert "[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#120507)"
This reverts commit 653a54727eaa18c43447ad686c987db67f1dda74. Breaks tests, see https://github.com/llvm/llvm-project/pull/120507#issuecomment-2575246281
show more ...
|
#
653a5472 |
| 07-Jan-2025 |
Ian Anderson <iana@apple.com> |
[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#120507)
Embedded development often needs to use a different C standar
[Darwin][Driver][clang] apple-none-macho orders the resource directory after internal-externc-isystem when nostdlibinc is used (#120507)
Embedded development often needs to use a different C standard library,
replacing the existing one normally passed as -internal-externc-isystem.
This works fine for an apple-macos target, but apple-none-macho doesn't
work because the MachO driver doesn't implement
AddClangSystemIncludeArgs to add the resource directory as
-internal-isystem like most other drivers do. Move most of the search
path logic from Darwin and DarwinClang down into an AppleMachO toolchain
between the MachO and Darwin toolchains.
Also define \_\_MACH__ for apple-none-macho, as Swift expects all MachO
targets to have that defined.
show more ...
|
#
72e58e00 |
| 18-Dec-2024 |
cor3ntin <corentinjabot@gmail.com> |
[Clang] Set `__cpp_explicit_this_parameter` (#107451)
There are not a lot of outstanding known issues with deducing this (besides #95112), so it seems reasonable to claim full support.
Fixes #82780
|
Revision tags: llvmorg-19.1.6 |
|
#
6b078539 |
| 05-Dec-2024 |
dklochkov-intel <denis.klochkov@intel.com> |
[SYCL] Change SYCL version according to standard (#114790)
Version of SYCL was changed according to the latest agreement: The lower 2 digits are not formally specified, but we plan to use these to i
[SYCL] Change SYCL version according to standard (#114790)
Version of SYCL was changed according to the latest agreement: The lower 2 digits are not formally specified, but we plan to use these to identify the month in which we submit the specification for ratification, which is similar to the C++ macro __cplusplus.
Since the SYCL 2020 specification was submitted for ratification in December of 2020, the macro's value is now 202012 for SYCL 2020. see PR for details https://github.com/KhronosGroup/SYCL-Docs/pull/634
show more ...
|
Revision tags: llvmorg-19.1.5 |
|
#
00770489 |
| 25-Nov-2024 |
Aaron Ballman <aaron@aaronballman.com> |
[C23] Fixed the value of BOOL_WIDTH (#117364)
The standard mandates that this returns the width of the type, which is
the number of bits in the value. For bool, that's required to be `1`
explicitl
[C23] Fixed the value of BOOL_WIDTH (#117364)
The standard mandates that this returns the width of the type, which is
the number of bits in the value. For bool, that's required to be `1`
explicitly.
Fixes #117348
show more ...
|
Revision tags: llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0 |
|
#
be427dfb |
| 05-Sep-2024 |
Mital Ashok <mital@mitalashok.co.uk> |
[Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (#102044)
Added a new `-Wpre-c++26-compat` warning for when this feature is used
in C++26 and a `
[Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (#102044)
Added a new `-Wpre-c++26-compat` warning for when this feature is used
in C++26 and a `-Wc++26-extensions` warning for when this is used in
C++11 through C++23.
---------
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
show more ...
|
Revision tags: llvmorg-19.1.0-rc4 |
|
#
6e78aef6 |
| 23-Aug-2024 |
cor3ntin <corentinjabot@gmail.com> |
[Clang] Implement P2747 constexpr placement new (#104586)
The implementation follows the resolution of CWG2922
|
Revision tags: llvmorg-19.1.0-rc3 |
|
#
2b0a8fcf |
| 15-Aug-2024 |
Sirraide <aeternalmail@gmail.com> |
[Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (#101448)
Implement P2893R3 ‘Variadic friends’ for C++26.
This closes #98587.
Co-authored-by: Younan Zhang <zyn7109@gmail.com>
|
#
c65afad9 |
| 05-Aug-2024 |
Sirraide <aeternalmail@gmail.com> |
[Clang] Define __cpp_pack_indexing (#101956)
Following the discussion on #101448 this defines
`__cpp_pack_indexing`. Since pack indexing is currently
supported in all language modes, the feature
[Clang] Define __cpp_pack_indexing (#101956)
Following the discussion on #101448 this defines
`__cpp_pack_indexing`. Since pack indexing is currently
supported in all language modes, the feature test macro
is also defined in all language modes.
show more ...
|
Revision tags: llvmorg-19.1.0-rc2 |
|
#
c9c91f59 |
| 26-Jul-2024 |
Zahira Ammarguellat <zahira.ammarguellat@intel.com> |
Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (#97342)
Currently `__FINITE_MATH_ONLY__` is set when `FiniteMathOnly`. And
`FiniteMathOnly` is set when `NoHonorInfs` && `NoHonorNa
Remove FiniteMathOnly and use only NoHonorINFs and NoHonorNANs. (#97342)
Currently `__FINITE_MATH_ONLY__` is set when `FiniteMathOnly`. And
`FiniteMathOnly` is set when `NoHonorInfs` && `NoHonorNans` is true. But
what happens one of the latter flags is false?
To avoid potential inconsistencies, the internal option `FiniteMathOnly`
is removed option and the macro `__FINITE_MATH_ONLY__` is set when
`NoHonorInfs` && `NoHonorNans`.
show more ...
|
Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
329e7c80 |
| 17-Jul-2024 |
Mital Ashok <mital@mitalashok.co.uk> |
[Clang] [C23] Implement N2653: u8 strings are char8_t[] (#97208)
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm
Closes #97202
---------
Co-authored-by: cor3ntin <corentinjabot@g
[Clang] [C23] Implement N2653: u8 strings are char8_t[] (#97208)
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm
Closes #97202
---------
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
show more ...
|
#
0e7590a2 |
| 10-Jul-2024 |
Aaron Ballman <aaron@aaronballman.com> |
[C23] Add *_NORM_MAX macros to <float.h> (#96643)
This adds the *_NORM_MAX macros to <float.h> for freestanding mode in
Clang; the values were chosen based on the behavior seen coming from GCC
and
[C23] Add *_NORM_MAX macros to <float.h> (#96643)
This adds the *_NORM_MAX macros to <float.h> for freestanding mode in
Clang; the values were chosen based on the behavior seen coming from GCC
and the values already produced for the *_MAX macros by Clang.
show more ...
|
#
b67d557b |
| 02-Jul-2024 |
Aaron Ballman <aaron@aaronballman.com> |
[C2y] Add -std=c2y and -std=gnu2y
This adds a language standard mode for the latest C standard. While WG14 is hoping for a three-year cycle, it is not clear that the next revision of C will be in 20
[C2y] Add -std=c2y and -std=gnu2y
This adds a language standard mode for the latest C standard. While WG14 is hoping for a three-year cycle, it is not clear that the next revision of C will be in 2026 and so a flag was not created for c26 specifically.
show more ...
|
#
4e6c8f1d |
| 24-Jun-2024 |
Martin Storsjö <martin@martin.st> |
[clang] [MinGW] Set a predefined __GXX_TYPEINFO_EQUALITY_INLINE=0 for MinGW targets (#96062)
libstdc++ requires this define to match what is predefined in GCC for
the ABI of this platform; GCC hard
[clang] [MinGW] Set a predefined __GXX_TYPEINFO_EQUALITY_INLINE=0 for MinGW targets (#96062)
libstdc++ requires this define to match what is predefined in GCC for
the ABI of this platform; GCC hardcodes this define for all mingw
configurations in gcc/config/i386/cygming.h.
(It also defines __GXX_MERGED_TYPEINFO_NAMES=0, but that happens to
match the defaults in libstdc++ headers, so there's no similar need to
define it in Clang.)
This fixes a Clang/libstdc++ interop issue discussed at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110572.
show more ...
|
#
41c6e437 |
| 20-Jun-2024 |
Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> |
Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802)
This commit implements the entirety of the now-accepted [N3017
-Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg1
Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802)
This commit implements the entirety of the now-accepted [N3017
-Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and
its sister C++ paper [p1967](https://wg21.link/p1967). It implements
everything in the specification, and includes an implementation that
drastically improves the time it takes to embed data in specific
scenarios (the initialization of character type arrays). The mechanisms
used to do this are used under the "as-if" rule, and in general when the
system cannot detect it is initializing an array object in a variable
declaration, will generate EmbedExpr AST node which will be expanded by
AST consumers (CodeGen or constant expression evaluators) or expand
embed directive as a comma expression.
This reverts commit
https://github.com/llvm/llvm-project/commit/682d461d5a231cee54d65910e6341769419a67d7.
---------
Co-authored-by: The Phantom Derpstorm <phdofthehouse@gmail.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
Co-authored-by: H. Vetinari <h.vetinari@gmx.com>
show more ...
|
Revision tags: llvmorg-18.1.8 |
|
#
682d461d |
| 12-Jun-2024 |
Vitaly Buka <vitalybuka@google.com> |
Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (#95299)
Reverts llvm/llvm-project#68620
Introduce or expose a memory leak and UB, see llvm/llvm-pro
Revert "✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy)" (#95299)
Reverts llvm/llvm-project#68620
Introduce or expose a memory leak and UB, see llvm/llvm-project#68620
show more ...
|
#
5989450e |
| 12-Jun-2024 |
The Phantom Derpstorm <phdofthehouse@gmail.com> |
[clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (#68620)
This commit implements the entirety of the now-accepted [N3017 -
Preprocessor
Embed](https://www
[clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (#68620)
This commit implements the entirety of the now-accepted [N3017 -
Preprocessor
Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and
its sister C++ paper [p1967](https://wg21.link/p1967). It implements
everything in the specification, and includes an implementation that
drastically improves the time it takes to embed data in specific
scenarios (the initialization of character type arrays). The mechanisms
used to do this are used under the "as-if" rule, and in general when the
system cannot detect it is initializing an array object in a variable
declaration, will generate EmbedExpr AST node which will be expanded
by AST consumers (CodeGen or constant expression evaluators) or
expand embed directive as a comma expression.
---------
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: cor3ntin <corentinjabot@gmail.com>
Co-authored-by: H. Vetinari <h.vetinari@gmx.com>
Co-authored-by: Podchishchaeva, Mariya <mariya.podchishchaeva@intel.com>
show more ...
|
Revision tags: llvmorg-18.1.7 |
|
#
778dbcbb |
| 25-May-2024 |
Reagan <xbjfk.github@gmail.com> |
[clang] Add /Zc:__STDC__ flag to clang-cl (#68690)
This commit adds the /Zc:\_\_STDC\_\_ argument from MSVC, which defines
\_\_STDC_\_.
This means, alongside stronger feature parity with MSVC, tha
[clang] Add /Zc:__STDC__ flag to clang-cl (#68690)
This commit adds the /Zc:\_\_STDC\_\_ argument from MSVC, which defines
\_\_STDC_\_.
This means, alongside stronger feature parity with MSVC, that things
that rely on \_\_STDC\_\_, such as autoconf, can work.
Link to MSVC documentation of this flag:
https://learn.microsoft.com/en-us/cpp/build/reference/zc-stdc?view=msvc-170
show more ...
|
#
d1aca0ae |
| 21-May-2024 |
Heejin Ahn <aheejin@gmail.com> |
[WebAssembly] Define __WASM_EXCEPTIONS__ for -fwasm-exceptions (#92604)
When using other specific exception options in Clang, such as
`-fseh-exceptions` or `-fsjlj-exceptions`, Clang defines a corr
[WebAssembly] Define __WASM_EXCEPTIONS__ for -fwasm-exceptions (#92604)
When using other specific exception options in Clang, such as
`-fseh-exceptions` or `-fsjlj-exceptions`, Clang defines a corresponding
preprocessor such as `-D__USING_SJLJ_EXCEPTIONS__`. Emscripten does that
in our own build system:
https://github.com/emscripten-core/emscripten/blob/7dcd7f40749918e141dc33397d2f4311dd80637a/tools/system_libs.py#L1577-L1578
But to make Wasm EH usable in non-Emscripten toolchain, this has to be
defined somewhere else. This PR makes Wasm EH consistent with other
exception scheme by letting it defined by Clang depending on the
exception option.
We have been using `__USING_WASM_EXCEPTIONS__` in our current library
code, but this changes it to `__WASM_EXCEPTIONS__` for its conciseness,
and I will update other parts of LLVM as follow-ups. This does not break
anything currently working, because we have not been defining anything
in Clang so far.
show more ...
|
Revision tags: llvmorg-18.1.6, llvmorg-18.1.5 |
|
#
6dd90616 |
| 28-Apr-2024 |
cor3ntin <corentinjabot@gmail.com> |
[Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (#89906)
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0609r3.pdf
We support this feature in all language mode.
may
[Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (#89906)
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0609r3.pdf
We support this feature in all language mode.
maybe_unused applied to a binding makes the whole declaration unused.
show more ...
|