summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRInterpreter.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2013-06-27 01:59:51 +0000
committerSean Callanan <scallanan@apple.com>2013-06-27 01:59:51 +0000
commit85fc876106c98ee025507269911c9723fce53de9 (patch)
tree22ae376971bf256656ef5126162d01a04881cd5b /lldb/source/Expression/IRInterpreter.cpp
parent64cf3efd47bc79b661c93cea5a7a3fa60bba16d8 (diff)
downloadbcm5719-llvm-85fc876106c98ee025507269911c9723fce53de9.tar.gz
bcm5719-llvm-85fc876106c98ee025507269911c9723fce53de9.zip
Fixed the IRInterpreter to reject any code that
has more than one function with a body. This prevents declarations e.g. of blocks from being passed to the IRInterpreter; they must pass through to the JIT. <rdar://problem/14180236> llvm-svn: 185057
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index 449f0e8bef4..dcbf584cfb6 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -428,6 +428,20 @@ IRInterpreter::CanInterpret (llvm::Module &module,
{
lldb_private::Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+ bool saw_function_with_body = false;
+
+ for (Module::iterator fi = module.begin(), fe = module.end();
+ fi != fe;
+ ++fi)
+ {
+ if (fi->begin() != fi->end())
+ {
+ if (saw_function_with_body)
+ return false;
+ saw_function_with_body = true;
+ }
+ }
+
for (Function::iterator bbi = function.begin(), bbe = function.end();
bbi != bbe;
++bbi)
OpenPOWER on IntegriCloud