summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectVariable.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-15 22:30:01 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-15 22:30:01 +0000
commit222474b9ffb2e04125dd8faf3957be7b0f43a183 (patch)
tree942580c011f584ee917d054f8fb5b14c6586b8ce /lldb/source/Core/ValueObjectVariable.cpp
parent76cb3089ded316e4aedcf0f11a60eee3affbcfbc (diff)
downloadbcm5719-llvm-222474b9ffb2e04125dd8faf3957be7b0f43a183.tar.gz
bcm5719-llvm-222474b9ffb2e04125dd8faf3957be7b0f43a183.zip
Simplify code by using Optional::getValueOr()
llvm-svn: 351264
Diffstat (limited to 'lldb/source/Core/ValueObjectVariable.cpp')
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index f026d77c9fa..4d401c56249 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -112,9 +112,7 @@ uint64_t ValueObjectVariable::GetByteSize() {
if (!type.IsValid())
return 0;
- llvm::Optional<uint64_t> size =
- type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
- return size ? *size : 0;
+ return type.GetByteSize(exe_ctx.GetBestExecutionContextScope()).getValueOr(0);
}
lldb::ValueType ValueObjectVariable::GetValueType() const {
OpenPOWER on IntegriCloud