[llvm-commits] [PATCH 1/2] Region: Check the exit region before use it when expanding a region.

ether zhhb etherzhhb at gmail.com
Sun Apr 3 20:27:07 PDT 2011


>From 0c43ee6358a05b19b6b9924e5de3074216b7bcd5 Mon Sep 17 00:00:00 2001
From: ether <etherzhhb at gmail.com>
Date: Mon, 4 Apr 2011 11:24:37 +0800
Subject: [PATCH 1/2] Region: Check the exit region before use it when
expanding a region.

---
 lib/Analysis/RegionInfo.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp
index e2f6a8b..a5250cf 100644
--- a/lib/Analysis/RegionInfo.cpp
+++ b/lib/Analysis/RegionInfo.cpp
@@ -394,6 +394,9 @@ Region *Region::getExpandedRegion() const {

   Region *R = RI->getRegionFor(exit);

+  if (!R)
+    llvm_unreachable(("Can not find exit for region: " +
getNameStr()).c_str());
+
   if (R->getEntry() != exit) {
     if (exit->getTerminator()->getNumSuccessors() == 1)
       return new Region(getEntry(), *succ_begin(exit), RI, DT);
-- 
1.7.3.3



More information about the llvm-commits mailing list