[DomTree] Assert that blocks in queries aren't from another function
authorDaniil Suchkov <dsuchkov@azul.com>
Tue, 28 Sep 2021 23:44:50 +0000 (23:44 +0000)
committerDaniil Suchkov <dsuchkov@azul.com>
Fri, 1 Oct 2021 21:30:54 +0000 (21:30 +0000)
commit86046516e4f4527213c595c154c9971d81a49601
treef2118d3ee33a4d71009c1434f100386594ac7f3e
parent45bd8d947780811aa4a6ba7e6b42e3a2dce3e6bd
[DomTree] Assert that blocks in queries aren't from another function

This assertion should help us catch cases when DT is used in a way that
doesn't make much sense and usually indicates usage errors. In D110752
you can see a test on which this assertion catches a miscompile.

The assertion is added to getNode since all queries seem to be
routed through that function for all non-trivial cases.

Reviewed By: aeubanks, MaskRay
Differential Revision: https://reviews.llvm.org/D110751
llvm/include/llvm/Support/GenericDomTree.h