[PATCH] D86508: [clang] improve GCC-compat for C90 __builtin_ functions

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 11:27:47 PDT 2020


nickdesaulniers added inline comments.


================
Comment at: clang/docs/LanguageExtensions.rst:2370
 
+* ``bcmp``
 * ``memchr``
----------------
nickdesaulniers wrote:
> rsmith wrote:
> > aaron.ballman wrote:
> > > Can you mention the deprecation issue here?
> > Do we really provide constant evaluation support for all of these functions?
> Is that what is meant by having "buitins" for these functions?  (I'm not sure whether you're arguing that these should be listed somewhere else, or that the current patch is not enough to claim support for `__has_builtin` for these functions).
LLVM will generate calls to bcmp, see commit 8e16d73346f8 ("[SelectionDAG] Allow the user to specify a memeq function.").

I don't think we should be doing that, if we're going to mention explicitly in our docs that bcmp is deprecated.  It feels like a double standard to dissuade its use, but then go and generate calls to it that weren't written explicitly.


================
Comment at: clang/docs/LanguageExtensions.rst:2370-2398
+* ``bcmp``
 * ``memchr``
-* ``memcmp`` (and its deprecated BSD / POSIX alias ``bcmp``)
+* ``memcmp``
+* ``memcpy``
+* ``memmove``
+* ``memset``
+* ``strcat``
----------------
rsmith wrote:
> aaron.ballman wrote:
> > Can you mention the deprecation issue here?
> Do we really provide constant evaluation support for all of these functions?
Is that what is meant by having "buitins" for these functions?  (I'm not sure whether you're arguing that these should be listed somewhere else, or that the current patch is not enough to claim support for `__has_builtin` for these functions).


================
Comment at: clang/docs/LanguageExtensions.rst:2381
+* ``strcspn``
+* ``strerror``
 * ``strlen``
----------------
rsmith wrote:
> Do we really provide `__builtin_strerror`? I don't see it below.
We have the `LIBBUILTIN` rule for it, but not the corresponding `BUILTIN` rule.  Should I add it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86508



More information about the cfe-commits mailing list