summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-01-15 20:33:58 +0000
committerAdrian Prantl <aprantl@apple.com>2019-01-15 20:33:58 +0000
commitd6a9bbf68e2c795d0d2d7f831235ed14af978f87 (patch)
tree87a0eb5e4ce3d616030c83aa16c8bc6faf085791 /lldb/source/DataFormatters
parent3cdd1a7d47f3a51c67979d28ce542a2f03c12d0c (diff)
downloadbcm5719-llvm-d6a9bbf68e2c795d0d2d7f831235ed14af978f87.tar.gz
bcm5719-llvm-d6a9bbf68e2c795d0d2d7f831235ed14af978f87.zip
Replace auto -> llvm::Optional<uint64_t>
This addresses post-commit feedback for https://reviews.llvm.org/D56688 llvm-svn: 351237
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/TypeFormat.cpp2
-rw-r--r--lldb/source/DataFormatters/VectorType.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/DataFormatters/TypeFormat.cpp b/lldb/source/DataFormatters/TypeFormat.cpp
index e9a8c3b8953..f00a679cecf 100644
--- a/lldb/source/DataFormatters/TypeFormat.cpp
+++ b/lldb/source/DataFormatters/TypeFormat.cpp
@@ -96,7 +96,7 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
ExecutionContextScope *exe_scope =
exe_ctx.GetBestExecutionContextScope();
- auto size = compiler_type.GetByteSize(exe_scope);
+ llvm::Optional<uint64_t> size = compiler_type.GetByteSize(exe_scope);
if (!size)
return false;
StreamString sstr;
diff --git a/lldb/source/DataFormatters/VectorType.cpp b/lldb/source/DataFormatters/VectorType.cpp
index 5ab438e6abb..b11fb1456af 100644
--- a/lldb/source/DataFormatters/VectorType.cpp
+++ b/lldb/source/DataFormatters/VectorType.cpp
@@ -171,8 +171,9 @@ static size_t CalculateNumChildren(
lldb_private::ExecutionContextScope *exe_scope =
nullptr // does not matter here because all we trade in are basic types
) {
- auto container_size = container_type.GetByteSize(exe_scope);
- auto element_size = element_type.GetByteSize(exe_scope);
+ llvm::Optional<uint64_t> container_size =
+ container_type.GetByteSize(exe_scope);
+ llvm::Optional<uint64_t> element_size = element_type.GetByteSize(exe_scope);
if (container_size && element_size && *element_size) {
if (*container_size % *element_size)
@@ -198,7 +199,7 @@ public:
lldb::ValueObjectSP GetChildAtIndex(size_t idx) override {
if (idx >= CalculateNumChildren())
return {};
- auto size = m_child_type.GetByteSize(nullptr);
+ llvm::Optional<uint64_t> size = m_child_type.GetByteSize(nullptr);
if (!size)
return {};
auto offset = idx * *size;
OpenPOWER on IntegriCloud