Raphael Isemann | 8081428 | 2020-01-24 08:23:27 +0100 | [diff] [blame] | 1 | //===-- ValueObjectConstResult.cpp ----------------------------------------===// |
Greg Clayton | 1d3afba | 2010-10-05 00:00:42 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Greg Clayton | 1d3afba | 2010-10-05 00:00:42 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "lldb/Core/ValueObjectConstResult.h" |
| 10 | |
Greg Clayton | 9407302 | 2012-07-07 01:22:45 +0000 | [diff] [blame] | 11 | #include "lldb/Core/ValueObjectDynamicValue.h" |
Zachary Turner | 2f3df61 | 2017-04-06 21:28:29 +0000 | [diff] [blame] | 12 | #include "lldb/Symbol/CompilerType.h" |
| 13 | #include "lldb/Target/ExecutionContext.h" |
Jonas Devlieghere | 672d2c1 | 2018-11-11 23:16:43 +0000 | [diff] [blame] | 14 | #include "lldb/Target/ExecutionContextScope.h" |
Zachary Turner | 2f3df61 | 2017-04-06 21:28:29 +0000 | [diff] [blame] | 15 | #include "lldb/Target/Process.h" |
Jonas Devlieghere | 672d2c1 | 2018-11-11 23:16:43 +0000 | [diff] [blame] | 16 | #include "lldb/Utility/DataBuffer.h" |
| 17 | #include "lldb/Utility/DataBufferHeap.h" |
Zachary Turner | 666cc0b | 2017-03-04 01:30:05 +0000 | [diff] [blame] | 18 | #include "lldb/Utility/DataExtractor.h" |
Jonas Devlieghere | 672d2c1 | 2018-11-11 23:16:43 +0000 | [diff] [blame] | 19 | #include "lldb/Utility/Scalar.h" |
Greg Clayton | 1d3afba | 2010-10-05 00:00:42 +0000 | [diff] [blame] | 20 | |
Zachary Turner | 2f3df61 | 2017-04-06 21:28:29 +0000 | [diff] [blame] | 21 | namespace lldb_private { |
| 22 | class Module; |
| 23 | } |
Greg Clayton | 1d3afba | 2010-10-05 00:00:42 +0000 | [diff] [blame] | 24 | |
| 25 | using namespace lldb; |
| 26 | using namespace lldb_private; |
| 27 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 28 | ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope, |
| 29 | ByteOrder byte_order, |
| 30 | uint32_t addr_byte_size, |
| 31 | lldb::addr_t address) { |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 32 | auto manager_sp = ValueObjectManager::Create(); |
| 33 | return (new ValueObjectConstResult(exe_scope, *manager_sp, byte_order, |
| 34 | addr_byte_size, address)) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 35 | ->GetSP(); |
Jim Ingham | 58b59f9 | 2011-04-22 23:53:53 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 38 | ValueObjectConstResult::ValueObjectConstResult(ExecutionContextScope *exe_scope, |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 39 | ValueObjectManager &manager, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 40 | ByteOrder byte_order, |
| 41 | uint32_t addr_byte_size, |
| 42 | lldb::addr_t address) |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 43 | : ValueObject(exe_scope, manager), m_impl(this, address) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 44 | SetIsConstant(); |
| 45 | SetValueIsValid(true); |
| 46 | m_data.SetByteOrder(byte_order); |
| 47 | m_data.SetAddressByteSize(addr_byte_size); |
| 48 | SetAddressTypeOfChildren(eAddressTypeLoad); |
Greg Clayton | 8b2fe6d | 2010-12-14 02:59:59 +0000 | [diff] [blame] | 49 | } |
| 50 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 51 | ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope, |
| 52 | const CompilerType &compiler_type, |
Adrian Prantl | 0e4c482 | 2019-03-06 21:22:25 +0000 | [diff] [blame] | 53 | ConstString name, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 54 | const DataExtractor &data, |
| 55 | lldb::addr_t address) { |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 56 | auto manager_sp = ValueObjectManager::Create(); |
| 57 | return (new ValueObjectConstResult(exe_scope, *manager_sp, compiler_type, |
| 58 | name, data, address)) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 59 | ->GetSP(); |
Jim Ingham | 58b59f9 | 2011-04-22 23:53:53 +0000 | [diff] [blame] | 60 | } |
| 61 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 62 | ValueObjectConstResult::ValueObjectConstResult( |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 63 | ExecutionContextScope *exe_scope, ValueObjectManager &manager, |
| 64 | const CompilerType &compiler_type, ConstString name, |
| 65 | const DataExtractor &data, lldb::addr_t address) |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 66 | : ValueObject(exe_scope, manager), m_impl(this, address) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 67 | m_data = data; |
| 68 | |
| 69 | if (!m_data.GetSharedDataBuffer()) { |
| 70 | DataBufferSP shared_data_buffer( |
| 71 | new DataBufferHeap(data.GetDataStart(), data.GetByteSize())); |
| 72 | m_data.SetData(shared_data_buffer); |
| 73 | } |
| 74 | |
| 75 | m_value.GetScalar() = (uintptr_t)m_data.GetDataStart(); |
| 76 | m_value.SetValueType(Value::eValueTypeHostAddress); |
| 77 | m_value.SetCompilerType(compiler_type); |
| 78 | m_name = name; |
| 79 | SetIsConstant(); |
| 80 | SetValueIsValid(true); |
| 81 | SetAddressTypeOfChildren(eAddressTypeLoad); |
| 82 | } |
| 83 | |
| 84 | ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope, |
| 85 | const CompilerType &compiler_type, |
Adrian Prantl | 0e4c482 | 2019-03-06 21:22:25 +0000 | [diff] [blame] | 86 | ConstString name, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 87 | const lldb::DataBufferSP &data_sp, |
| 88 | lldb::ByteOrder data_byte_order, |
| 89 | uint32_t data_addr_size, |
| 90 | lldb::addr_t address) { |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 91 | auto manager_sp = ValueObjectManager::Create(); |
| 92 | return (new ValueObjectConstResult(exe_scope, *manager_sp, compiler_type, |
| 93 | name, data_sp, data_byte_order, |
| 94 | data_addr_size, address)) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 95 | ->GetSP(); |
| 96 | } |
| 97 | |
| 98 | ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope, |
| 99 | Value &value, |
Adrian Prantl | 0e4c482 | 2019-03-06 21:22:25 +0000 | [diff] [blame] | 100 | ConstString name, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 101 | Module *module) { |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 102 | auto manager_sp = ValueObjectManager::Create(); |
| 103 | return (new ValueObjectConstResult(exe_scope, *manager_sp, value, name, |
| 104 | module)) |
| 105 | ->GetSP(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | ValueObjectConstResult::ValueObjectConstResult( |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 109 | ExecutionContextScope *exe_scope, ValueObjectManager &manager, |
| 110 | const CompilerType &compiler_type, ConstString name, |
| 111 | const lldb::DataBufferSP &data_sp, lldb::ByteOrder data_byte_order, |
| 112 | uint32_t data_addr_size, lldb::addr_t address) |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 113 | : ValueObject(exe_scope, manager), m_impl(this, address) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 114 | m_data.SetByteOrder(data_byte_order); |
| 115 | m_data.SetAddressByteSize(data_addr_size); |
| 116 | m_data.SetData(data_sp); |
| 117 | m_value.GetScalar() = (uintptr_t)data_sp->GetBytes(); |
| 118 | m_value.SetValueType(Value::eValueTypeHostAddress); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 119 | m_value.SetCompilerType(compiler_type); |
| 120 | m_name = name; |
| 121 | SetIsConstant(); |
| 122 | SetValueIsValid(true); |
| 123 | SetAddressTypeOfChildren(eAddressTypeLoad); |
| 124 | } |
| 125 | |
| 126 | ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope, |
| 127 | const CompilerType &compiler_type, |
Adrian Prantl | 0e4c482 | 2019-03-06 21:22:25 +0000 | [diff] [blame] | 128 | ConstString name, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 129 | lldb::addr_t address, |
| 130 | AddressType address_type, |
| 131 | uint32_t addr_byte_size) { |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 132 | auto manager_sp = ValueObjectManager::Create(); |
| 133 | return (new ValueObjectConstResult(exe_scope, *manager_sp, compiler_type, |
| 134 | name, address, address_type, |
| 135 | addr_byte_size)) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 136 | ->GetSP(); |
| 137 | } |
| 138 | |
| 139 | ValueObjectConstResult::ValueObjectConstResult( |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 140 | ExecutionContextScope *exe_scope, ValueObjectManager &manager, |
| 141 | const CompilerType &compiler_type, ConstString name, lldb::addr_t address, |
| 142 | AddressType address_type, uint32_t addr_byte_size) |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 143 | : ValueObject(exe_scope, manager), m_type_name(), |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 144 | m_impl(this, address) { |
| 145 | m_value.GetScalar() = address; |
| 146 | m_data.SetAddressByteSize(addr_byte_size); |
| 147 | m_value.GetScalar().GetData(m_data, addr_byte_size); |
| 148 | // m_value.SetValueType(Value::eValueTypeHostAddress); |
| 149 | switch (address_type) { |
| 150 | case eAddressTypeInvalid: |
| 151 | m_value.SetValueType(Value::eValueTypeScalar); |
| 152 | break; |
| 153 | case eAddressTypeFile: |
| 154 | m_value.SetValueType(Value::eValueTypeFileAddress); |
| 155 | break; |
| 156 | case eAddressTypeLoad: |
| 157 | m_value.SetValueType(Value::eValueTypeLoadAddress); |
| 158 | break; |
| 159 | case eAddressTypeHost: |
Greg Clayton | 8b2fe6d | 2010-12-14 02:59:59 +0000 | [diff] [blame] | 160 | m_value.SetValueType(Value::eValueTypeHostAddress); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 161 | break; |
| 162 | } |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 163 | m_value.SetCompilerType(compiler_type); |
| 164 | m_name = name; |
| 165 | SetIsConstant(); |
| 166 | SetValueIsValid(true); |
| 167 | SetAddressTypeOfChildren(eAddressTypeLoad); |
Greg Clayton | 8b2fe6d | 2010-12-14 02:59:59 +0000 | [diff] [blame] | 168 | } |
| 169 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 170 | ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope, |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 171 | const Status &error) { |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 172 | auto manager_sp = ValueObjectManager::Create(); |
| 173 | return (new ValueObjectConstResult(exe_scope, *manager_sp, error))->GetSP(); |
Jim Ingham | 58b59f9 | 2011-04-22 23:53:53 +0000 | [diff] [blame] | 174 | } |
| 175 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 176 | ValueObjectConstResult::ValueObjectConstResult(ExecutionContextScope *exe_scope, |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 177 | ValueObjectManager &manager, |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 178 | const Status &error) |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 179 | : ValueObject(exe_scope, manager), m_impl(this) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 180 | m_error = error; |
| 181 | SetIsConstant(); |
Jim Ingham | 73ca05a | 2011-12-17 01:35:57 +0000 | [diff] [blame] | 182 | } |
| 183 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 184 | ValueObjectConstResult::ValueObjectConstResult(ExecutionContextScope *exe_scope, |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 185 | ValueObjectManager &manager, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 186 | const Value &value, |
Pavel Labath | 363f05b | 2020-02-03 18:05:21 -0800 | [diff] [blame] | 187 | ConstString name, Module *module) |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 188 | : ValueObject(exe_scope, manager), m_impl(this) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 189 | m_value = value; |
| 190 | m_name = name; |
| 191 | ExecutionContext exe_ctx; |
| 192 | exe_scope->CalculateExecutionContext(exe_ctx); |
Adrian Prantl | d9cbd2a | 2019-08-08 19:22:32 +0000 | [diff] [blame] | 193 | m_error = m_value.GetValueAsData(&exe_ctx, m_data, module); |
Greg Clayton | 8b2fe6d | 2010-12-14 02:59:59 +0000 | [diff] [blame] | 194 | } |
| 195 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 196 | ValueObjectConstResult::~ValueObjectConstResult() {} |
| 197 | |
| 198 | CompilerType ValueObjectConstResult::GetCompilerTypeImpl() { |
| 199 | return m_value.GetCompilerType(); |
Jim Ingham | 58b59f9 | 2011-04-22 23:53:53 +0000 | [diff] [blame] | 200 | } |
| 201 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 202 | lldb::ValueType ValueObjectConstResult::GetValueType() const { |
| 203 | return eValueTypeConstResult; |
| 204 | } |
| 205 | |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 206 | llvm::Optional<uint64_t> ValueObjectConstResult::GetByteSize() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 207 | ExecutionContext exe_ctx(GetExecutionContextRef()); |
Adrian Prantl | 113f56f | 2020-07-25 08:27:21 -0700 | [diff] [blame] | 208 | if (!m_byte_size) { |
Adrian Prantl | d963a7c | 2019-01-15 18:07:52 +0000 | [diff] [blame] | 209 | if (auto size = |
| 210 | GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope())) |
| 211 | SetByteSize(*size); |
| 212 | } |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 213 | return m_byte_size; |
| 214 | } |
| 215 | |
| 216 | void ValueObjectConstResult::SetByteSize(size_t size) { m_byte_size = size; } |
| 217 | |
| 218 | size_t ValueObjectConstResult::CalculateNumChildren(uint32_t max) { |
Adrian Prantl | eca07c5 | 2018-11-05 20:49:07 +0000 | [diff] [blame] | 219 | ExecutionContext exe_ctx(GetExecutionContextRef()); |
| 220 | auto children_count = GetCompilerType().GetNumChildren(true, &exe_ctx); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 221 | return children_count <= max ? children_count : max; |
| 222 | } |
| 223 | |
| 224 | ConstString ValueObjectConstResult::GetTypeName() { |
| 225 | if (m_type_name.IsEmpty()) |
Raphael Isemann | 30ce956 | 2020-02-12 09:35:19 +0100 | [diff] [blame] | 226 | m_type_name = GetCompilerType().GetTypeName(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 227 | return m_type_name; |
| 228 | } |
| 229 | |
| 230 | ConstString ValueObjectConstResult::GetDisplayTypeName() { |
| 231 | return GetCompilerType().GetDisplayTypeName(); |
| 232 | } |
| 233 | |
| 234 | bool ValueObjectConstResult::UpdateValue() { |
| 235 | // Const value is always valid |
| 236 | SetValueIsValid(true); |
| 237 | return true; |
| 238 | } |
| 239 | |
| 240 | bool ValueObjectConstResult::IsInScope() { |
| 241 | // A const result value is always in scope since it serializes all |
| 242 | // information needed to contain the constant value. |
| 243 | return true; |
| 244 | } |
| 245 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 246 | lldb::ValueObjectSP ValueObjectConstResult::Dereference(Status &error) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 247 | return m_impl.Dereference(error); |
| 248 | } |
| 249 | |
| 250 | lldb::ValueObjectSP ValueObjectConstResult::GetSyntheticChildAtOffset( |
| 251 | uint32_t offset, const CompilerType &type, bool can_create, |
| 252 | ConstString name_const_str) { |
| 253 | return m_impl.GetSyntheticChildAtOffset(offset, type, can_create, |
| 254 | name_const_str); |
| 255 | } |
| 256 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 257 | lldb::ValueObjectSP ValueObjectConstResult::AddressOf(Status &error) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 258 | return m_impl.AddressOf(error); |
| 259 | } |
| 260 | |
| 261 | lldb::addr_t ValueObjectConstResult::GetAddressOf(bool scalar_is_load_address, |
| 262 | AddressType *address_type) { |
| 263 | return m_impl.GetAddressOf(scalar_is_load_address, address_type); |
| 264 | } |
| 265 | |
| 266 | ValueObject *ValueObjectConstResult::CreateChildAtIndex( |
| 267 | size_t idx, bool synthetic_array_member, int32_t synthetic_index) { |
| 268 | return m_impl.CreateChildAtIndex(idx, synthetic_array_member, |
| 269 | synthetic_index); |
| 270 | } |
| 271 | |
| 272 | size_t ValueObjectConstResult::GetPointeeData(DataExtractor &data, |
| 273 | uint32_t item_idx, |
| 274 | uint32_t item_count) { |
| 275 | return m_impl.GetPointeeData(data, item_idx, item_count); |
| 276 | } |
| 277 | |
| 278 | lldb::ValueObjectSP |
| 279 | ValueObjectConstResult::GetDynamicValue(lldb::DynamicValueType use_dynamic) { |
| 280 | // Always recalculate dynamic values for const results as the memory that |
| 281 | // they might point to might have changed at any time. |
| 282 | if (use_dynamic != eNoDynamicValues) { |
| 283 | if (!IsDynamic()) { |
| 284 | ExecutionContext exe_ctx(GetExecutionContextRef()); |
| 285 | Process *process = exe_ctx.GetProcessPtr(); |
| 286 | if (process && process->IsPossibleDynamicValue(*this)) |
| 287 | m_dynamic_value = new ValueObjectDynamicValue(*this, use_dynamic); |
Greg Clayton | 8b2fe6d | 2010-12-14 02:59:59 +0000 | [diff] [blame] | 288 | } |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 289 | if (m_dynamic_value) |
| 290 | return m_dynamic_value->GetSP(); |
| 291 | } |
| 292 | return ValueObjectSP(); |
Greg Clayton | 1d3afba | 2010-10-05 00:00:42 +0000 | [diff] [blame] | 293 | } |
Enrico Granata | 9128ee2 | 2011-09-06 19:20:51 +0000 | [diff] [blame] | 294 | |
| 295 | lldb::ValueObjectSP |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 296 | ValueObjectConstResult::Cast(const CompilerType &compiler_type) { |
| 297 | return m_impl.Cast(compiler_type); |
Enrico Granata | 9128ee2 | 2011-09-06 19:20:51 +0000 | [diff] [blame] | 298 | } |
| 299 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 300 | lldb::LanguageType ValueObjectConstResult::GetPreferredDisplayLanguage() { |
| 301 | if (m_preferred_display_language != lldb::eLanguageTypeUnknown) |
| 302 | return m_preferred_display_language; |
| 303 | return GetCompilerTypeImpl().GetMinimumLanguage(); |
Enrico Granata | c1247f5 | 2014-11-06 21:23:20 +0000 | [diff] [blame] | 304 | } |