diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Core/ValueObjectMemory.cpp | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
Diffstat (limited to 'source/Core/ValueObjectMemory.cpp')
-rw-r--r-- | source/Core/ValueObjectMemory.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/Core/ValueObjectMemory.cpp b/source/Core/ValueObjectMemory.cpp index 24103204ee47..95d4330ee0c6 100644 --- a/source/Core/ValueObjectMemory.cpp +++ b/source/Core/ValueObjectMemory.cpp @@ -1,9 +1,8 @@ //===-- ValueObjectMemory.cpp ---------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -50,7 +49,7 @@ ValueObjectMemory::ValueObjectMemory(ExecutionContextScope *exe_scope, : ValueObject(exe_scope), m_address(address), m_type_sp(type_sp), m_compiler_type() { // Do not attempt to construct one of these objects with no variable! - assert(m_type_sp.get() != NULL); + assert(m_type_sp.get() != nullptr); SetName(ConstString(name)); m_value.SetContext(Value::eContextTypeLLDBType, m_type_sp.get()); TargetSP target_sp(GetTargetSP()); @@ -137,10 +136,8 @@ size_t ValueObjectMemory::CalculateNumChildren(uint32_t max) { uint64_t ValueObjectMemory::GetByteSize() { if (m_type_sp) - return m_type_sp->GetByteSize(); - if (llvm::Optional<uint64_t> size = m_compiler_type.GetByteSize(nullptr)) - return *size; - return 0; + return m_type_sp->GetByteSize().getValueOr(0); + return m_compiler_type.GetByteSize(nullptr).getValueOr(0); } lldb::ValueType ValueObjectMemory::GetValueType() const { |