From: Daniel Dunbar Date: Thu, 5 Nov 2009 02:11:37 +0000 (+0000) Subject: Remove clang-cc -html-diags option, this doesn't fit in well and we get plenty X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad451ccdbf00199b223081552aaf1a798c7a7d3b;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86109 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Coverage/html-diagnostics.c b/test/Coverage/html-diagnostics.c index e3db1668d8..55376d0e44 100644 --- a/test/Coverage/html-diagnostics.c +++ b/test/Coverage/html-diagnostics.c @@ -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:

Annotated Source Code

+// CHECK: Dereference of null pointer void f0(int x) { int *p = &x; diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp index 724f060edd..2244e918f5 100644 --- a/tools/clang-cc/clang-cc.cpp +++ b/tools/clang-cc/clang-cc.cpp @@ -244,11 +244,6 @@ static llvm::cl::opt VerifyDiagnostics("verify", llvm::cl::desc("Verify emitted diagnostics and warnings")); -static llvm::cl::opt -HTMLDiag("html-diags", - llvm::cl::desc("Generate HTML to report diagnostics"), - llvm::cl::value_desc("HTML directory")); - static llvm::cl::opt NoShowColumn("fno-show-column", llvm::cl::desc("Do not include column number on diagnostics")); @@ -2163,27 +2158,12 @@ int main(int argc, char **argv) { 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 @@ int main(int argc, char **argv) { PP->getLangOptions().NoBuiltin); } - if (!HTMLDiag.empty()) - ((PathDiagnosticClient*)DiagClient.get())->SetPreprocessor(PP.get()); - // Process the source file. ProcessInputFile(*PP, InFile, ProgAction, Features, Context);