forked from OSchip/llvm-project
[MCParser] Bring back srcmanager diagnostics in AsmParser
AsmParser may have no LLVMContext attached to it, which means after
5de2d189e6
everything goes to stderr.
Restore the old behavior.
This commit is contained in:
parent
caa5144d56
commit
955365524a
|
@ -2370,6 +2370,9 @@ void AsmParser::DiagHandler(const SMDiagnostic &Diag, void *Context) {
|
|||
// manager changed or buffer changed (like in a nested include) then just
|
||||
// print the normal diagnostic using its Filename and LineNo.
|
||||
if (!Parser->CppHashInfo.LineNumber || DiagBuf != CppHashBuf) {
|
||||
if (Parser->SavedDiagHandler)
|
||||
Parser->SavedDiagHandler(Diag, Parser->SavedDiagContext);
|
||||
else
|
||||
Parser->getContext().diagnose(Diag);
|
||||
return;
|
||||
}
|
||||
|
@ -2389,6 +2392,9 @@ void AsmParser::DiagHandler(const SMDiagnostic &Diag, void *Context) {
|
|||
Diag.getColumnNo(), Diag.getKind(), Diag.getMessage(),
|
||||
Diag.getLineContents(), Diag.getRanges());
|
||||
|
||||
if (Parser->SavedDiagHandler)
|
||||
Parser->SavedDiagHandler(Diag, Parser->SavedDiagContext);
|
||||
else
|
||||
Parser->getContext().diagnose(NewDiag);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue