Stop calling ValueObject::SetName from synthetic child providers

Summary:
Calling ValueObject::SetName from a sythetic child provider would change
the underying value object used for the non-synthetic child as well what
is clearly unintentional.

Reviewers: jingham, labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D31371

llvm-svn: 299259
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
index 8d7ce65..7693961 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -70,19 +70,19 @@
   std::unique_ptr<SyntheticChildrenFrontEnd> tuple_frontend(
       LibStdcppTupleSyntheticFrontEndCreator(nullptr, tuple_sp));
 
-  m_ptr_obj = tuple_frontend->GetChildAtIndex(0);
-  if (m_ptr_obj)
-    m_ptr_obj->SetName(ConstString("pointer"));
+  ValueObjectSP ptr_obj = tuple_frontend->GetChildAtIndex(0);
+  if (ptr_obj)
+    m_ptr_obj = ptr_obj->Clone(ConstString("pointer"));
 
-  m_del_obj = tuple_frontend->GetChildAtIndex(1);
-  if (m_del_obj)
-    m_del_obj->SetName(ConstString("deleter"));
+  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+  if (del_obj)
+    m_del_obj = del_obj->Clone(ConstString("deleter"));
 
   if (m_ptr_obj) {
     Error error;
-    m_obj_obj = m_ptr_obj->Dereference(error);
+    ValueObjectSP obj_obj = m_ptr_obj->Dereference(error);
     if (error.Success()) {
-      m_obj_obj->SetName(ConstString("object"));
+      m_obj_obj = obj_obj->Clone(ConstString("object"));
     }
   }