[libcxxabi][demangle] create helper for std::string_view::starts_with
authorNick Desaulniers <ndesaulniers@google.com>
Thu, 20 Apr 2023 17:02:28 +0000 (10:02 -0700)
committerNick Desaulniers <ndesaulniers@google.com>
Thu, 20 Apr 2023 17:02:32 +0000 (10:02 -0700)
commit691c4800be8018d8ad03f0e25be3672acbdfe403
tree30265c8249de68e6db65fd5967eefc3ef1f8a722
parent328cfa840d791deeed84aa4e2fda93d591bfb8d7
[libcxxabi][demangle] create helper for std::string_view::starts_with

Add C++ 20 style starts_with to replace StringView::startsWith in
LLVMDemangle. Due to library layering (LLVMSupport depends on
LLVMDemangle), we add the utility header under llvm/Demangle, instead of
llvm/ADT or llvm/Support.

Modify this in libcxxabi, then copy this over to llvm.

Reviewed By: MaskRay, #libc_abi, phosek

Differential Revision: https://reviews.llvm.org/D148556
clang/docs/tools/clang-formatted-files.txt
libcxxabi/src/demangle/StringViewExtras.h [new file with mode: 0644]
libcxxabi/src/demangle/cp-to-llvm.sh
llvm/include/llvm/Demangle/StringViewExtras.h [new file with mode: 0644]