Fix up how the ValueObjects manage their life cycle so that you can hand out a shared
pointer to a ValueObject or any of its dependent ValueObjects, and the whole cluster will
stay around as long as that shared pointer stays around.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130035 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 0054a03..60a37bc 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -987,13 +987,13 @@
// If the reference comes from the program, then the ClangExpressionVariable's
// live variable data hasn't been set up yet. Do this now.
- var_sp->m_live_sp.reset(new lldb_private::ValueObjectConstResult(exe_ctx.GetBestExecutionContextScope (),
- var_sp->GetTypeFromUser().GetASTContext(),
- var_sp->GetTypeFromUser().GetOpaqueQualType(),
- var_sp->GetName(),
- mem,
- eAddressTypeLoad,
- pvar_byte_size));
+ var_sp->m_live_sp = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope (),
+ var_sp->GetTypeFromUser().GetASTContext(),
+ var_sp->GetTypeFromUser().GetOpaqueQualType(),
+ var_sp->GetName(),
+ mem,
+ eAddressTypeLoad,
+ pvar_byte_size);
}
if (!var_sp->m_live_sp)
@@ -1082,13 +1082,13 @@
// Put the location of the spare memory into the live data of the ValueObject.
- var_sp->m_live_sp.reset(new lldb_private::ValueObjectConstResult(exe_ctx.GetBestExecutionContextScope(),
- var_sp->GetTypeFromUser().GetASTContext(),
- var_sp->GetTypeFromUser().GetOpaqueQualType(),
- var_sp->GetName(),
- mem,
- eAddressTypeLoad,
- pvar_byte_size));
+ var_sp->m_live_sp = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(),
+ var_sp->GetTypeFromUser().GetASTContext(),
+ var_sp->GetTypeFromUser().GetOpaqueQualType(),
+ var_sp->GetName(),
+ mem,
+ eAddressTypeLoad,
+ pvar_byte_size);
// Clear the flag if the variable will never be deallocated.
@@ -1347,13 +1347,13 @@
// Put the location of the spare memory into the live data of the ValueObject.
- expr_var->m_live_sp.reset(new lldb_private::ValueObjectConstResult(exe_ctx.GetBestExecutionContextScope(),
- type.GetASTContext(),
- type.GetOpaqueQualType(),
- name,
- mem,
- eAddressTypeLoad,
- value_byte_size));
+ expr_var->m_live_sp = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(),
+ type.GetASTContext(),
+ type.GetOpaqueQualType(),
+ name,
+ mem,
+ eAddressTypeLoad,
+ value_byte_size);
// Now write the location of the area into the struct.