================
@@ -1700,13 +1706,13 @@ ValueObjectSP ValueObject::GetSyntheticChildAtOffset(
     return synthetic_child_sp;
 
   if (!can_create)
-    return {};
+    return ValueObjectSP();
----------------
PortalPete wrote:

This one is more about consistency because the vast majority of the remaining 
code (in this file, anyway) use the `ValueObjectSP()` form.

I also have an ulterior motive in that a lot of the changes that (might) come 
from a later PR will change MANY of these `ValueObjectSP()` instances to `{}` 
because I convert them to empty optionals, aka `std::optional<ValueObjectSP>` 
(instead of creating `ValueObjectSP` instances with `nullptr`).

Therefore, when that subsequent PR comes around, I want that changes to reflect 
all applicable changes as possible. If I leave this line as `return {};`, then 
the line won't change in the other PR, which reduces the attention that method 
will get at that time. Not only that, this line would be initializing something 
completely different, an optional instead of a shared pointer, in that future 
PR.

I'd rather bring more attention to things that are functionally changing to 
prevent accidental bugs and/or behavioral changes, specifically because the 
compiler quietly accepts it either way.

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

Reply via email to