Cleanup RejectLog code

llvm-svn: 215626
This commit is contained in:
Andreas Simbuerger 2014-08-14 08:53:15 +00:00
parent 05ae147d25
commit ded7fa4439
1 changed files with 9 additions and 1 deletions

View File

@ -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); }