Fixed a problem with the IR interpreter that caused
it to generate result variables that were not bound
to their underlying data.  This allowed the SBValue
class to use the interpreter (if possible).

Also made sure that any result variables that point
to stack allocations in the stack frame of the
interpreted expressions do not get live data.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140285 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRInterpreter.cpp b/source/Expression/IRInterpreter.cpp
index 0246245..6ae1841 100644
--- a/source/Expression/IRInterpreter.cpp
+++ b/source/Expression/IRInterpreter.cpp
@@ -717,6 +717,8 @@
         
         lldb_private::Value base;
         
+        bool transient = false;
+        
         if (m_decl_map.ResultIsReference(result_name))
         {
             PointerType *R_ptr_ty = dyn_cast<PointerType>(R_ty);           
@@ -737,6 +739,9 @@
             if (!R_final.m_allocation)
                 return false;
             
+            if (R_final.m_allocation->m_data)
+                transient = true; // this is a stack allocation
+            
             base = R_final.m_allocation->m_origin;
             base.GetScalar() += (R_final.m_base - R_final.m_allocation->m_virtual_address);
         }
@@ -747,7 +752,7 @@
             base.GetScalar() = (unsigned long long)R.m_allocation->m_data->GetBytes() + (R.m_base - R.m_allocation->m_virtual_address);
         }                     
                         
-        return m_decl_map.CompleteResultVariable (result, base, result_name, result_type);
+        return m_decl_map.CompleteResultVariable (result, base, result_name, result_type, transient);
     }
 };