[PATCH] D120990: [demangler] Add StringView conversion operator

Nathan Sidwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 05:14:34 PST 2022


urnathan created this revision.
urnathan added reviewers: bruno, iains.
Herald added a subscriber: hiraditya.
Herald added a project: All.
urnathan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D120990

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120990.412987.patch
Type: text/x-patch
Size: 4588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220304/f39c18b7/attachment.bin>


More information about the llvm-commits mailing list