Skip to content
Snippets Groups Projects
Commit e8d4c9a2 authored by Tobias Grosser's avatar Tobias Grosser
Browse files

Add 'remark' diagnostic type in LLVM

A 'remark' is information that is not an error or a warning, but rather some
additional information provided to the user. In contrast to a 'note' a 'remark'
is an independent diagnostic, whereas a 'note' always depends on another
diagnostic.

A typical use case for remark nodes is information provided to the user, e.g.
information provided by the vectorizer about loops that have been vectorized.

llvm-svn: 202474
parent a82e4c80
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ typedef bool lto_bool_t; ...@@ -40,7 +40,7 @@ typedef bool lto_bool_t;
* @{ * @{
*/ */
#define LTO_API_VERSION 9 #define LTO_API_VERSION 10
/** /**
* \since prior to LTO_API_VERSION=3 * \since prior to LTO_API_VERSION=3
...@@ -299,9 +299,10 @@ lto_module_get_linkeropt(lto_module_t mod, unsigned int index); ...@@ -299,9 +299,10 @@ lto_module_get_linkeropt(lto_module_t mod, unsigned int index);
* \since LTO_API_VERSION=7 * \since LTO_API_VERSION=7
*/ */
typedef enum { typedef enum {
LTO_DS_ERROR, LTO_DS_ERROR = 0,
LTO_DS_WARNING, LTO_DS_WARNING = 1,
LTO_DS_NOTE LTO_DS_REMARK = 3, // Added in LTO_API_VERSION=10.
LTO_DS_NOTE = 2
} lto_codegen_diagnostic_severity_t; } lto_codegen_diagnostic_severity_t;
/** /**
......
...@@ -31,6 +31,9 @@ class Value; ...@@ -31,6 +31,9 @@ class Value;
enum DiagnosticSeverity { enum DiagnosticSeverity {
DS_Error, DS_Error,
DS_Warning, DS_Warning,
DS_Remark,
// A note attaches additional information to one of the previous diagnostic
// types.
DS_Note DS_Note
}; };
......
...@@ -142,6 +142,9 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) { ...@@ -142,6 +142,9 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) {
case DS_Warning: case DS_Warning:
errs() << "warning: " << MsgStorage << "\n"; errs() << "warning: " << MsgStorage << "\n";
break; break;
case DS_Remark:
errs() << "remark: " << MsgStorage << "\n";
break;
case DS_Note: case DS_Note:
errs() << "note: " << MsgStorage << "\n"; errs() << "note: " << MsgStorage << "\n";
break; break;
......
...@@ -562,6 +562,9 @@ void LTOCodeGenerator::DiagnosticHandler2(const DiagnosticInfo &DI) { ...@@ -562,6 +562,9 @@ void LTOCodeGenerator::DiagnosticHandler2(const DiagnosticInfo &DI) {
case DS_Warning: case DS_Warning:
Severity = LTO_DS_WARNING; Severity = LTO_DS_WARNING;
break; break;
case DS_Remark:
Severity = LTO_DS_REMARK;
break;
case DS_Note: case DS_Note:
Severity = LTO_DS_NOTE; Severity = LTO_DS_NOTE;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment