[Lldb-commits] [lldb] [lldb] Remove ConstString from Language::MethodName (PR #218556)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 25 03:15:02 PDT 2026


================
@@ -24,7 +24,7 @@ class CPlusPlusLanguage : public Language {
 public:
   class CxxMethodName : public Language::MethodName {
   public:
-    CxxMethodName(ConstString s) : Language::MethodName(s) {}
+    CxxMethodName(std::string s) : Language::MethodName(s) {}
----------------
felipepiovezan wrote:

If this code is hot, I think we should have both `const string &` and `string &&` overloads. For example, this:

```
      CxxMethodName cxx_method(demangled_name.GetStringRef().str());
```

Is still creating an extra copy, even with Yao's suggestion.

https://github.com/llvm/llvm-project/pull/218556


More information about the lldb-commits mailing list