r207319 - libclang: remove 'CXDiagnostic_Remark'

Alp Toker alp at nuanti.com
Sat Apr 26 07:43:53 PDT 2014


Author: alp
Date: Sat Apr 26 09:43:53 2014
New Revision: 207319

URL: http://llvm.org/viewvc/llvm-project?rev=207319&view=rev
Log:
libclang: remove 'CXDiagnostic_Remark'

The change was landed without review or test cases.

It trivially broke almost any stable application checking for Severity >=
CXDiagnostic_Error or indeed any other kind of severity comparison upon
encountering a 'remark'.

Mapped to CXDiagnostic_Warning until a workable solution is proposed to the
list that preserves API stability.

(It's also not clear why the rest of r202475 wasn't simply implemented as a
modifier to the existing 'warning' level.)

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/tools/c-index-test/c-index-test.c
    cfe/trunk/tools/libclang/CIndexDiagnostic.cpp
    cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp
    cfe/trunk/tools/libclang/CXStoredDiagnostic.cpp

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=207319&r1=207318&r2=207319&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Sat Apr 26 09:43:53 2014
@@ -653,12 +653,6 @@ enum CXDiagnosticSeverity {
   CXDiagnostic_Note    = 1,
 
   /**
-   * \brief This diagnostic is a remark that provides additional information
-   * for the user.
-   */
-  CXDiagnostic_Remark = 5,
-
-  /**
    * \brief This diagnostic indicates suspicious code that may not be
    * wrong.
    */

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=207319&r1=207318&r2=207319&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Sat Apr 26 09:43:53 2014
@@ -3753,7 +3753,6 @@ static const char *getDiagnosticCodeStr(
 static const char *getSeverityString(enum CXDiagnosticSeverity severity) {
   switch (severity) {
     case CXDiagnostic_Note: return "note";
-    case CXDiagnostic_Remark: return "remark";
     case CXDiagnostic_Error: return "error";
     case CXDiagnostic_Fatal: return "fatal";
     case CXDiagnostic_Ignored: return "ignored";

Modified: cfe/trunk/tools/libclang/CIndexDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexDiagnostic.cpp?rev=207319&r1=207318&r2=207319&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexDiagnostic.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexDiagnostic.cpp Sat Apr 26 09:43:53 2014
@@ -308,7 +308,6 @@ CXString clang_formatDiagnostic(CXDiagno
   switch (Severity) {
   case CXDiagnostic_Ignored: llvm_unreachable("impossible");
   case CXDiagnostic_Note: Out << "note: "; break;
-  case CXDiagnostic_Remark: Out << "remark: "; break;
   case CXDiagnostic_Warning: Out << "warning: "; break;
   case CXDiagnostic_Error: Out << "error: "; break;
   case CXDiagnostic_Fatal: Out << "fatal error: "; break;

Modified: cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp?rev=207319&r1=207318&r2=207319&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp (original)
+++ cfe/trunk/tools/libclang/CXLoadedDiagnostic.cpp Sat Apr 26 09:43:53 2014
@@ -79,8 +79,9 @@ CXDiagnosticSeverity CXLoadedDiagnostic:
   CASE(Warning)
   CASE(Error)
   CASE(Fatal)
-  CASE(Remark)
 #undef CASE
+  // The 'Remark' level isn't represented in the stable API.
+  case serialized_diags::Remark: return CXDiagnostic_Warning;
   }
   
   llvm_unreachable("Invalid diagnostic level");

Modified: cfe/trunk/tools/libclang/CXStoredDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXStoredDiagnostic.cpp?rev=207319&r1=207318&r2=207319&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXStoredDiagnostic.cpp (original)
+++ cfe/trunk/tools/libclang/CXStoredDiagnostic.cpp Sat Apr 26 09:43:53 2014
@@ -31,7 +31,8 @@ CXDiagnosticSeverity CXStoredDiagnostic:
   switch (Diag.getLevel()) {
     case DiagnosticsEngine::Ignored: return CXDiagnostic_Ignored;
     case DiagnosticsEngine::Note:    return CXDiagnostic_Note;
-    case DiagnosticsEngine::Remark:  return CXDiagnostic_Remark;
+    case DiagnosticsEngine::Remark:
+    // The 'Remark' level isn't represented in the stable API.
     case DiagnosticsEngine::Warning: return CXDiagnostic_Warning;
     case DiagnosticsEngine::Error:   return CXDiagnostic_Error;
     case DiagnosticsEngine::Fatal:   return CXDiagnostic_Fatal;





More information about the cfe-commits mailing list