[cfe-commits] r86109 - in /cfe/trunk: test/Coverage/html-diagnostics.c tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Wed Nov 4 18:11:37 PST 2009


Author: ddunbar
Date: Wed Nov  4 20:11:37 2009
New Revision: 86109

URL: http://llvm.org/viewvc/llvm-project?rev=86109&view=rev
Log:
Remove clang-cc -html-diags option, this doesn't fit in well and we get plenty
of coverage of this from the analyzer.

If this bothers you, I can add it back in a mode where non-source diagnostics go
to stderr and only source diagnostics use -html-diags, but I don't think anyone
uses this.

Modified:
    cfe/trunk/test/Coverage/html-diagnostics.c
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/test/Coverage/html-diagnostics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/html-diagnostics.c?rev=86109&r1=86108&r2=86109&view=diff

==============================================================================
--- cfe/trunk/test/Coverage/html-diagnostics.c (original)
+++ cfe/trunk/test/Coverage/html-diagnostics.c Wed Nov  4 20:11:37 2009
@@ -1,5 +1,9 @@
 // RUN: rm -rf %t &&
-// RUN: clang-cc --html-diags=%t -checker-cfref %s
+// RUN: clang-cc -analyze -analyzer-output=html -checker-cfref -o %t %s &&
+// RUN: cat %t/*.html | FileCheck %s
+
+// CHECK: <h3>Annotated Source Code</h3>
+// CHECK: Dereference of null pointer
 
 void f0(int x) {
   int *p = &x;

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=86109&r1=86108&r2=86109&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Nov  4 20:11:37 2009
@@ -244,11 +244,6 @@
 VerifyDiagnostics("verify",
                   llvm::cl::desc("Verify emitted diagnostics and warnings"));
 
-static llvm::cl::opt<std::string>
-HTMLDiag("html-diags",
-         llvm::cl::desc("Generate HTML to report diagnostics"),
-         llvm::cl::value_desc("HTML directory"));
-
 static llvm::cl::opt<bool>
 NoShowColumn("fno-show-column",
              llvm::cl::desc("Do not include column number on diagnostics"));
@@ -2163,27 +2158,12 @@
       fprintf(stderr, "-verify only works on single input files for now.\n");
       return 1;
     }
-    if (!HTMLDiag.empty()) {
-      fprintf(stderr, "-verify and -html-diags don't work together\n");
-      return 1;
-    }
-  } else if (HTMLDiag.empty()) {
-    // Print diagnostics to stderr by default.
-    DiagClient.reset(new TextDiagnosticPrinter(llvm::errs(), DiagOpts));
   } else {
-    DiagClient.reset(CreateHTMLDiagnosticClient(HTMLDiag));
+    DiagClient.reset(new TextDiagnosticPrinter(llvm::errs(), DiagOpts));
   }
 
-  if (!DumpBuildInformation.empty()) {
-    if (!HTMLDiag.empty()) {
-      fprintf(stderr,
-              "-dump-build-information and -html-diags don't work together\n");
-      return 1;
-    }
-
+  if (!DumpBuildInformation.empty())
     SetUpBuildDumpLog(argc, argv, DiagClient);
-  }
-
 
   // Configure our handling of diagnostics.
   Diagnostic Diags(DiagClient.get());
@@ -2296,9 +2276,6 @@
                                               PP->getLangOptions().NoBuiltin);
     }
 
-    if (!HTMLDiag.empty())
-      ((PathDiagnosticClient*)DiagClient.get())->SetPreprocessor(PP.get());
-
     // Process the source file.
     ProcessInputFile(*PP, InFile, ProgAction, Features, Context);
 





More information about the cfe-commits mailing list