[PATCH] D135257: [clangd][Tweak] Make sure enclosing function doesnt have invalid children

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 00:46:27 PDT 2022


kadircet added a comment.

In D135257#3836511 <https://reviews.llvm.org/D135257#3836511>, @ilya-biryukov wrote:

> Having `nullptr` inside `children()` seems really weird. Should we fix those instead to never produce `nullptr`? Or is this something that is expected (I can come up with a few contracts where this would make sense, but that all looks really akward).

that would definitely be great, if I could find any examples that triggers this. my main hesitation with such solutions is, no matter how hard we try, due to the variety of codepaths that lead to stmt creation, either we'll miss some paths or someone in the future will introduce a new one without broken code in mind and hell will break lose again. so i personally feel like being defensive on the application side, especially when it isn't a huge performance hit, is healthier approach in the long term.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135257/new/

https://reviews.llvm.org/D135257



More information about the cfe-commits mailing list