[all-commits] [llvm/llvm-project] ee740b: [Demangle] avoid more std::string_view::substr

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Thu May 25 14:35:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ee740b714ba0de41f48a4fb4717fa9b9a22fedf2
      https://github.com/llvm/llvm-project/commit/ee740b714ba0de41f48a4fb4717fa9b9a22fedf2
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M libcxxabi/src/demangle/StringViewExtras.h
    M llvm/include/llvm/Demangle/StringViewExtras.h

  Log Message:
  -----------
  [Demangle] avoid more std::string_view::substr

In D148959, I removed usage of std::string_view::substr because it may
throw, and libcxxabi cannot use such code.  I missed one instance in
llvm::starts_with.  That is blocking copying the code back upstream in
D148566.

Mark these helpers noexcept (as they are in C++20) as well, to remind
future travelers.

Make these changes upstream, and copy them back downstream using
libcxxabi/src/demangle/cp-to-llvm.sh.

Reviewed By: #libc_abi, MaskRay, ldionne

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




More information about the All-commits mailing list