diff options
author | Adrian McCarthy <amccarth@google.com> | 2016-05-04 23:32:35 +0000 |
---|---|---|
committer | Adrian McCarthy <amccarth@google.com> | 2016-05-04 23:32:35 +0000 |
commit | 3f99810787978140ff5898284a9f08a7f559f9e6 (patch) | |
tree | 46c5ac2e2f8959f08d7eecc429dc8bf808c1a01f /lldb/source/Expression/IRInterpreter.cpp | |
parent | 9de88d9bbef514125d0e1bd2f5b9d3a2dd43c631 (diff) | |
download | bcm5719-llvm-3f99810787978140ff5898284a9f08a7f559f9e6.tar.gz bcm5719-llvm-3f99810787978140ff5898284a9f08a7f559f9e6.zip |
XFail TestLambdas.py on Windows after fixing some of the problems
1. Fixed semicolon placement in the lambda in the test itself.
2. Fixed lldbinline tests in general so that we don't attempt tests on platforms that don't use the given type of debug info. (For example, no DWO tests on Windows.) This fixes one of the two failures on Windows. (TestLambdas.py was the only inline test that wasn't XFailed or skipped on Windows.)
3. Set the error string in IRInterpreter::CanInterpret so that the caller doesn't print (null) instead of an explanation. I don't entirely understand the error, so feel free to suggest a better wording.
4. XFailed the test on Windows. The interpreter won't evaluate the lambda because the module has multiple function bodies. I don't exactly understand why that's a problem for the interpreter nor why the problem arises only on Windows.
Differential Revision: http://reviews.llvm.org/D19606
llvm-svn: 268573
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r-- | lldb/source/Expression/IRInterpreter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp index 2871a066013..42d6dc116f9 100644 --- a/lldb/source/Expression/IRInterpreter.cpp +++ b/lldb/source/Expression/IRInterpreter.cpp @@ -477,6 +477,7 @@ static const char *memory_write_error = "Interpreter couldn't writ static const char *memory_read_error = "Interpreter couldn't read from memory"; static const char *infinite_loop_error = "Interpreter ran for too many cycles"; //static const char *bad_result_error = "Result of expression is in bad memory"; +static const char *too_many_functions_error = "Interpreter doesn't handle modules with multiple function bodies."; static bool CanResolveConstant (llvm::Constant *constant) @@ -506,7 +507,7 @@ CanResolveConstant (llvm::Constant *constant) Constant *base = dyn_cast<Constant>(*op_cursor); if (!base) return false; - + return CanResolveConstant(base); } } @@ -535,7 +536,13 @@ IRInterpreter::CanInterpret (llvm::Module &module, if (fi->begin() != fi->end()) { if (saw_function_with_body) + { + if (log) + log->Printf("More than one function in the module has a body"); + error.SetErrorToGenericError(); + error.SetErrorString(too_many_functions_error); return false; + } saw_function_with_body = true; } } @@ -664,7 +671,7 @@ IRInterpreter::CanInterpret (llvm::Module &module, return false; } } - + if (Constant *constant = llvm::dyn_cast<Constant>(operand)) { if (!CanResolveConstant(constant)) @@ -680,7 +687,8 @@ IRInterpreter::CanInterpret (llvm::Module &module, } - return true;} + return true; +} bool IRInterpreter::Interpret (llvm::Module &module, |