Add print method to RejectLog

llvm-svn: 215627
This commit is contained in:
Andreas Simbuerger 2014-08-14 08:53:18 +00:00
parent ded7fa4439
commit 57b469f842
2 changed files with 9 additions and 0 deletions

View File

@ -180,6 +180,8 @@ public:
/// @return true, if we store at least one error.
bool hasErrors() const { return size() > 0; }
void print(raw_ostream &OS, int level = 0) const;
const Region *region() const { return R; }
void report(RejectReasonPtr Reject) { ErrorReports.push_back(Reject); }
};

View File

@ -149,6 +149,13 @@ const llvm::DebugLoc &RejectReason::getDebugLoc() const {
return Unknown;
}
// RejectLog.
void RejectLog::print(raw_ostream &OS, int level) const {
int j = 0;
for (auto Reason : ErrorReports)
OS.indent(level) << "[" << j++ << "] " << Reason->getMessage() << "\n";
}
//===----------------------------------------------------------------------===//
// ReportCFG.