[PATCH] D148546: Reland: [Demangle] replace use of llvm::StringView w/ std::string_view

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 02:50:54 PDT 2023


DavidSpickett accepted this revision.
DavidSpickett added a comment.
This revision is now accepted and ready to land.

I don't know enough to review the other patches but I understand the layering issue. So assuming the other patches are ok, this one LGTM.



================
Comment at: llvm/include/llvm/Demangle/ItaniumDemangle.h:1586
       // The instantiations are typedefs that drop the "basic_" prefix.
-      assert(SV.startsWith("basic_"));
+      assert(llvm::itanium_demangle::starts_with(SV, "basic_"));
       SV.remove_prefix(sizeof("basic_") - 1);
----------------
DavidSpickett wrote:
> Is this right? Not sure `itanium_demangle` makes sense here.
Answered.


================
Comment at: llvm/include/llvm/Demangle/ItaniumDemangle.h:2486
+  bool consumeIf(std::string_view S) {
+    if (llvm::itanium_demangle::starts_with(std::string_view(First, Last - First), S)) {
       First += S.size();
----------------
DavidSpickett wrote:
> Same here, namespace doesn't sound right.
Answered.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148546/new/

https://reviews.llvm.org/D148546



More information about the llvm-commits mailing list