diff options
author | David Green <david.green@arm.com> | 2018-02-28 11:00:08 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2018-02-28 11:00:08 +0000 |
commit | 7c35de124abd754b8e98f67be848a37c0b8d975e (patch) | |
tree | 11f0b4013f548bc9ff1243cadb7429a0e64b671f /llvm/lib/Analysis | |
parent | a94a4308e1bccddfa76d7836ad6c2ddf401caa09 (diff) | |
download | bcm5719-llvm-7c35de124abd754b8e98f67be848a37c0b8d975e.tar.gz bcm5719-llvm-7c35de124abd754b8e98f67be848a37c0b8d975e.zip |
[Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees
Removes verifyDomTree, using assert(verify()) everywhere instead, and
changes verify a little to always run IsSameAsFreshTree first in order
to print good output when we find errors. Also adds verifyAnalysis for
PostDomTrees, which will allow checking of PostDomTrees it the same way
we check DomTrees and MachineDomTrees.
Differential Revision: https://reviews.llvm.org/D41298
llvm-svn: 326315
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/PostDominators.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp index 2282401085d..8ccba689ec5 100644 --- a/llvm/lib/Analysis/PostDominators.cpp +++ b/llvm/lib/Analysis/PostDominators.cpp @@ -21,6 +21,12 @@ using namespace llvm; #define DEBUG_TYPE "postdomtree" +#ifdef EXPENSIVE_CHECKS +static constexpr bool ExpensiveChecksEnabled = true; +#else +static constexpr bool ExpensiveChecksEnabled = false; +#endif + //===----------------------------------------------------------------------===// // PostDominatorTree Implementation //===----------------------------------------------------------------------===// @@ -44,6 +50,13 @@ bool PostDominatorTreeWrapperPass::runOnFunction(Function &F) { return false; } +void PostDominatorTreeWrapperPass::verifyAnalysis() const { + if (VerifyDomInfo) + assert(DT.verify(PostDominatorTree::VerificationLevel::Full)); + else if (ExpensiveChecksEnabled) + assert(DT.verify(PostDominatorTree::VerificationLevel::Basic)); +} + void PostDominatorTreeWrapperPass::print(raw_ostream &OS, const Module *) const { DT.print(OS); } |