[llvm] c189b2a - [DiagnosticInfo] Fix the default DiagnosticSeverity (#120342)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 20:00:15 PST 2024
Author: Jinsong Ji
Date: 2024-12-17T23:00:11-05:00
New Revision: c189b2a1ece2804829350700bec568398550c49d
URL: https://github.com/llvm/llvm-project/commit/c189b2a1ece2804829350700bec568398550c49d
DIFF: https://github.com/llvm/llvm-project/commit/c189b2a1ece2804829350700bec568398550c49d.diff
LOG: [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:".
Added:
Modified:
llvm/include/llvm/IR/DiagnosticInfo.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h
index 0d582cc17967e5..694785317af040 100644
--- a/llvm/include/llvm/IR/DiagnosticInfo.h
+++ b/llvm/include/llvm/IR/DiagnosticInfo.h
@@ -150,7 +150,7 @@ class DiagnosticInfoGeneric : public DiagnosticInfo {
: 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; }
More information about the llvm-commits
mailing list