Add checkReachingBlockDominates utility.

This is a tiny routine that is useful for writing assertions to be
used for quick sanity checks without computing Dominance.

It doesn't always make sense to require a pass to maintain and pass
around Dominance just for an assert.
This commit is contained in:
Andrew Trick
2021-07-18 17:10:05 -07:00
parent ae727e1348
commit 0435fef009
2 changed files with 40 additions and 0 deletions

View File

@@ -148,6 +148,10 @@ void findJointPostDominatingSet(
function_ref<void(SILBasicBlock *)> foundJointPostDomSetCompletionBlocks,
function_ref<void(SILBasicBlock *)> inputBlocksInJointPostDomSet = {});
#ifndef NDEBUG
bool checkDominates(SILBasicBlock *sourceBlock, SILBasicBlock *destBlock);
#endif
} // namespace swift
#endif