From 20dcc9f7f113058f28ec1b15c60c71b1e10abe1a Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Mon, 10 Aug 2015 13:21:59 +0000 Subject: [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 --- llvm/lib/Analysis/RegionInfo.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/Analysis/RegionInfo.cpp') 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 #include #include +#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 // -- cgit v1.2.3