[all-commits] [llvm/llvm-project] 1066e3: [demangler] Add StringView conversion operator

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Mon Mar 28 11:20:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1066e397fa907629f0da370f9721821c838ed30a
      https://github.com/llvm/llvm-project/commit/1066e397fa907629f0da370f9721821c838ed30a
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2022-03-28 (Mon, 28 Mar 2022)

  Changed paths:
    M libcxxabi/src/demangle/Utility.h
    M llvm/include/llvm/Demangle/Utility.h
    M llvm/lib/Demangle/MicrosoftDemangle.cpp
    M llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
    M llvm/unittests/Demangle/ItaniumDemangleTest.cpp
    M llvm/unittests/Demangle/OutputBufferTest.cpp

  Log Message:
  -----------
  [demangler] Add StringView conversion operator

The OutputBuffer class tries to present a NUL-terminated string API to
consumers.  But several of them would prefer a StringView.  In
particular the Microsoft demangler, juggles between NUL-terminated and
StringView, which is confusing.

This adds a StringView conversion, and adjusts the Demanglers that can
benefit from that.

Reviewed By: dblaikie

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




More information about the All-commits mailing list