Author: Michael Buch
Date: 2025-10-01T16:26:55+01:00
New Revision: f33564b9afaa34ffd92b754db7a5ff8ff5e60897

URL: 
https://github.com/llvm/llvm-project/commit/f33564b9afaa34ffd92b754db7a5ff8ff5e60897
DIFF: 
https://github.com/llvm/llvm-project/commit/f33564b9afaa34ffd92b754db7a5ff8ff5e60897.diff

LOG: [lldb][NFCI] Remove the non-const reference Mangled::GetMangledName 
accessor (#161495)

We've been seen (very sporadic) lifetime issues around this area. We
noticed that `GetMangledName` has two accessors, one of which returns a
non-const reference. I audited all the callsites and no users of this
overload actually mutate the `ConstString` itself (which is a suspicious
thing to do anyway since it's just a wrapper around a `const char*`).

This patch removes the redundant overload.

rdar://161128180

Added: 
    

Modified: 
    lldb/include/lldb/Core/Mangled.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/Mangled.h 
b/lldb/include/lldb/Core/Mangled.h
index 665accb3119e3..546d7a9b409ed 100644
--- a/lldb/include/lldb/Core/Mangled.h
+++ b/lldb/include/lldb/Core/Mangled.h
@@ -148,13 +148,7 @@ class Mangled {
   /// Mangled name get accessor.
   ///
   /// \return
-  ///     A reference to the mangled name string object.
-  ConstString &GetMangledName() { return m_mangled; }
-
-  /// Mangled name get accessor.
-  ///
-  /// \return
-  ///     A const reference to the mangled name string object.
+  ///     The mangled name string object.
   ConstString GetMangledName() const { return m_mangled; }
 
   /// Best name get accessor.


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to