From ded7fa44395cdf3c267489acbd175f3a64fcc879 Mon Sep 17 00:00:00 2001 From: Andreas Simbuerger Date: Thu, 14 Aug 2014 08:53:15 +0000 Subject: [PATCH] Cleanup RejectLog code llvm-svn: 215626 --- polly/include/polly/ScopDetectionDiagnostic.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/polly/include/polly/ScopDetectionDiagnostic.h b/polly/include/polly/ScopDetectionDiagnostic.h index 37ba58a15542..536cff97838d 100644 --- a/polly/include/polly/ScopDetectionDiagnostic.h +++ b/polly/include/polly/ScopDetectionDiagnostic.h @@ -174,6 +174,10 @@ public: iterator begin() const { return ErrorReports.begin(); } iterator end() const { return ErrorReports.end(); } size_t size() const { return ErrorReports.size(); } + + /// @brief Returns true, if we store at least one error. + /// + /// @return true, if we store at least one error. bool hasErrors() const { return size() > 0; } const Region *region() const { return R; } @@ -214,7 +218,11 @@ public: } bool hasErrors(const Region *R) const { - return (Logs.count(R) && Logs.at(R).size() > 0); + if (!Logs.count(R)) + return false; + + RejectLog Log = Logs.at(R); + return Log.hasErrors(); } bool hasErrors(Region *R) const { return hasErrors((const Region *)R); }