[PATCH] D149784: [Damangle] convert rustDemangle to use std::string_view

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 14:10:01 PDT 2023


MaskRay accepted this revision.
MaskRay added a subscriber: labath.
MaskRay added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lldb/include/lldb/Utility/ConstString.h:186
   operator llvm::StringRef() const { return GetStringRef(); }
+  // Implicitly convert \class ConstString instances to \calss std::string_view.
+  operator std::string_view() const { return std::string_view(m_string, GetLength()); }
----------------
Perhaps I find the previous comment not useful as well `Implicitly convert \class ConstString instances to \class StringRef.`

If we want to emphasize that they are implicit conversions instead of explicit conversions (https://en.cppreference.com/w/cpp/language/cast_operator), a single comment `// Implicit conversion functions.` should suffice, covering all conversion functions.

@JDevlieghere @labath


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149784



More information about the llvm-commits mailing list