summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/RegionInfo.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2015-08-10 13:21:59 +0000
committerMichael Kruse <llvm@meinersbur.de>2015-08-10 13:21:59 +0000
commit20dcc9f7f113058f28ec1b15c60c71b1e10abe1a (patch)
tree83ed5cedd92b757f9c1e0605c46044be28218654 /llvm/lib/Analysis/RegionInfo.cpp
parent046dde40c53cd4558870e9bd3f96d8b6d70853df (diff)
downloadbcm5719-llvm-20dcc9f7f113058f28ec1b15c60c71b1e10abe1a.tar.gz
bcm5719-llvm-20dcc9f7f113058f28ec1b15c60c71b1e10abe1a.zip
[RegionInfo] Add debug-time region viewer functions
Summary: Analogously to Function::viewCFG(), RegionInfo::view() and RegionInfo::viewOnly() are meant to be called in debugging sessions. They open a viewer to show how RegionInfo currently understands the region hierarchy. The functions viewRegion(Function*) and viewRegionOnly(Function*) invoke a fresh region analysis of the function in contrast to viewRegion(RegionInfo*) and viewRegionOnly(RegionInfo*) which show the current analysis result. Reviewers: grosser Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11875 llvm-svn: 244444
Diffstat (limited to 'llvm/lib/Analysis/RegionInfo.cpp')
-rw-r--r--llvm/lib/Analysis/RegionInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp
index 8cd85348fdc..f59d2673032 100644
--- a/llvm/lib/Analysis/RegionInfo.cpp
+++ b/llvm/lib/Analysis/RegionInfo.cpp
@@ -21,6 +21,9 @@
#include <algorithm>
#include <iterator>
#include <set>
+#ifndef NDEBUG
+#include "llvm/Analysis/RegionPrinter.h"
+#endif
using namespace llvm;
@@ -103,6 +106,12 @@ void RegionInfo::recalculate(Function &F, DominatorTree *DT_,
calculate(F);
}
+#ifndef NDEBUG
+void RegionInfo::view() { viewRegion(this); }
+
+void RegionInfo::viewOnly() { viewRegionOnly(this); }
+#endif
+
//===----------------------------------------------------------------------===//
// RegionInfoPass implementation
//
OpenPOWER on IntegriCloud