From 5f970ec96e421f64db6b1c6509a902ea73d98cc7 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Tue, 6 Apr 2010 15:52:58 +0000 Subject: Update LLVM to r100520. --- lib/Support/SourceMgr.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/Support/SourceMgr.cpp') diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 83c7964..4e7520c 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -168,13 +168,21 @@ SMDiagnostic SourceMgr::GetMessage(SMLoc Loc, const std::string &Msg, } PrintedMsg += Msg; - return SMDiagnostic(CurMB->getBufferIdentifier(), FindLineNumber(Loc, CurBuf), + return SMDiagnostic(Loc, + CurMB->getBufferIdentifier(), FindLineNumber(Loc, CurBuf), Loc.getPointer()-LineStart, PrintedMsg, LineStr, ShowLine); } void SourceMgr::PrintMessage(SMLoc Loc, const std::string &Msg, const char *Type, bool ShowLine) const { + // Report the message with the diagnostic handler if present. + if (DiagHandler) { + DiagHandler(GetMessage(Loc, Msg, Type, ShowLine), + DiagContext, DiagLocCookie); + return; + } + raw_ostream &OS = errs(); int CurBuf = FindBufferContainingLoc(Loc); -- cgit v1.1