[Lldb-commits] [lldb] [lldb] Upgrade CompilerType::GetBitSize to return llvm::Expected (PR #129601)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 4 20:51:45 PST 2025


================
@@ -1104,10 +1107,18 @@ bool CompilerType::GetValueAsScalar(const lldb_private::DataExtractor &data,
     if (encoding == lldb::eEncodingInvalid || count != 1)
       return false;
 
-    std::optional<uint64_t> byte_size = GetByteSize(exe_scope);
+    auto byte_size_or_err = GetByteSize(exe_scope);
+    if (!byte_size_or_err) {
+      LLDB_LOG_ERRORV(
+          GetLog(LLDBLog::Types), byte_size_or_err.takeError(),
+          "Cannot get value as scalar; cannot determine type size: {0}");
----------------
JDevlieghere wrote:

```suggestion
          "Cannot get value as scalar: cannot determine type size: {0}");
```


https://github.com/llvm/llvm-project/pull/129601


More information about the lldb-commits mailing list