[Lldb-commits] [lldb] [lldb] Reduce size of Mangled class (PR #200181)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Thu May 28 06:54:34 PDT 2026


================
@@ -279,7 +301,7 @@ class Mangled {
   void Encode(DataEncoder &encoder, ConstStringTable &strtab) const;
 
   /// Retrieve \c DemangledNameInfo of the demangled name held by this object.
-  const std::optional<DemangledNameInfo> &GetDemangledInfo() const;
+  const std::optional<DemangledNameInfo> GetDemangledInfo() const;
----------------
Michael137 wrote:

Could probably get away with still returning a reference if we kept an empty static local and returned a reference to that. Not sure it's worth it though, since the struct isn't really that big.

If returning by value, best to drop the const on the return type here

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


More information about the lldb-commits mailing list