Skip to content

[DiagnosticInfo] Fix the default DiagnosticSeverity #120342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

jsji
Copy link
Member

@jsji jsji commented Dec 18, 2024

After
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:".

After
llvm@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:".
@jsji jsji requested a review from arsenm December 18, 2024 01:01
@jsji jsji self-assigned this Dec 18, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 18, 2024

@llvm/pr-subscribers-llvm-ir

Author: Jinsong Ji (jsji)

Changes

After
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:".


Full diff: https://github.com/llvm/llvm-project/pull/120342.diff

1 Files Affected:

  • (modified) llvm/include/llvm/IR/DiagnosticInfo.h (+1-1)
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; }

@jsji jsji merged commit c189b2a into llvm:main Dec 18, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants