[llvm] r202474 - Add 'remark' diagnostic type in LLVM

Tobias Grosser tobias at grosser.es
Fri Feb 28 01:08:45 PST 2014


Author: grosser
Date: Fri Feb 28 03:08:45 2014
New Revision: 202474

URL: http://llvm.org/viewvc/llvm-project?rev=202474&view=rev
Log:
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.

Modified:
    llvm/trunk/include/llvm-c/lto.h
    llvm/trunk/include/llvm/IR/DiagnosticInfo.h
    llvm/trunk/lib/IR/LLVMContext.cpp
    llvm/trunk/lib/LTO/LTOCodeGenerator.cpp

Modified: llvm/trunk/include/llvm-c/lto.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/lto.h?rev=202474&r1=202473&r2=202474&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/lto.h (original)
+++ llvm/trunk/include/llvm-c/lto.h Fri Feb 28 03:08:45 2014
@@ -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
@@ -299,9 +299,10 @@ lto_module_get_linkeropt(lto_module_t mo
  * \since LTO_API_VERSION=7
  */
 typedef enum {
-  LTO_DS_ERROR,
-  LTO_DS_WARNING,
-  LTO_DS_NOTE
+  LTO_DS_ERROR = 0,
+  LTO_DS_WARNING = 1,
+  LTO_DS_REMARK = 3, // Added in LTO_API_VERSION=10.
+  LTO_DS_NOTE = 2
 } lto_codegen_diagnostic_severity_t;
 
 /**

Modified: llvm/trunk/include/llvm/IR/DiagnosticInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DiagnosticInfo.h?rev=202474&r1=202473&r2=202474&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DiagnosticInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DiagnosticInfo.h Fri Feb 28 03:08:45 2014
@@ -31,6 +31,9 @@ class Value;
 enum DiagnosticSeverity {
   DS_Error,
   DS_Warning,
+  DS_Remark,
+  // A note attaches additional information to one of the previous diagnostic
+  // types.
   DS_Note
 };
 

Modified: llvm/trunk/lib/IR/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContext.cpp?rev=202474&r1=202473&r2=202474&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LLVMContext.cpp (original)
+++ llvm/trunk/lib/IR/LLVMContext.cpp Fri Feb 28 03:08:45 2014
@@ -142,6 +142,9 @@ void LLVMContext::diagnose(const Diagnos
   case DS_Warning:
     errs() << "warning: " << MsgStorage << "\n";
     break;
+  case DS_Remark:
+    errs() << "remark: " << MsgStorage << "\n";
+    break;
   case DS_Note:
     errs() << "note: " << MsgStorage << "\n";
     break;

Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=202474&r1=202473&r2=202474&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Fri Feb 28 03:08:45 2014
@@ -562,6 +562,9 @@ void LTOCodeGenerator::DiagnosticHandler
   case DS_Warning:
     Severity = LTO_DS_WARNING;
     break;
+  case DS_Remark:
+    Severity = LTO_DS_REMARK;
+    break;
   case DS_Note:
     Severity = LTO_DS_NOTE;
     break;





More information about the llvm-commits mailing list