JDevlieghere wrote:

> > Why not increase TypeSystem::GetNumChildren to return a size_t instead?
> 
> We could, but even 2^32 seems like an outrageous amount of children to me. 
> What would be a use-case for this? A ValueObject that has the entire address 
> space as synthetic children?
> 
> There is other code that assumes that we can store the result of 
> GetNumChildren() in an int64 and use negative numbers as out-of-band 
> signaling. We could replace that with std::optional of course.

But what's there to gain by limiting it to 32 bits instead of 64? Saying it's 
unlikely or overkill isn't a very strong argument. I think a possibly better 
answer to Alex' question is probably: because `SBValue::GetNumChildren` returns 
a `uint32_t` and we cannot change that, so we'd have to check for overflow at 
SB API level. I don't feel strongly either way (though if it were me, I'd make 
everything a `size_t`.) 

https://github.com/llvm/llvm-project/pull/83501
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to