diff options
author | Adrian Prantl <aprantl@apple.com> | 2025-03-05 10:21:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 10:21:19 -0800 |
commit | 878a64f94a264ea4b564d6063614ddb0b5da3f6c (patch) | |
tree | 5aaa6c770d5764fd3f9822882376c85c7ed427ef /lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp | |
parent | 03da079968845e1f1312d09ff4e2ecee1933552e (diff) | |
download | llvm-878a64f94a264ea4b564d6063614ddb0b5da3f6c.zip llvm-878a64f94a264ea4b564d6063614ddb0b5da3f6c.tar.gz llvm-878a64f94a264ea4b564d6063614ddb0b5da3f6c.tar.bz2 |
[lldb] Upgrade CompilerType::GetBitSize to return llvm::Expected (#129601)
This patch pushes the error handling boundary for the GetBitSize()
methods from Runtime into the Type and CompilerType APIs. This makes it
easier to diagnose problems thanks to more meaningful error messages
being available. GetBitSize() is often the first thing LLDB asks about a
type, so this method is particularly important for a better user
experience.
rdar://145667239
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp index 127c0cd..a97264f 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp @@ -309,7 +309,8 @@ bool lldb_private::formatters::LibStdcppWStringSummaryProvider( return false; // Safe to pass nullptr for exe_scope here. - std::optional<uint64_t> size = wchar_compiler_type.GetBitSize(nullptr); + std::optional<uint64_t> size = + llvm::expectedToOptional(wchar_compiler_type.GetBitSize(nullptr)); if (!size) return false; const uint32_t wchar_size = *size; |