summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-02 18:01:49 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-02 18:01:49 +0000
commit789942cfda5fdde58c07b5912922e408b1d386cd (patch)
tree128f6b635002890e1eaf5941e3ad04cdc336a04b /clang/lib/Analysis/CFRefCount.cpp
parenta06e7120bb62bca7448b0180f88812b425e1d70f (diff)
downloadbcm5719-llvm-789942cfda5fdde58c07b5912922e408b1d386cd.tar.gz
bcm5719-llvm-789942cfda5fdde58c07b5912922e408b1d386cd.zip
When running the reference count checker twice (GC and non-GC mode), only emit
basic warnings (dead stores, null dereferences) on the first pass. llvm-svn: 50584
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index e62632cad8f..c3da51bd125 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -626,7 +626,8 @@ private:
// Instance variables.
CFRefSummaryManager Summaries;
- const bool GCEnabled;
+ const bool GCEnabled;
+ const bool EmitStandardWarnings;
const LangOptions& LOpts;
RefBFactoryTy RefBFactory;
@@ -674,9 +675,11 @@ private:
public:
- CFRefCount(ASTContext& Ctx, bool gcenabled, const LangOptions& lopts)
+ CFRefCount(ASTContext& Ctx, bool gcenabled, bool StandardWarnings,
+ const LangOptions& lopts)
: Summaries(Ctx, gcenabled),
GCEnabled(gcenabled),
+ EmitStandardWarnings(StandardWarnings),
LOpts(lopts),
RetainSelector(GetNullarySelector("retain", Ctx)),
ReleaseSelector(GetNullarySelector("release", Ctx)),
@@ -1539,7 +1542,7 @@ namespace {
} // end anonymous namespace
void CFRefCount::RegisterChecks(GRExprEngine& Eng) {
- GRSimpleVals::RegisterChecks(Eng);
+ if (EmitStandardWarnings) GRSimpleVals::RegisterChecks(Eng);
Eng.Register(new UseAfterRelease(*this));
Eng.Register(new BadRelease(*this));
Eng.Register(new Leak(*this));
@@ -1793,6 +1796,7 @@ void Leak::GetErrorNodes(std::vector<ExplodedNode<ValueState>*>& Nodes) {
//===----------------------------------------------------------------------===//
GRTransferFuncs* clang::MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled,
+ bool StandardWarnings,
const LangOptions& lopts) {
- return new CFRefCount(Ctx, GCEnabled, lopts);
+ return new CFRefCount(Ctx, GCEnabled, StandardWarnings, lopts);
}
OpenPOWER on IntegriCloud