From 8f1f9a1be30ff0e260f451f18712dff7fa9a7273 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Wed, 30 Sep 2015 19:57:57 +0000 Subject: Now persistent expression data no longer lives with the Target, but rather with the corresponding TypeSystem. This makes sense because what kind of data there is -- and how it can be looked up -- depends on the language. Functionality that is common to all type systems is factored out into PersistentExpressionState. llvm-svn: 248934 --- lldb/source/Expression/Materializer.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'lldb/source/Expression/Materializer.cpp') diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index f7c9e2c623a..ebdad184e55 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -11,8 +11,7 @@ #include "lldb/Core/RegisterValue.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/Core/ValueObjectVariable.h" -#include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h" -#include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h" +#include "lldb/Expression/ExpressionVariable.h" #include "lldb/Expression/Materializer.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/Symbol.h" @@ -858,9 +857,25 @@ public: return; } - ConstString name = target_sp->GetPersistentVariables().GetNextPersistentVariableName(); + TypeSystem *type_system = target_sp->GetScratchTypeSystemForLanguage(m_type.GetMinimumLanguage()); - lldb::ExpressionVariableSP ret = ClangExpressionVariable::CreateVariableInList(target_sp->GetPersistentVariables(), + if (!type_system) + { + err.SetErrorString("Couldn't dematerialize a result variable: couldn't get the corresponding type system"); + return; + } + + PersistentExpressionState *persistent_state = type_system->GetPersistentExpressionState(); + + if (!persistent_state) + { + err.SetErrorString("Couldn't dematerialize a result variable: corresponding type system doesn't handle persistent variables"); + return; + } + + ConstString name = persistent_state->GetNextPersistentVariableName(); + + lldb::ExpressionVariableSP ret = ClangExpressionVariable::CreateVariableInList(*persistent_state, exe_scope, name, m_type, -- cgit v1.2.3