summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CheckNSError.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify more code by using SVal::getAsSymbol().Ted Kremenek2009-03-301-8/+6
| | | | llvm-svn: 68052
* Overhaul BugReporter interface and implementation. The new interface cleans upTed Kremenek2009-02-041-92/+65
| | | | | | | | | | | | | | | | | | | | | 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
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-1/+1
| | | | | | | | | | | uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. llvm-svn: 59947
* - constify some uses of MemRegion* (MemRegion should be immutable).Ted Kremenek2008-10-171-1/+5
| | | | | | | | | - Added new region "SymbolicRegion", which maps symbol values to the region domain. - Enhanced BasicStore::getFieldLValue() to return a FieldRegion (using SymbolicRegion) - Added some utility methods to GRState for fetch svals from the store. - Fixed regression in CheckNSError (we weren't getting the value bound to the parameter) llvm-svn: 57717
* This patch did the following renaming. There should be no functional changes.Zhongxing Xu2008-10-171-5/+5
| | | | | | | | | | RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc llvm-svn: 57671
* Remove lval::FieldOffset, lval::ArrayOffset. These will be replaced with ↵Ted Kremenek2008-10-171-1/+1
| | | | | | | | | | | regions. Remove GRExprEngine::getLVal and RValues::MakeVal. Enhance StoreManager "GetLValue" methods to dispatch for specific kinds of lvalue queries, as opposed to interogating the expression tree (GRExprEngine already does this). Added FIXMEs. In particular, we no longer "assume" that a base pointer in a field/array access is null (this logic was removed). Perhaps we should do this when fetching the lvalue for fields and array elements? llvm-svn: 57657
* This is a big patch, but the functionality change is small and the rest of ↵Ted Kremenek2008-10-041-1/+1
| | | | | | | | | | | | | | the patch consists of deltas due to API changes. This patch overhauls the "memory region" abstraction that was prototyped (but never really used) as part of the Store.h. This patch adds MemRegion.h and MemRegion.cpp, which defines the class MemRegion and its subclasses. This classes serve to define an abstract representation of memory, with regions being layered on other regions to to capture the relationships between fields and variables, variables and the address space they are allocated in, and so on. The main motivation of this patch is that key parts of the analyzer assumed that all value bindings were to VarDecls. In the future this won't be the case, and this patch removes lval::DeclVal and replaces it with lval::MemRegionVal. Now all pieces of the analyzer must reason about abstract memory blocks instead of just variables. There should be no functionality change from this patch, but it opens the door for significant improvements to the analyzer such as field-sensitivity and object-sensitivity, both which were on hold until the memory abstraction got generalized. The memory region abstraction also allows type-information to literally be affixed to a memory region. This will allow the some now redundant logic to be removed from the retain/release checker. llvm-svn: 57042
* Enhance NSError** checking with analogous checking for CFErrorRef*.Ted Kremenek2008-10-011-38/+137
| | | | | | Expand checking to include functions, not just methods. llvm-svn: 56938
* Add a bug category for NSError** checks.Ted Kremenek2008-09-211-0/+2
| | | | llvm-svn: 56394
* Register the implicit null-dereferenced object as a notable symbol.Ted Kremenek2008-09-181-0/+1
| | | | llvm-svn: 56319
* Implement second part of PR 2600: NSError** parameter may be null, and ↵Ted Kremenek2008-09-181-0/+48
| | | | | | should be checked before being dereferenced. llvm-svn: 56318
* Change implementation of NSError** coding-style check to be invoked at the ↵Ted Kremenek2008-09-181-42/+76
| | | | | | end of the retain/release analysis. llvm-svn: 56312
* Implemented one of the checks requested in PR 2600:Ted Kremenek2008-09-181-0/+72
"Method accepting NSError** argument should have non-void return value to indicate that an error occurred." Test case written, but the header needs to be delta-debugged reduced. Will commit shortly. llvm-svn: 56297
OpenPOWER on IntegriCloud