aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp b/contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp
index 8d84f8e62ccc..ceb4491f8666 100644
--- a/contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp
+++ b/contrib/llvm-project/lldb/source/Core/ValueObjectConstResult.cpp
@@ -40,8 +40,7 @@ ValueObjectConstResult::ValueObjectConstResult(ExecutionContextScope *exe_scope,
ByteOrder byte_order,
uint32_t addr_byte_size,
lldb::addr_t address)
- : ValueObject(exe_scope, manager), m_type_name(), m_byte_size(0),
- m_impl(this, address) {
+ : ValueObject(exe_scope, manager), m_impl(this, address) {
SetIsConstant();
SetValueIsValid(true);
m_data.SetByteOrder(byte_order);
@@ -64,8 +63,7 @@ ValueObjectConstResult::ValueObjectConstResult(
ExecutionContextScope *exe_scope, ValueObjectManager &manager,
const CompilerType &compiler_type, ConstString name,
const DataExtractor &data, lldb::addr_t address)
- : ValueObject(exe_scope, manager), m_type_name(), m_byte_size(0),
- m_impl(this, address) {
+ : ValueObject(exe_scope, manager), m_impl(this, address) {
m_data = data;
if (!m_data.GetSharedDataBuffer()) {
@@ -112,8 +110,7 @@ ValueObjectConstResult::ValueObjectConstResult(
const CompilerType &compiler_type, ConstString name,
const lldb::DataBufferSP &data_sp, lldb::ByteOrder data_byte_order,
uint32_t data_addr_size, lldb::addr_t address)
- : ValueObject(exe_scope, manager), m_type_name(), m_byte_size(0),
- m_impl(this, address) {
+ : ValueObject(exe_scope, manager), m_impl(this, address) {
m_data.SetByteOrder(data_byte_order);
m_data.SetAddressByteSize(data_addr_size);
m_data.SetData(data_sp);
@@ -143,7 +140,7 @@ ValueObjectConstResult::ValueObjectConstResult(
ExecutionContextScope *exe_scope, ValueObjectManager &manager,
const CompilerType &compiler_type, ConstString name, lldb::addr_t address,
AddressType address_type, uint32_t addr_byte_size)
- : ValueObject(exe_scope, manager), m_type_name(), m_byte_size(0),
+ : ValueObject(exe_scope, manager), m_type_name(),
m_impl(this, address) {
m_value.GetScalar() = address;
m_data.SetAddressByteSize(addr_byte_size);
@@ -179,8 +176,7 @@ ValueObjectSP ValueObjectConstResult::Create(ExecutionContextScope *exe_scope,
ValueObjectConstResult::ValueObjectConstResult(ExecutionContextScope *exe_scope,
ValueObjectManager &manager,
const Status &error)
- : ValueObject(exe_scope, manager), m_type_name(), m_byte_size(0),
- m_impl(this) {
+ : ValueObject(exe_scope, manager), m_impl(this) {
m_error = error;
SetIsConstant();
}
@@ -189,8 +185,7 @@ ValueObjectConstResult::ValueObjectConstResult(ExecutionContextScope *exe_scope,
ValueObjectManager &manager,
const Value &value,
ConstString name, Module *module)
- : ValueObject(exe_scope, manager), m_type_name(), m_byte_size(0),
- m_impl(this) {
+ : ValueObject(exe_scope, manager), m_impl(this) {
m_value = value;
m_name = name;
ExecutionContext exe_ctx;
@@ -208,9 +203,9 @@ lldb::ValueType ValueObjectConstResult::GetValueType() const {
return eValueTypeConstResult;
}
-uint64_t ValueObjectConstResult::GetByteSize() {
+llvm::Optional<uint64_t> ValueObjectConstResult::GetByteSize() {
ExecutionContext exe_ctx(GetExecutionContextRef());
- if (m_byte_size == 0) {
+ if (!m_byte_size) {
if (auto size =
GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope()))
SetByteSize(*size);