[PATCH] D110751: [DomTree] Assert that blocks in queries aren't from another function
Daniil Suchkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 30 15:24:41 PDT 2021
DaniilSuchkov updated this revision to Diff 376382.
DaniilSuchkov edited the summary of this revision.
DaniilSuchkov added a comment.
Rebased it on top of D110752 <https://reviews.llvm.org/D110752>.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110751/new/
https://reviews.llvm.org/D110751
Files:
llvm/include/llvm/Support/GenericDomTree.h
Index: llvm/include/llvm/Support/GenericDomTree.h
===================================================================
--- llvm/include/llvm/Support/GenericDomTree.h
+++ llvm/include/llvm/Support/GenericDomTree.h
@@ -349,6 +349,9 @@
/// may (but is not required to) be null for a forward (backwards)
/// statically unreachable block.
DomTreeNodeBase<NodeT> *getNode(const NodeT *BB) const {
+ assert((!BB || !BB->getParent() || BB->getParent() == Parent) &&
+ "A node from another function!");
+
auto I = DomTreeNodes.find(BB);
if (I != DomTreeNodes.end())
return I->second.get();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110751.376382.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210930/7e063d71/attachment.bin>
More information about the llvm-commits
mailing list