[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
Fri Oct 1 14:31:45 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG86046516e4f4: [DomTree] Assert that blocks in queries aren't from another function (authored by DaniilSuchkov).

Repository:
  rG LLVM Github Monorepo

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.376637.patch
Type: text/x-patch
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211001/74e87bce/attachment.bin>


More information about the llvm-commits mailing list