]> granicus.if.org Git - clang/commit
Overhaul BugReporter interface and implementation. The new interface cleans up
authorTed Kremenek <kremenek@apple.com>
Wed, 4 Feb 2009 23:49:09 +0000 (23:49 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 4 Feb 2009 23:49:09 +0000 (23:49 +0000)
commitcf118d41f7930a18dce97416ef7834a62642f587
tree6039374169ed1df174e825aac0b026fc6683d561
parenta9b66347bec984d1fd0378f85f092e2330344747
Overhaul BugReporter interface and implementation. The new interface cleans up
the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes,
and BugTypes are owned by the BugReporter object.

The major functionality change in this patch is that reports are not immediately
emitted by a call to BugReporter::EmitWarning (now called EmitReport), but
instead of queued up in report "equivalence classes". When
BugReporter::FlushReports() is called, it emits one diagnostic per report
equivalence class. This provides a nice cleanup with the caching of reports as
well as enables the BugReporter engine to select the "best" path for reporting a
path-sensitive bug based on all the locations in the ExplodedGraph that the same
bug could occur.

Along with this patch, Leaks are now coalesced into a common equivalence class
by their allocation site, and the "summary" diagnostic for leaks now reports the
allocation site as the location of the bug (this may later be augmented to also
provide an example location where the leak occurs).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63796 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
Driver/AnalysisConsumer.cpp
include/clang/Analysis/PathSensitive/BugReporter.h
include/clang/Analysis/PathSensitive/ExplodedGraph.h
include/clang/Analysis/PathSensitive/GRExprEngine.h
include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h
include/clang/Analysis/PathSensitive/GRTransferFuncs.h
lib/Analysis/BasicObjCFoundationChecks.cpp
lib/Analysis/BasicObjCFoundationChecks.h
lib/Analysis/BugReporter.cpp
lib/Analysis/CFRefCount.cpp
lib/Analysis/CheckNSError.cpp
lib/Analysis/ExplodedGraph.cpp
lib/Analysis/GRExprEngine.cpp
lib/Analysis/GRExprEngineInternalChecks.cpp
lib/Analysis/GRTransferFuncs.cpp
test/Analysis/CFDateGC.m
test/Analysis/CGColorSpace.c
test/Analysis/NSPanel.m
test/Analysis/NSString.m
test/Analysis/NSWindow.m
test/Analysis/refcnt_naming.m
test/Analysis/retain-release.m