Made the IR interpreter more robust in the presence
of arbitrary pointers, allowing direct dereferences
of literal addresses.  Also disabled special-cased
generation of certain expression results (especially
casts), substituting the IR interpreter.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142638 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index fee1ddb..d02a1a7 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -350,7 +350,8 @@
                                                 lldb_private::Value &value,
                                                 const ConstString &name,
                                                 lldb_private::TypeFromParser type,
-                                                bool transient)
+                                                bool transient,
+                                                bool maybe_make_load)
 {
     assert (m_parser_vars.get());
         
@@ -358,6 +359,14 @@
     
     if (!pvar_sp)
         return false;
+        
+    if (maybe_make_load && 
+        value.GetValueType() == Value::eValueTypeFileAddress &&
+        m_parser_vars->m_exe_ctx && 
+        m_parser_vars->m_exe_ctx->GetProcessPtr())
+    {
+        value.SetValueType(Value::eValueTypeLoadAddress);
+    }
     
     if (pvar_sp->m_flags & ClangExpressionVariable::EVIsProgramReference &&
         !pvar_sp->m_live_sp &&
@@ -782,6 +791,23 @@
 
 // Interface for IRInterpreter
 
+Value 
+ClangExpressionDeclMap::WrapBareAddress (lldb::addr_t addr)
+{
+    Value ret;
+
+    ret.SetContext(Value::eContextTypeInvalid, NULL);
+
+    if (m_parser_vars->m_exe_ctx && m_parser_vars->m_exe_ctx->GetProcessPtr())
+        ret.SetValueType(Value::eValueTypeLoadAddress);
+    else
+        ret.SetValueType(Value::eValueTypeFileAddress);
+
+    ret.GetScalar() = (unsigned long long)addr;
+
+    return ret;
+}
+
 bool
 ClangExpressionDeclMap::WriteTarget (lldb_private::Value &value,
                                      const uint8_t *data,