[Lldb-commits] [lldb] [lldb][TypeSynthetic][NFC] Make SyntheticChildrenFrontend::Update() return an enum (PR #80167)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 31 11:34:52 PST 2024
================
@@ -49,14 +49,17 @@ class SyntheticChildrenFrontEnd {
virtual size_t GetIndexOfChildWithName(ConstString name) = 0;
- // this function is assumed to always succeed and it if fails, the front-end
- // should know to deal with it in the correct way (most probably, by refusing
- // to return any children) the return value of Update() should actually be
- // interpreted as "ValueObjectSyntheticFilter cache is good/bad" if =true,
- // ValueObjectSyntheticFilter is allowed to use the children it fetched
- // previously and cached if =false, ValueObjectSyntheticFilter must throw
- // away its cache, and query again for children
- virtual bool Update() = 0;
+ enum class CacheState { Invalid, Valid };
----------------
clayborg wrote:
We need to make sure enum values are 0 and 1 since the python synthetic stuff will return `True` or `False` still. It might be nice to move this enum into lldb-enumerations.h so that python can use it in future synthetic child providers, or people can update their synthetic python plugins to use the enum to be more readable.
As far as names go, do we want to be more clear about what these do and specify they are for children? Something like:
```
/// An enumeration that specifies if children need to be re-computed after a call to Update().
enum class ChildCacheState {
Dynamic = 0, ///< Children need to be recomputed dynamically.
Constant = 1, ///< Children will never change and don't need to be recomputed.
};
```
https://github.com/llvm/llvm-project/pull/80167
More information about the lldb-commits
mailing list