[DiagnosticInfo] Fix the default DiagnosticSeverity (#120342)

After
https://github.com/llvm/llvm-project/commit/ea632e1b34e1

the API call to LLVMContext->emitError(I, Errorstr) default to warning
instead of error.

This cause problems as the API mentioned it is "prefixed with error:".
This commit is contained in:
Jinsong Ji 2024-12-17 23:00:11 -05:00 committed by GitHub
parent b1f4a0201a
commit c189b2a1ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,7 +150,7 @@ public:
: DiagnosticInfo(DK_Generic, Severity), MsgStr(MsgStr) {}
DiagnosticInfoGeneric(const Instruction *I, const Twine &ErrMsg,
DiagnosticSeverity Severity = DS_Warning)
DiagnosticSeverity Severity = DS_Error)
: DiagnosticInfo(DK_Generic, Severity), MsgStr(ErrMsg), Inst(I) {}
const Twine &getMsgStr() const { return MsgStr; }