summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRInterpreter.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-02-04 08:49:35 +0000
committerSean Callanan <scallanan@apple.com>2012-02-04 08:49:35 +0000
commit5b26f27f465676684f9440f02ac4e84a252f5bbb (patch)
tree573b886fcfcf80d6be527eaf3444361b51a7466e /lldb/source/Expression/IRInterpreter.cpp
parentbdce3885c4e1c1b96d30cf76d005d661401fbe03 (diff)
downloadbcm5719-llvm-5b26f27f465676684f9440f02ac4e84a252f5bbb.tar.gz
bcm5719-llvm-5b26f27f465676684f9440f02ac4e84a252f5bbb.zip
I have brought LLDB up-to-date with top of tree
LLVM/Clang. This brings in several fixes, including: - Improvements in the Just-In-Time compiler's allocation of memory: the JIT now allocates memory in chunks of sections, improving its ability to generate relocations. I have revamped the RecordingMemoryManager to reflect these changes, as well as to get the memory allocation and data copying out fo the ClangExpressionParser code. Jim Grosbach wrote the updates to the JIT on the LLVM side. - A new ExternalASTSource interface to allow LLDB to report accurate structure layout information to Clang. Previously we could only report the sizes of fields, not their offsets. This meant that if data structures included field alignment directives, we could not communicate the necessary alignment to Clang and accesses to the data would fail. Now we can (and I have update the relevant test case). Thanks to Doug Gregor for implementing the Clang side of this fix. - The way Objective-C interfaces are completed by Clang has been made consistent with RecordDecls; with help from Doug Gregor and Greg Clayton I have ensured that this still works. - I have eliminated all local LLVM and Clang patches, committing the ones that are still relevant to LLVM and Clang as needed. I have tested the changes extensively locally, but please let me know if they cause any trouble for you. llvm-svn: 149775
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index a7ca4c86581..741f27ea329 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -873,6 +873,7 @@ static const char *memory_allocation_error = "Interpreter couldn't allo
static const char *memory_write_error = "Interpreter couldn't write to memory";
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";
bool
IRInterpreter::supportsFunction (Function &llvm_function,
@@ -1524,7 +1525,17 @@ IRInterpreter::runOnFunction (lldb::ClangExpressionVariableSP &result,
return true;
GlobalValue *result_value = llvm_module.getNamedValue(result_name.GetCString());
- return frame.ConstructResult(result, result_value, result_name, result_type, llvm_module);
+
+ if (!frame.ConstructResult(result, result_value, result_name, result_type, llvm_module))
+ {
+ if (log)
+ log->Printf("Couldn't construct the expression's result");
+ err.SetErrorToGenericError();
+ err.SetErrorString(bad_result_error);
+ return false;
+ }
+
+ return true;
}
case Instruction::Store:
{
OpenPOWER on IntegriCloud