[all-commits] [llvm/llvm-project] f62d41: [libc++] Use builtins when redeclaring <string.h> ...

Louis Dionne via All-commits all-commits at lists.llvm.org
Fri Nov 25 06:22:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f62d4135c5cd1ec0656d097be0931021de8b7ae9
      https://github.com/llvm/llvm-project/commit/f62d4135c5cd1ec0656d097be0931021de8b7ae9
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-11-25 (Fri, 25 Nov 2022)

  Changed paths:
    M libcxx/include/string.h
    M libcxx/test/std/depr/depr.c.headers/string_h.pass.cpp
    M libcxx/test/std/strings/c.strings/cstring.pass.cpp

  Log Message:
  -----------
  [libc++] Use builtins when redeclaring <string.h> functions

When we define the const-correct overloads of <string.h> functions in
libc++ itself, use builtins whenever possible. This avoids depending on
the presence of these functions in the C library headers.

Also, as a fly-by, improve the tests for these functions since we
basically didn't check anything but their signature. We could have
used the wrong builtin (as long as the signature matched) without ever
noticing, which was quite scary.

Differential Revision: https://reviews.llvm.org/D138684




More information about the All-commits mailing list