From 5f29bb8a675e8f96452b632e7129113f7dec850e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 20 Aug 2019 20:51:52 +0000 Subject: Vendor import of stripped lldb trunk r366426 (just before the release_90 branch point): https://llvm.org/svn/llvm-project/lldb/trunk@366426 --- source/Core/ValueObjectMemory.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source/Core/ValueObjectMemory.cpp') 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 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 { -- cgit v1.2.3