summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-07-03 01:35:46 +0000
committerSean Callanan <scallanan@apple.com>2010-07-03 01:35:46 +0000
commit2ab712f2126397c7fafad47ea233ce56e28d17ef (patch)
tree2e36e8f5984b21d5c7108a526be322df00bf578c /lldb/source/Commands/CommandObjectExpression.cpp
parentbc75502f095825f5786f8a6aa0ce99e98dc68c95 (diff)
downloadbcm5719-llvm-2ab712f2126397c7fafad47ea233ce56e28d17ef.tar.gz
bcm5719-llvm-2ab712f2126397c7fafad47ea233ce56e28d17ef.zip
Added the skeleton of an IR transformer that will
prepare IR for execution in the target. Wired the expression command to use this IR transformer when conversion to DWARF fails, and wired conversion to DWARF to always fail (well, we don't generate any DWARF...) llvm-svn: 107559
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 64106eda2d0..37659f5e697 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -252,11 +252,29 @@ CommandObjectExpression::EvaluateExpression (const char *expr, bool bare, Stream
ClangExpressionVariableList expr_local_vars;
bool success;
+ bool canInterpret = false;
if (m_options.use_ir)
- success = (clang_expr.ConvertIRToDWARF (expr_local_vars, dwarf_opcodes) == 0);
+ {
+ canInterpret = clang_expr.ConvertIRToDWARF (expr_local_vars, dwarf_opcodes);
+
+ if (canInterpret)
+ {
+ if (log)
+ log->Printf("Code can be interpreted.");
+ success = true;
+ }
+ else
+ {
+ if (log)
+ log->Printf("Code cannot be interpreted and must be run in the target.");
+ success = clang_expr.PrepareIRForTarget (expr_local_vars);
+ }
+ }
else
+ {
success = (clang_expr.ConvertExpressionToDWARF (expr_local_vars, dwarf_opcodes) == 0);
+ }
if (!success)
{
OpenPOWER on IntegriCloud