diff --git a/lldb/include/lldb/Expression/ExpressionVariable.h b/lldb/include/lldb/Expression/ExpressionVariable.h --- a/lldb/include/lldb/Expression/ExpressionVariable.h +++ b/lldb/include/lldb/Expression/ExpressionVariable.h @@ -221,7 +221,7 @@ uint32_t addr_byte_size) = 0; /// Return a new persistent variable name with the specified prefix. - virtual ConstString GetNextPersistentVariableName(bool is_error = false) = 0; + virtual std::string GetNextPersistentVariableName(bool is_error = false) = 0; virtual void RemovePersistentVariable(lldb::ExpressionVariableSP variable) = 0; diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -3143,10 +3143,10 @@ if (!persistent_state) return nullptr; - ConstString name = persistent_state->GetNextPersistentVariableName(); + const std::string name = persistent_state->GetNextPersistentVariableName(); - ValueObjectSP const_result_sp = - ValueObjectConstResult::Create(target_sp.get(), GetValue(), name); + ValueObjectSP const_result_sp = ValueObjectConstResult::Create( + target_sp.get(), GetValue(), ConstString(name)); ExpressionVariableSP persistent_var_sp = persistent_state->CreatePersistentVariable(const_result_sp); diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -1041,9 +1041,10 @@ return; } - ConstString name = m_delegate - ? m_delegate->GetName() - : persistent_state->GetNextPersistentVariableName(); + ConstString name = + m_delegate + ? m_delegate->GetName() + : ConstString(persistent_state->GetNextPersistentVariableName()); lldb::ExpressionVariableSP ret = persistent_state->CreatePersistentVariable( exe_scope, name, m_type, map.GetByteOrder(), map.GetAddressByteSize()); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h @@ -55,7 +55,7 @@ void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override; - ConstString GetNextPersistentVariableName(bool is_error = false) override; + std::string GetNextPersistentVariableName(bool is_error = false) override; /// Returns the next file name that should be used for user expressions. std::string GetNextExprFileName() { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp @@ -124,7 +124,7 @@ return m_modules_decl_vendor_sp; } -ConstString +std::string ClangPersistentVariables::GetNextPersistentVariableName(bool is_error) { llvm::SmallString<64> name; { @@ -132,5 +132,5 @@ os << GetPersistentVariablePrefix(is_error) << m_next_persistent_variable_id++; } - return ConstString(name); + return std::string(name); } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -1015,7 +1015,7 @@ } ConstString ClangUserExpression::ResultDelegate::GetName() { - return m_persistent_state->GetNextPersistentVariableName(false); + return ConstString(m_persistent_state->GetNextPersistentVariableName(false)); } void ClangUserExpression::ResultDelegate::DidDematerialize( diff --git a/lldb/source/Target/ABI.cpp b/lldb/source/Target/ABI.cpp --- a/lldb/source/Target/ABI.cpp +++ b/lldb/source/Target/ABI.cpp @@ -93,8 +93,8 @@ if (!persistent_expression_state) return {}; - ConstString persistent_variable_name = - persistent_expression_state->GetNextPersistentVariableName(); + ConstString persistent_variable_name = ConstString( + persistent_expression_state->GetNextPersistentVariableName()); lldb::ValueObjectSP const_valobj_sp;