diff options
author | Sean Callanan <scallanan@apple.com> | 2010-11-19 02:52:21 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2010-11-19 02:52:21 +0000 |
commit | f7c3e27f62afe806af2f11f03531133e80abaee2 (patch) | |
tree | 08b794e817ad31ca7fe0fa5f9e3f3ce4354799db /lldb/source/Expression/ClangUserExpression.cpp | |
parent | b58867ccbad5c80afa4a2b23cbb39602063a6850 (diff) | |
download | bcm5719-llvm-f7c3e27f62afe806af2f11f03531133e80abaee2.tar.gz bcm5719-llvm-f7c3e27f62afe806af2f11f03531133e80abaee2.zip |
Added support for indicating to the expression parser
that the result of an expression should be coerced to
a specific type. Also made breakpoint conditions pass
in the bool type for this type.
The expression parser ignores this indication for now.
llvm-svn: 119779
Diffstat (limited to 'lldb/source/Expression/ClangUserExpression.cpp')
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index f3515289741..3e4827b9f0f 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -44,7 +44,8 @@ ClangUserExpression::ClangUserExpression (const char *expr, m_jit_addr(LLDB_INVALID_ADDRESS), m_cplusplus(false), m_objectivec(false), - m_needs_object_ptr(false) + m_needs_object_ptr(false), + m_desired_type(NULL, NULL) { } @@ -55,7 +56,8 @@ ClangUserExpression::~ClangUserExpression () clang::ASTConsumer * ClangUserExpression::ASTTransformer (clang::ASTConsumer *passthrough) { - return new ASTResultSynthesizer(passthrough); + return new ASTResultSynthesizer(passthrough, + m_desired_type); } void @@ -115,7 +117,9 @@ ApplyUnicharHack(std::string &expr) } bool -ClangUserExpression::Parse (Stream &error_stream, ExecutionContext &exe_ctx) +ClangUserExpression::Parse (Stream &error_stream, + ExecutionContext &exe_ctx, + TypeFromUser desired_type) { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); @@ -194,6 +198,8 @@ ClangUserExpression::Parse (Stream &error_stream, ExecutionContext &exe_ctx) // Parse the expression // + m_desired_type = desired_type; + m_expr_decl_map.reset(new ClangExpressionDeclMap(&exe_ctx)); ClangExpressionParser parser(target_triple.GetCString(), *this); @@ -452,7 +458,7 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, StreamString error_stream; - if (!user_expression.Parse (error_stream, exe_ctx)) + if (!user_expression.Parse (error_stream, exe_ctx, TypeFromUser(NULL, NULL))) { if (error_stream.GetString().empty()) error.SetErrorString ("expression failed to parse, unknown error"); |