summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2014-05-01 14:06:01 +0000
committerTobias Grosser <tobias@grosser.es>2014-05-01 14:06:01 +0000
commit86a85678f2a793dd2e82025f3af25ba45d6bbec1 (patch)
treec60dd9329203815ddef4aaf0326ad1dacede14b7 /clang/lib/Frontend
parent10961c0eab6bf294818470708625a5d4e786a015 (diff)
downloadbcm5719-llvm-86a85678f2a793dd2e82025f3af25ba45d6bbec1.tar.gz
bcm5719-llvm-86a85678f2a793dd2e82025f3af25ba45d6bbec1.zip
Support 'remark' in VerifyDiagnosticConsumer
After Diego added support for -Rpass=inliner we have now in-tree remarks which we can use to properly test this feature. llvm-svn: 207765
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/TextDiagnosticBuffer.cpp6
-rw-r--r--clang/lib/Frontend/VerifyDiagnosticConsumer.cpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticBuffer.cpp b/clang/lib/Frontend/TextDiagnosticBuffer.cpp
index b1c793a9709..9c6bebb0721 100644
--- a/clang/lib/Frontend/TextDiagnosticBuffer.cpp
+++ b/clang/lib/Frontend/TextDiagnosticBuffer.cpp
@@ -35,6 +35,9 @@ void TextDiagnosticBuffer::HandleDiagnostic(DiagnosticsEngine::Level Level,
case DiagnosticsEngine::Warning:
Warnings.push_back(std::make_pair(Info.getLocation(), Buf.str()));
break;
+ case DiagnosticsEngine::Remark:
+ Remarks.push_back(std::make_pair(Info.getLocation(), Buf.str()));
+ break;
case DiagnosticsEngine::Error:
case DiagnosticsEngine::Fatal:
Errors.push_back(std::make_pair(Info.getLocation(), Buf.str()));
@@ -50,6 +53,9 @@ void TextDiagnosticBuffer::FlushDiagnostics(DiagnosticsEngine &Diags) const {
for (const_iterator it = warn_begin(), ie = warn_end(); it != ie; ++it)
Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Warning, "%0"))
<< it->second;
+ for (const_iterator it = remark_begin(), ie = remark_end(); it != ie; ++it)
+ Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Remark, "%0"))
+ << it->second;
for (const_iterator it = note_begin(), ie = note_end(); it != ie; ++it)
Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Note, "%0"))
<< it->second;
diff --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
index d6d01156557..9df39782abb 100644
--- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -330,6 +330,8 @@ static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM,
DL = ED ? &ED->Errors : NULL;
else if (PH.Next("warning"))
DL = ED ? &ED->Warnings : NULL;
+ else if (PH.Next("remark"))
+ DL = ED ? &ED->Remarks : NULL;
else if (PH.Next("note"))
DL = ED ? &ED->Notes : NULL;
else if (PH.Next("no-diagnostics")) {
@@ -737,6 +739,10 @@ static unsigned CheckResults(DiagnosticsEngine &Diags, SourceManager &SourceMgr,
NumProblems += CheckLists(Diags, SourceMgr, "warning", ED.Warnings,
Buffer.warn_begin(), Buffer.warn_end());
+ // See if there are remark mismatches.
+ NumProblems += CheckLists(Diags, SourceMgr, "remark", ED.Remarks,
+ Buffer.remark_begin(), Buffer.remark_end());
+
// See if there are note mismatches.
NumProblems += CheckLists(Diags, SourceMgr, "note", ED.Notes,
Buffer.note_begin(), Buffer.note_end());
OpenPOWER on IntegriCloud