Commit Graph

113 Commits

Author SHA1 Message Date
Ted Kremenek 340fd2dd6e Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowed
to return an owning pointer.

llvm-svn: 66934
2009-03-13 20:27:06 +00:00
Ted Kremenek 0b891a343a retain/release checker: Allow allocations to fail by returning nil.
llvm-svn: 66487
2009-03-09 22:46:49 +00:00
Ted Kremenek 3987bbee34 Add test case for <rdar://problem/6659160>.
llvm-svn: 66483
2009-03-09 22:28:18 +00:00
Ted Kremenek a7ec605dbd Update test case: objects stored to self.ivar are not tracked.
llvm-svn: 66168
2009-03-05 18:15:02 +00:00
Ted Kremenek bea465aefb Update test case to include a leak that occurs at the place of allocation.
llvm-svn: 65048
2009-02-19 18:20:28 +00:00
Ted Kremenek b535181199 Static Analyzer driver/options (partial) cleanup:
- Move all analyzer options logic to AnalysisConsumer.cpp.
- Unified specification of stores/constraints/output to be:
   -analyzer-output=...
   -analyzer-store=...
   -analyzer-constraints=...
  instead of -analyzer-range-constraints, -analyzer-store-basic, etc.
- Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new
  interface
- Updated test cases to conform to new driver options

llvm-svn: 64737
2009-02-17 04:27:41 +00:00
Ted Kremenek fc5d067ea0 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).

llvm-svn: 63796
2009-02-04 23:49:09 +00:00
Ted Kremenek f675864e3c Add autorelease test case.
llvm-svn: 63237
2009-01-28 21:20:48 +00:00
Ted Kremenek f08ac278ed More hacking on static analyzer diagnostics. When emitting summary diagnostics the code paths for diagnostics involving paths or single locations are now unified. This patch also constifies many arguments/methods that are touched by this logic, leading to a nice overall code cleanup.
llvm-svn: 62903
2009-01-24 00:55:43 +00:00
Ted Kremenek fe32cc0ba6 Get RegionStore to work with the retain/release checker and its test cases.
Because the RegionStore can reason about values beyond the reasoning power of BasicStore, this patch splits some of the test cases for the retain/release checker to have versions that are handled by RegionStore (more warnings) and BasicStore (less warnings).

llvm-svn: 62667
2009-01-21 06:57:53 +00:00
Daniel Dunbar 34fc92fdc2 Add -analyze action to run static analyzer, instead of inferring from
individual checker options.

llvm-svn: 62634
2009-01-20 23:17:32 +00:00
Ted Kremenek 86afde337d Fix PR 3337 [retain/release checker]: Handle FunctionDecl's declared using typedefs.
llvm-svn: 62331
2009-01-16 18:40:33 +00:00
Ted Kremenek 7e90422e95 retain/release checker:
- Refactor a bunch of logic in the retain/release checker, making it more
  condense and easier to read.
- Add support for "Create" methods in the DiskArbitration framework

retain/release tests:
- Rename CFDate.m to retain-release.m, and move test from CFString.c to
  retain-release.m
- Add DiskArbitration framework tests cases.
- Add/refine and few more retain/release GC test cases.

llvm-svn: 62106
2009-01-12 21:45:02 +00:00