mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Give llvm::SourceMgr the ability to have a client-specified
diagnostic handler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -168,13 +168,20 @@ 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);
|
||||
return;
|
||||
}
|
||||
|
||||
raw_ostream &OS = errs();
|
||||
|
||||
int CurBuf = FindBufferContainingLoc(Loc);
|
||||
|
||||
Reference in New Issue
Block a user