diff options
author | Adrian Prantl <aprantl@apple.com> | 2020-07-25 08:27:21 -0700 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2020-07-25 08:27:21 -0700 |
commit | 1d9b860fb6a85df33fd52fcacc6a5efb421621bd (patch) | |
tree | 2da33a75ca5ab308ae38214fc45432af8e07230a /lldb/source/Commands/CommandObjectWatchpoint.cpp | |
parent | c09a10845b429307a38a93799e7520c0e16850fd (diff) | |
download | llvm-1d9b860fb6a85df33fd52fcacc6a5efb421621bd.zip llvm-1d9b860fb6a85df33fd52fcacc6a5efb421621bd.tar.gz llvm-1d9b860fb6a85df33fd52fcacc6a5efb421621bd.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
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 2 |
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(); |