[Lldb-commits] [lldb] [lldb] Upgrade ExtractIndexFromString to use llvm::Expected (PR #138297)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri May 2 15:06:19 PDT 2025


================
@@ -97,18 +97,19 @@ void lldb_private::formatters::AddFilter(
   category_sp->AddTypeFilter(type_name, match_type, filter_sp);
 }
 
-size_t lldb_private::formatters::ExtractIndexFromString(const char *item_name) {
+llvm::Expected<size_t>
----------------
adrian-prantl wrote:

I think here I would just return a std::optional<>, since all of the StringErrors just say "this failed" without any specific other information, and that's something the caller can also piece together.

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


More information about the lldb-commits mailing list