aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectWatchpoint.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2020-07-25 08:27:21 -0700
committerAdrian Prantl <aprantl@apple.com>2020-07-27 13:26:35 -0700
commit113f56fbb80e8d6f705be19f8ae169a3fee2e4f8 (patch)
tree0e4bfabd2e0cea77293d8322a4fea2b77df8b3eb /lldb/source/Commands/CommandObjectWatchpoint.cpp
parent145acacaea1d7fb4ffc055a3e92ee8fee7c58634 (diff)
downloadllvm-113f56fbb80e8d6f705be19f8ae169a3fee2e4f8.zip
llvm-113f56fbb80e8d6f705be19f8ae169a3fee2e4f8.tar.gz
llvm-113f56fbb80e8d6f705be19f8ae169a3fee2e4f8.tar.bz2
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.
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index ce46629..c2a008a 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -905,7 +905,7 @@ protected:
// We're in business.
// Find out the size of this variable.
size = m_option_watchpoint.watch_size == 0
- ? valobj_sp->GetByteSize()
+ ? valobj_sp->GetByteSize().getValueOr(0)
: m_option_watchpoint.watch_size;
}
compiler_type = valobj_sp->GetCompilerType();