summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectMemory.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-29 17:52:34 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-29 17:52:34 +0000
commitd13777aa18cfe2904110038429095433b92783f3 (patch)
tree915631dee2d4fe2bedd075ca6b5c2212374912ad /lldb/source/Core/ValueObjectMemory.cpp
parentcd6b240303034d3a9a1328c7019a272d510eaa39 (diff)
downloadbcm5719-llvm-d13777aa18cfe2904110038429095433b92783f3.tar.gz
bcm5719-llvm-d13777aa18cfe2904110038429095433b92783f3.zip
Make Type::GetByteSize optional (NFC)
This is a continuation of my quest to make the size 0 a supported value. This reapplies r352394 with additional PDB parser fixes prepared by Pavel Labath! Differential Revision: https://reviews.llvm.org/D57273 llvm-svn: 352521
Diffstat (limited to 'lldb/source/Core/ValueObjectMemory.cpp')
-rw-r--r--lldb/source/Core/ValueObjectMemory.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp
index 68e58ab1305..42d1263b390 100644
--- a/lldb/source/Core/ValueObjectMemory.cpp
+++ b/lldb/source/Core/ValueObjectMemory.cpp
@@ -136,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 {
OpenPOWER on IntegriCloud