Index: llvm/trunk/include/llvm/Support/SourceMgr.h =================================================================== --- llvm/trunk/include/llvm/Support/SourceMgr.h +++ llvm/trunk/include/llvm/Support/SourceMgr.h @@ -43,7 +43,8 @@ enum DiagKind { DK_Error, DK_Warning, - DK_Note + DK_Remark, + DK_Note, }; /// Clients that want to handle their own diagnostics in a custom way can Index: llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp =================================================================== --- llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp +++ llvm/trunk/lib/CodeGen/MIRParser/MIRParser.cpp @@ -214,6 +214,9 @@ case SourceMgr::DK_Note: Kind = DS_Note; break; + case SourceMgr::DK_Remark: + llvm_unreachable("remark unexpected"); + break; } Context.diagnose(DiagnosticInfoMIRParser(Kind, Diag)); } Index: llvm/trunk/lib/Support/SourceMgr.cpp =================================================================== --- llvm/trunk/lib/Support/SourceMgr.cpp +++ llvm/trunk/lib/Support/SourceMgr.cpp @@ -384,6 +384,11 @@ S.changeColor(raw_ostream::BLACK, true); S << "note: "; break; + case SourceMgr::DK_Remark: + if (ShowColors) + S.changeColor(raw_ostream::BLUE, true); + S << "remark: "; + break; } if (ShowColors) { Index: llvm/trunk/unittests/Support/SourceMgrTest.cpp =================================================================== --- llvm/trunk/unittests/Support/SourceMgrTest.cpp +++ llvm/trunk/unittests/Support/SourceMgrTest.cpp @@ -67,6 +67,16 @@ Output); } +TEST_F(SourceMgrTest, BasicRemark) { + setMainBuffer("aaa bbb\nccc ddd\n", "file.in"); + printMessage(getLoc(4), SourceMgr::DK_Remark, "message", None, None); + + EXPECT_EQ("file.in:1:5: remark: message\n" + "aaa bbb\n" + " ^\n", + Output); +} + TEST_F(SourceMgrTest, BasicNote) { setMainBuffer("aaa bbb\nccc ddd\n", "file.in"); printMessage(getLoc(4), SourceMgr::DK_Note, "message", None, None);