[clang] [Clang] Fixes of builtins definitions after PR #68324. (PR #81022)

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 11:00:09 PST 2024


michele-scandale wrote:

There are still some differences that I haven't addressed here as they might be ok to have:
* `__builtin_rint{,f,l}` were defined with the `const` attribute, now they use the `const when FP exceptions are ignored` -- this seems due to the definition of these has been merged with the corresponding library builtins `rint{,f,l}`.
* `__builtin_{wcschr,wcscmp,wcslen,wcsncmp}` and corresponding library builtins now are marked `pure`
* `__addressof` was language builtin, now is a library builtin (like `addressof`)
* `finite{,f,l}` were defined with `GNU_LANG` property, now they are defined with the `ALL_GNU_LANGUAGES` property
* `__builtin_va_{copy,end}` are now marked with the property that they are a `libc/libm function with a '__builtin_' prefix added`
* a bunch of C library builtins are now marked `nothrow` (e.g. `abort`, `alloca`, `bcopy`, `bzero`, `index`, `fprintf`, `memchr`, `memcpy`, `memmove`, `memset`, `rindex`, `snprintf`, `sprintf`, `stpcpy` `stpncpy`, `strcat`, `strchr`, `strcmp`, `strcpy`, `strdup`, `strlen`, `strncat`, `strncmp`, `strncpy`, `strpbrk`, `strrchr`, `strspn`, `strstr`, `vfprintf`, `vprintf`, `vsnprintf`, `vsprintf`, `wcschr`, `wcscmp`, `wcslen`, `wcsncmp`, `wmemchr`, `wmemcmp`, `wmemcpy`, `wmemmove`
* `snprintf`, `sprintf`, `vfprintf`, `vprintf`, `vsnprintf`, `vsprintf` have now pointer arguments marked `restrict`.

Any comment?

https://github.com/llvm/llvm-project/pull/81022


More information about the cfe-commits mailing list