diff --git a/polly/include/polly/ScopDetectionDiagnostic.h b/polly/include/polly/ScopDetectionDiagnostic.h index 536cff97838d..ab4126d7043e 100644 --- a/polly/include/polly/ScopDetectionDiagnostic.h +++ b/polly/include/polly/ScopDetectionDiagnostic.h @@ -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); } }; diff --git a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp index 78e187ded2f8..f3f5a73136fa 100644 --- a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp +++ b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp @@ -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.