[llvm-commits] [PATCH 1/2] Region: Check the exit region before use it when expanding a region.
ether zhhb
etherzhhb at gmail.com
Mon Apr 4 02:12:56 PDT 2011
>
> can you use an assert() here?
sure
---
lib/Analysis/RegionInfo.cpp | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp
index e2f6a8b..a374ef9 100644
--- a/lib/Analysis/RegionInfo.cpp
+++ b/lib/Analysis/RegionInfo.cpp
@@ -394,6 +394,7 @@ Region *Region::getExpandedRegion() const {
Region *R = RI->getRegionFor(exit);
+ assert(R && "Can not find a region for exit!");
if (R->getEntry() != exit) {
if (exit->getTerminator()->getNumSuccessors() == 1)
return new Region(getEntry(), *succ_begin(exit), RI, DT);
--
1.7.3.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Region-Check-the-exit-region-before-use-it-when-expa.patch
Type: application/octet-stream
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110404/3c09867c/attachment.obj>
More information about the llvm-commits
mailing list