[PATCH] D110751: [DomTree] Assert that blocks in queries aren't from another function

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 30 14:27:50 PDT 2021


aeubanks added a comment.

adding the test here is confusing, I think just adding the assert is good enough. so D110752 <https://reviews.llvm.org/D110752> would have to land first



================
Comment at: llvm/include/llvm/Support/GenericDomTree.h:353
+    assert((!BB || !BB->getParent() || BB->getParent() == Parent) &&
+           "A node from another function!");
+
----------------
DaniilSuchkov wrote:
> nikic wrote:
> > Is `!BB` really a valid input to this function?
> I don't know, but since there are no checks for that anywhere and it's not mentioned in its description, I decided refrain from making any assumptions.
> If you think it's not, I can add an assertion for that in a separate patch.
I'd just remove the check for `!BB` if check-llvm doesn't complain


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

https://reviews.llvm.org/D110751



More information about the llvm-commits mailing list