[Lldb-commits] [PATCH] D152324: [lldb][NFCI] Change return type of PersistentExpressionState::GetNextPersistentVariableName

Felipe de Azevedo Piovezan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 8 03:40:52 PDT 2023


fdeazeve accepted this revision.
fdeazeve added inline comments.


================
Comment at: lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp:129-134
   llvm::SmallString<64> name;
   {
     llvm::raw_svector_ostream os(name);
     os << GetPersistentVariablePrefix(is_error)
        << m_next_persistent_variable_id++;
   }
----------------
JDevlieghere wrote:
> If we're going to return a `std::string`, we might as well use a `raw_string_ostream` and simplify this function. 
+1, we can avoid the conversion of SmallString->std::string (and enable copy elision) by declaring `name` as std::string

(we don't necessarily need to do it in this patch though, either way is fine IMO)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152324



More information about the lldb-commits mailing list