[cfe-commits] r106883 - in /cfe/trunk: lib/Checker/AnalysisConsumer.cpp test/Analysis/analyze_display_progress.c
Ted Kremenek
kremenek at apple.com
Fri Jun 25 13:59:24 PDT 2010
Author: kremenek
Date: Fri Jun 25 15:59:24 2010
New Revision: 106883
URL: http://llvm.org/viewvc/llvm-project?rev=106883&view=rev
Log:
Fix -analyze-display-progress (once again), this time with an additional regression test.
Added:
cfe/trunk/test/Analysis/analyze_display_progress.c
Modified:
cfe/trunk/lib/Checker/AnalysisConsumer.cpp
Modified: cfe/trunk/lib/Checker/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/AnalysisConsumer.cpp?rev=106883&r1=106882&r2=106883&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Checker/AnalysisConsumer.cpp Fri Jun 25 15:59:24 2010
@@ -80,8 +80,6 @@
const Preprocessor &PP;
const std::string OutDir;
AnalyzerOptions Opts;
- bool declDisplayed;
-
// PD is owned by AnalysisManager.
PathDiagnosticClient *PD;
@@ -95,7 +93,7 @@
const std::string& outdir,
const AnalyzerOptions& opts)
: Ctx(0), PP(pp), OutDir(outdir),
- Opts(opts), declDisplayed(false), PD(0) {
+ Opts(opts), PD(0) {
DigestAnalyzerOptions();
}
@@ -138,10 +136,9 @@
}
void DisplayFunction(const Decl *D) {
- if (!Opts.AnalyzerDisplayProgress || declDisplayed)
+ if (!Opts.AnalyzerDisplayProgress)
return;
- declDisplayed = true;
SourceManager &SM = Mgr->getASTContext().getSourceManager();
PresumedLoc Loc = SM.getPresumedLoc(D->getLocation());
llvm::errs() << "ANALYZE: " << Loc.getFilename();
@@ -210,6 +207,7 @@
if (!Opts.AnalyzeSpecificFunction.empty() &&
FD->getDeclName().getAsString() != Opts.AnalyzeSpecificFunction)
break;
+ DisplayFunction(FD);
HandleCode(FD, FD->getBody(), FunctionActions);
}
break;
@@ -222,6 +220,7 @@
if (!Opts.AnalyzeSpecificFunction.empty() &&
Opts.AnalyzeSpecificFunction != MD->getSelector().getAsString())
break;
+ DisplayFunction(MD);
HandleCode(MD, MD->getBody(), ObjCMethodActions);
}
break;
Added: cfe/trunk/test/Analysis/analyze_display_progress.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/analyze_display_progress.c?rev=106883&view=auto
==============================================================================
--- cfe/trunk/test/Analysis/analyze_display_progress.c (added)
+++ cfe/trunk/test/Analysis/analyze_display_progress.c Fri Jun 25 15:59:24 2010
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -analyze -analyzer-display-progress %s 2>&1 | FileCheck %s
+
+void f() {};
+void g() {};
+void h() {}
+
+// CHECK: analyze_display_progress.c f
+// CHECK: analyze_display_progress.c g
+// CHECK: analyze_display_progress.c h
\ No newline at end of file
More information about the cfe-commits
mailing list