summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-03-22 21:05:51 +0000
committerSean Callanan <scallanan@apple.com>2016-03-22 21:05:51 +0000
commit00294b34a3c99f3540214a148c0bd15e68f9d7fd (patch)
treea6892887ee99bed68154d36a82a975d01ec566a1 /lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
parente32368fc6edd4f1c284a9ba0cbdd6b8931dbe925 (diff)
downloadbcm5719-llvm-00294b34a3c99f3540214a148c0bd15e68f9d7fd.tar.gz
bcm5719-llvm-00294b34a3c99f3540214a148c0bd15e68f9d7fd.zip
Backend support for top-level Clang epxressions
This patch adds a new ExecutionPolicy, eExecutionPolicyTopLevel, which tells the expression parser that the expression should be JITted as top level code but nothing (except static initializers) should be run. I have modified the Clang expression parser to recognize this execution policy. On top of the existing patches that support storing IR and maintaining a map of arbitrary Decls, this is mainly just patching up a few places in the expression parser. I intend to submit a patch for review that exposes this functionality through the "expression" command and through the SB API. That patch also includes a testcase for all of this. <rdar://problem/22864976> llvm-svn: 264095
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
index 3177da358af..6077588b024 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -51,13 +51,10 @@ public:
class ClangUserExpressionHelper : public ClangExpressionHelper
{
public:
- ClangUserExpressionHelper (Target &target) :
- m_target(target)
- {
- }
-
+ ClangUserExpressionHelper(Target &target, bool top_level) : m_target(target), m_top_level(top_level) {}
+
~ClangUserExpressionHelper() override = default;
-
+
//------------------------------------------------------------------
/// Return the object that the parser should use when resolving external
/// values. May be NULL if everything should be self-contained.
@@ -88,11 +85,16 @@ public:
clang::ASTConsumer *
ASTTransformer(clang::ASTConsumer *passthrough) override;
+ void
+ CommitPersistentDecls() override;
+
private:
- Target &m_target;
+ Target &m_target;
std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map_up;
- std::unique_ptr<ASTStructExtractor> m_struct_extractor_up; ///< The class that generates the argument struct layout.
+ std::unique_ptr<ASTStructExtractor>
+ m_struct_extractor_up; ///< The class that generates the argument struct layout.
std::unique_ptr<ASTResultSynthesizer> m_result_synthesizer_up;
+ bool m_top_level;
};
//------------------------------------------------------------------
OpenPOWER on IntegriCloud