diff options
author | Adrian Prantl <adrian-prantl@users.noreply.github.com> | 2024-03-08 10:39:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 10:39:34 -0800 |
commit | 99118c809367d518ffe4de60c16da953744b68b9 (patch) | |
tree | f2ddb99f41bea20094075be71533e3d25f3775ff /lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp | |
parent | 839a8fecb4c5dfe1b4484d5fc942a9490867c47a (diff) | |
download | llvm-99118c809367d518ffe4de60c16da953744b68b9.zip llvm-99118c809367d518ffe4de60c16da953744b68b9.tar.gz llvm-99118c809367d518ffe4de60c16da953744b68b9.tar.bz2 |
Change GetNumChildren()/CalculateNumChildren() methods return llvm::Expected (#84219)
Change GetNumChildren()/CalculateNumChildren() methods return
llvm::Expected
This is an NFC change that does not yet add any error handling or change
any code to return any errors.
This is the second big change in the patch series started with
https://github.com/llvm/llvm-project/pull/83501
A follow-up PR will wire up error handling.
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp index 5abb3d5..86bb575 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp @@ -43,7 +43,7 @@ class LibstdcppMapIteratorSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: explicit LibstdcppMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); - uint32_t CalculateNumChildren() override; + llvm::Expected<uint32_t> CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override; @@ -64,7 +64,7 @@ class LibStdcppSharedPtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: explicit LibStdcppSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); - uint32_t CalculateNumChildren() override; + llvm::Expected<uint32_t> CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override; @@ -132,7 +132,8 @@ lldb::ChildCacheState LibstdcppMapIteratorSyntheticFrontEnd::Update() { return lldb::ChildCacheState::eReuse; } -uint32_t LibstdcppMapIteratorSyntheticFrontEnd::CalculateNumChildren() { +llvm::Expected<uint32_t> +LibstdcppMapIteratorSyntheticFrontEnd::CalculateNumChildren() { return 2; } @@ -219,7 +220,10 @@ lldb::ChildCacheState VectorIteratorSyntheticFrontEnd::Update() { return lldb::ChildCacheState::eRefetch; } -uint32_t VectorIteratorSyntheticFrontEnd::CalculateNumChildren() { return 1; } +llvm::Expected<uint32_t> +VectorIteratorSyntheticFrontEnd::CalculateNumChildren() { + return 1; +} lldb::ValueObjectSP VectorIteratorSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) { @@ -371,7 +375,10 @@ LibStdcppSharedPtrSyntheticFrontEnd::LibStdcppSharedPtrSyntheticFrontEnd( Update(); } -uint32_t LibStdcppSharedPtrSyntheticFrontEnd::CalculateNumChildren() { return 1; } +llvm::Expected<uint32_t> +LibStdcppSharedPtrSyntheticFrontEnd::CalculateNumChildren() { + return 1; +} lldb::ValueObjectSP LibStdcppSharedPtrSyntheticFrontEnd::GetChildAtIndex(uint32_t idx) { |