diff options
author | Greg Clayton <gclayton@apple.com> | 2015-02-12 00:34:25 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-02-12 00:34:25 +0000 |
commit | 526ae040bab73b5c9ae273d499a1ab8cb5fb0381 (patch) | |
tree | 6230dad5200ab6945fe18d81874c463dcfd0bd1c /lldb/source/Expression/IRForTarget.cpp | |
parent | 36f807c8603b170ad71e0f15ec0279aa1c40384c (diff) | |
download | bcm5719-llvm-526ae040bab73b5c9ae273d499a1ab8cb5fb0381.tar.gz bcm5719-llvm-526ae040bab73b5c9ae273d499a1ab8cb5fb0381.zip |
Make a more complete fix for always supplying an execution context when getting byte sizes from types.
There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime.
Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use.
llvm-svn: 228892
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 42390b35fdd..7951812cb7e 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -59,7 +59,8 @@ IRForTarget::FunctionValueCache::~FunctionValueCache() { } -llvm::Value *IRForTarget::FunctionValueCache::GetValue(llvm::Function *function) +llvm::Value * +IRForTarget::FunctionValueCache::GetValue(llvm::Function *function) { if (!m_values.count(function)) { @@ -70,7 +71,8 @@ llvm::Value *IRForTarget::FunctionValueCache::GetValue(llvm::Function *function) return m_values[function]; } -lldb::addr_t IRForTarget::StaticDataAllocator::Allocate() +lldb::addr_t +IRForTarget::StaticDataAllocator::Allocate() { lldb_private::Error err; @@ -85,7 +87,14 @@ lldb::addr_t IRForTarget::StaticDataAllocator::Allocate() return m_allocation; } -static llvm::Value *FindEntryInstruction (llvm::Function *function) +lldb::TargetSP +IRForTarget::StaticDataAllocator::GetTarget() +{ + return m_execution_unit.GetTarget(); +} + +static llvm::Value * +FindEntryInstruction (llvm::Function *function) { if (function->empty()) return NULL; @@ -590,7 +599,10 @@ IRForTarget::CreateResultVariable (llvm::Function &llvm_function) &result_decl->getASTContext()); } - if (m_result_type.GetBitSize(nullptr) == 0) + + lldb::TargetSP target_sp (m_data_allocator.GetTarget()); + lldb_private::ExecutionContext exe_ctx (target_sp.get(), true); + if (m_result_type.GetBitSize(exe_ctx.GetBestExecutionContextScope()) == 0) { lldb_private::StreamString type_desc_stream; m_result_type.DumpTypeDescription(&type_desc_stream); |