summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] bugreporter::getDerefExpr now takes a Stmt, not an ExplodedNode.Jordan Rose2013-01-261-2/+2
| | | | | | | This allows it to be used in places where the interesting statement doesn't match up with the current node. No functionality change. llvm-svn: 173546
* Add missing null check. Not sure why my tests passed before.Ted Kremenek2013-01-231-4/+6
| | | | llvm-svn: 173292
* Honor attribute 'analyzer_noreturn' on Objective-C methods.Ted Kremenek2013-01-231-0/+7
| | | | | | | | | This isn't likely a full solution, but it catches the common cases and can be refined over time. Fixes <rdar://problem/11634353>. llvm-svn: 173291
* [analyzer] DirectIvarAssignment: allow suppression annotation on Ivars.Anna Zaks2013-01-171-7/+17
| | | | llvm-svn: 172766
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-1/+1
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-162-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* [analyzer] Add an annotation to allow suppression of direct ivarAnna Zaks2013-01-161-0/+18
| | | | | | assignment llvm-svn: 172597
* [analyzer] Fix warning typo.Anna Zaks2013-01-161-2/+2
| | | | llvm-svn: 172596
* [analyzer] Refactor: parameter rename.Anna Zaks2013-01-162-2/+2
| | | | llvm-svn: 172595
* [analyzer] -drain is not an alias for -release.Jordan Rose2013-01-141-4/+0
| | | | | | | | | | | This was previously added to support -[NSAutoreleasePool drain], which behaves like -release under non-GC and "please collect" under GC. We're not currently modeling the autorelease pool stack, though, so we can just take this out entirely. Fixes PR14927. llvm-svn: 172444
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-129-17/+17
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* [analyzer] Rename the warning: state the issue before the hint of how itAnna Zaks2013-01-111-6/+5
| | | | | | can be fixed llvm-svn: 172170
* [analyzer]Recognize ivar invalidation protocol even if it was redeclaredAnna Zaks2013-01-111-2/+2
| | | | | | This will get rid of some false positives as well as false negatives. llvm-svn: 172169
* [analyzer] Ivar invalidation: track ivars declared in categories.Anna Zaks2013-01-111-7/+15
| | | | llvm-svn: 172168
* [analyzer] Allow IvarInvalidation checker to suppress warnings viaAnna Zaks2013-01-101-6/+14
| | | | | | | | | | | | assertions. To ensure that custom assertions/conditional would also be supported, just check if the ivar that needs to be invalidated or set to nil is compared against 0. Unfortunately, this will not work for code containing 'assert(IvarName)' llvm-svn: 172147
* [analyzer] Fix non-determinizm introduced in r172104.Anna Zaks2013-01-101-17/+29
| | | | | | | | In some cases, we just pick any ivar that needs invalidation and attach the warning to it. Picking the first from DenseMap of pointer keys was triggering non-deterministic output. llvm-svn: 172134
* [analyzer] Add more checks to the ObjC Ivar Invalidation checker.Anna Zaks2013-01-101-57/+118
| | | | | | | | | | | | | | Restructured the checker so that it could easily find two new classes of issues: - when a class contains an invalidatable ivar, but no declaration of an invalidation method - when a class contains an invalidatable ivar, but no definition of an invalidation method in the @implementation. The second case might trigger some false positives, for example, when the method is defined in a category. llvm-svn: 172104
* [analyzer] Include the bug uniqueing location in the issue_hash.Anna Zaks2013-01-082-28/+37
| | | | | | | | | | | | | | | The issue here is that if we have 2 leaks reported at the same line for which we cannot print the corresponding region info, they will get treated as the same by issue_hash+description. We need to AUGMENT the issue_hash with the allocation info to differentiate the two issues. Add the "hash" (offset from the beginning of a function) representing allocation site to solve the issue. We might want to generalize solution in the future when we decide to track more than just the 2 locations from the diagnostics. llvm-svn: 171825
* [analyzer] Fix a false positive in Secure Keychain API checker.Anna Zaks2013-01-072-8/+10
| | | | | | | | | Better handle the blacklisting of known bad deallocators when symbol escapes through a call to CFStringCreateWithBytesNoCopy. Addresses radar://12702952. llvm-svn: 171770
* [analyzer] Fix a false positive in the ivar invalidation checker.Anna Zaks2013-01-071-1/+3
| | | | | | | | | When a property is "inherited" through both a parent class and directly through a protocol, we should not require the child to invalidate it since the backing ivar belongs to the parent class. (Fixes radar://12913734) llvm-svn: 171769
* NSErrorChecker: remove quoting the parameter name in the diagnostic until we ↵Ted Kremenek2013-01-041-11/+8
| | | | | | | | | | actually include it's name. This is a possible regression of moving to using ImplicitNullDerefEvent. Fixing this for real (including the parameter name) requires more plumbing in ImplicitNullDerefEvent. This is just a stop gap fix. llvm-svn: 171502
* Tighten code. No functionality change.Ted Kremenek2013-01-041-7/+7
| | | | llvm-svn: 171501
* Make MallocChecker debug output useful.Ted Kremenek2013-01-031-2/+22
| | | | llvm-svn: 171439
* [analyzer] Rename callback EndPath -> EndFunctionAnna Zaks2013-01-034-14/+14
| | | | | | | This better reflects when callback is called and what the checkers are relying on. (Both names meant the same pre-IPA.) llvm-svn: 171432
* Fix typo: objc_no_direct_instance_variable_assignmemt => ↵Ted Kremenek2012-12-222-3/+3
| | | | | | | | objc_no_direct_instance_variable_assignment. Fixes <rdar://problem/12927551>. llvm-svn: 170971
* [analyzer] Convert SimpleStreamChecker to use the PointerEscape callbackAnna Zaks2012-12-221-80/+16
| | | | | | The new callback greatly simplifies the checker. llvm-svn: 170969
* [analyzer] Address Jordan's nitpicks as per code review of r170625.Anna Zaks2012-12-213-3/+3
| | | | llvm-svn: 170832
* Update RetainCountChecker to understand attribute ns_returns_autoreleased.Ted Kremenek2012-12-201-4/+6
| | | | | | Fixes <rdar://problem/12887356>. llvm-svn: 170724
* [analyzer] Add the pointer escaped callback.Anna Zaks2012-12-205-100/+48
| | | | | | | | | | Instead of using several callbacks to identify the pointer escape event, checkers now can register for the checkPointerEscape. Converted the Malloc checker to use the new callback. SimpleStreamChecker will be converted next. llvm-svn: 170625
* Don't include the header outside the include guards, it defeats the purpose ↵Argyrios Kyrtzidis2012-12-171-2/+2
| | | | | | of the include guards. llvm-svn: 170364
* [analyzer] Fix doc error (wrong param name) in ObjCSuperCallChecker.Jordan Rose2012-12-131-1/+1
| | | | | | Thanks for the -Wdocumentation catch, Dmitri! llvm-svn: 170139
* [analyzer] Generalize ObjCMissingSuperCallChecker.Jordan Rose2012-12-131-43/+109
| | | | | | | | We now check a few methods for UIResponder, NSResponder, and NSDocument. Patch by Julian Mayer! llvm-svn: 170089
* [analyzer] Fix a self-init checker false positive.Anna Zaks2012-12-131-2/+7
| | | | | | | | | | | This is a Band-Aid fix to a false positive, where we complain about not initializing self to [super init], where self is not coming from the init method, but is coming from the caller to init. The proper solution would be to associate the self and it's state with the enclosing init. llvm-svn: 170059
* [analyzer] Don't generate a summary for "freeWhenDone" if method isAnna Zaks2012-12-111-0/+3
| | | | | | | | | inlined. Fixes a false positive that occurs if a user writes their own initWithBytesNoCopy:freeWhenDone wrapper. llvm-svn: 169795
* [analyzer] Simplify RetainCountChecker's handling of dead symbols.Jordan Rose2012-12-061-29/+24
| | | | | | | | | Previously we made three passes over the set of dead symbols, and removed them from the state /twice/. Now we combine the autorelease pass and the symbol death pass, and only have to remove the bindings for the symbols that leaked. llvm-svn: 169527
* Only provide explicit getCapturedRegion() and getOriginalRegion() from ↵Ted Kremenek2012-12-063-3/+3
| | | | | | | | referenced_vars_iterator. This is a nice conceptual cleanup. llvm-svn: 169480
* Use 'getOriginalRegion()' rather than going through the logic to recreate it.Ted Kremenek2012-12-061-3/+1
| | | | llvm-svn: 169478
* Add missing virtual destructors reported by -Wnon-virtual-dtor.Daniel Jasper2012-12-051-0/+2
| | | | llvm-svn: 169365
* [analyzer] Implement an opt-in variant of direct ivar assignment.Anna Zaks2012-12-052-9/+57
| | | | | | | This will only check the direct ivar assignments in the annotated methods. llvm-svn: 169349
* Alphabetize source files, just like they have been before.Ted Kremenek2012-12-041-1/+1
| | | | llvm-svn: 169318
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-0461-134/+132
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Add raw_ostream include to pacify MSVC.Benjamin Kramer2012-12-011-0/+1
| | | | llvm-svn: 169097
* Include pruning and general cleanup.Benjamin Kramer2012-12-0117-1/+17
| | | | llvm-svn: 169095
* Don't include Type.h in DeclarationName.h.Benjamin Kramer2012-12-012-0/+2
| | | | | | Recursively prune some includes. llvm-svn: 169094
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-0110-10/+20
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* [analyzer] Fix a crash reported in PR 14400.Anna Zaks2012-11-261-0/+1
| | | | | | | | The AllocaRegion did not have the superRegion (based on LocationContext) as part of it's hash. As a consequence, the AllocaRegions from different frames were uniqued to be the same region. llvm-svn: 168599
* Make helpers static/anonymous.Benjamin Kramer2012-11-221-2/+2
| | | | llvm-svn: 168500
* [analyzer] StreamChecker: Remove now-unnecessary check::EndPath callback.Jordan Rose2012-11-151-46/+1
| | | | | | | Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168069
* [analyzer] MacOSKeychainAPIChecker: Remove now-unnecessary check::EndPath.Jordan Rose2012-11-151-75/+0
| | | | | | | Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168068
* [analyzer] MallocChecker: Remove now-unnecessary check::EndPath callback.Jordan Rose2012-11-151-29/+1
| | | | | | | Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168067
OpenPOWER on IntegriCloud