diff options
author | Sean Callanan <scallanan@apple.com> | 2015-10-03 09:09:01 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2015-10-03 09:09:01 +0000 |
commit | 9fda9d2177abd04e272d0f512555d3eca9e36426 (patch) | |
tree | 6f6547a919e7e5fd8ad46fc728667ca865300474 /lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h | |
parent | 5860fe1bfba1561a7115e7bc0be2892eb0817013 (diff) | |
download | bcm5719-llvm-9fda9d2177abd04e272d0f512555d3eca9e36426.tar.gz bcm5719-llvm-9fda9d2177abd04e272d0f512555d3eca9e36426.zip |
Add PersistentVariableDelegate to handle language-specific dematerialization.
The concept here is that languages may have different ways of communicating
results. In particular, languages may have different names for their result
variables and in fact may have multiple types of result variables (e.g.,
error results). Materializer was tied to one specific model of result handling.
Instead, now UserExpressions can register their own handlers for the result
variables they inject. This allows language-specific code in Materializer to
be moved into the expression parser plug-in, and it simplifies Materializer.
These delegates are subclasses of PersistentVariableDelegate.
PersistentVariableDelegate can provide the name of the result variable, and is
notified when the result variable is populated. It can also be used to touch
persistent variables if need be, updating language-specific state. The
UserExpression owns the delegate and can decide on its result based on
consulting all of its (potentially multiple) delegates.
The user expression itself now makes the determination of what the final result
of the expression is, rather than relying on the Materializer, and I've added a
virtual function to UserExpression to allow this.
llvm-svn: 249233
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h')
-rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h index 1ed2c4e3f20..a8b874d8c34 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -71,10 +71,15 @@ public: /// the result persistent variable, and instead marks the variable /// as persisting. /// + /// @param[in] delegate + /// If non-NULL, use this delegate to report result values. This + /// allows the client ClangUserExpression to report a result. + /// /// @param[in] exe_ctx /// The execution context to use when parsing. //------------------------------------------------------------------ ClangExpressionDeclMap (bool keep_result_in_memory, + Materializer::PersistentVariableDelegate *result_delegate, ExecutionContext &exe_ctx); //------------------------------------------------------------------ @@ -391,6 +396,7 @@ private: ExpressionVariableList m_found_entities; ///< All entities that were looked up for the parser. ExpressionVariableList m_struct_members; ///< All entities that need to be placed in the struct. bool m_keep_result_in_memory; ///< True if result persistent variables generated by this expression should stay in memory. + Materializer::PersistentVariableDelegate *m_result_delegate; ///< If non-NULL, used to report expression results to ClangUserExpression. //---------------------------------------------------------------------- /// The following values should not live beyond parsing |