Unify the return value of GetByteSize to an llvm::Optional<uint64_t> (NFC-ish)
authorAdrian Prantl <aprantl@apple.com>
Sat, 25 Jul 2020 15:27:21 +0000 (08:27 -0700)
committerAdrian Prantl <aprantl@apple.com>
Mon, 27 Jul 2020 20:26:35 +0000 (13:26 -0700)
commit113f56fbb80e8d6f705be19f8ae169a3fee2e4f8
tree0e4bfabd2e0cea77293d8322a4fea2b77df8b3eb
parent145acacaea1d7fb4ffc055a3e92ee8fee7c58634
Unify the return value of GetByteSize to an llvm::Optional<uint64_t> (NFC-ish)

This cleanup patch unifies all methods called GetByteSize() in the
ValueObject hierarchy to return an optional, like the methods in
CompilerType do. This means fewer magic 0 values, which could fix bugs
down the road in languages where types can have a size of zero, such
as Swift and C (but not C++).

Differential Revision: https://reviews.llvm.org/D84285

This re-lands the patch with bogus :m_byte_size(0) initalizations removed.
24 files changed:
lldb/include/lldb/Core/ValueObject.h
lldb/include/lldb/Core/ValueObjectCast.h
lldb/include/lldb/Core/ValueObjectChild.h
lldb/include/lldb/Core/ValueObjectConstResult.h
lldb/include/lldb/Core/ValueObjectDynamicValue.h
lldb/include/lldb/Core/ValueObjectMemory.h
lldb/include/lldb/Core/ValueObjectRegister.h
lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/include/lldb/Core/ValueObjectVariable.h
lldb/include/lldb/Expression/ExpressionVariable.h
lldb/include/lldb/Target/StackFrameRecognizer.h
lldb/source/API/SBValue.cpp
lldb/source/Commands/CommandObjectWatchpoint.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/Core/ValueObjectCast.cpp
lldb/source/Core/ValueObjectConstResult.cpp
lldb/source/Core/ValueObjectDynamicValue.cpp
lldb/source/Core/ValueObjectMemory.cpp
lldb/source/Core/ValueObjectRegister.cpp
lldb/source/Core/ValueObjectSyntheticFilter.cpp
lldb/source/Core/ValueObjectVariable.cpp
lldb/source/Expression/ExpressionVariable.cpp
lldb/source/Expression/Materializer.cpp
lldb/source/Target/StackFrame.cpp