]> granicus.if.org Git - clang/commitdiff
libclang: remove 'CXDiagnostic_Remark'
authorAlp Toker <alp@nuanti.com>
Sat, 26 Apr 2014 14:43:53 +0000 (14:43 +0000)
committerAlp Toker <alp@nuanti.com>
Sat, 26 Apr 2014 14:43:53 +0000 (14:43 +0000)
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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207319 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 027f62d7dcd9e3815c0859166f90b0eb0f6993ad..280b98c8e7110e75be51b0de0dc72c337576f1ac 100644 (file)
@@ -652,12 +652,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.
index aec5f1bd64f214beeb9fcbab1f2125b0e060d9ca..f50c8855f60fe4e5da8835ee852db649f20f237d 100644 (file)
@@ -3753,7 +3753,6 @@ static const char *getDiagnosticCodeStr(enum CXLoadDiag_Error error) {
 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";
index cf9dc6f2407bdf1d07d433e046041e4d235f972c..8a57d7dfff19c3d2f2d9271aafebed2583aefe75 100644 (file)
@@ -308,7 +308,6 @@ CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) {
   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;
index 679c5285263a036a77c0f743f35976c124cf025c..8385f242d4498e9f44a3f3e6e898f9e88573f8e7 100644 (file)
@@ -79,8 +79,9 @@ CXDiagnosticSeverity CXLoadedDiagnostic::getSeverity() const {
   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");
index 45ce39b60d02dc301b88db766afc156631837c8f..faaf746a1e7038d4fc8bee5c7f22b1df7c44cb70 100644 (file)
@@ -31,7 +31,8 @@ CXDiagnosticSeverity CXStoredDiagnostic::getSeverity() const {
   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;