[PATCH 11/11] Add a print method for RejectLogs
Andreas Simbuerger
simbuerg at googlemail.com
Sun Jun 8 17:42:33 PDT 2014
---
include/polly/ScopDetectionDiagnostic.h | 2 ++
lib/Analysis/ScopDetectionDiagnostic.cpp | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/include/polly/ScopDetectionDiagnostic.h b/include/polly/ScopDetectionDiagnostic.h
index e7c2caf..9e44313 100644
--- a/include/polly/ScopDetectionDiagnostic.h
+++ b/include/polly/ScopDetectionDiagnostic.h
@@ -161,6 +161,8 @@ public:
size_t size() const { return ErrorReports.size(); }
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/lib/Analysis/ScopDetectionDiagnostic.cpp b/lib/Analysis/ScopDetectionDiagnostic.cpp
index 4231c2f..7f6facb 100644
--- a/lib/Analysis/ScopDetectionDiagnostic.cpp
+++ b/lib/Analysis/ScopDetectionDiagnostic.cpp
@@ -104,6 +104,14 @@ void emitRejectionRemarks(const llvm::Function &F, const RejectLog &Log,
}
//===----------------------------------------------------------------------===//
+// 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.
ReportCFG::ReportCFG(const RejectReasonKind K) : RejectReason(K) {
--
2.0.0
More information about the llvm-commits
mailing list