summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use None rather than Optional<T>() where possible.David Blaikie2013-02-211-1/+1
| | | | llvm-svn: 175705
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-9/+6
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Remove redundant Optional type in favor of llvm::OptionalDavid Blaikie2013-02-201-24/+4
| | | | llvm-svn: 175678
* Replace SVal llvm::cast support to be well-defined.David Blaikie2013-02-201-10/+14
| | | | | | See r175462 for another example/more details. llvm-svn: 175594
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-7/+7
| | | | | | | | | | | | | 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
* Include pruning and general cleanup.Benjamin Kramer2012-12-011-0/+1
| | | | llvm-svn: 169095
* [analyzer] Check that the argument to CFMakeCollectable is non-NULL.Jordan Rose2012-11-071-9/+17
| | | | | | Patch by Sean McBride! llvm-svn: 167537
* [analyzer] Remove isWithinInlined. It's been replaced with inTopFrame().Anna Zaks2012-11-061-1/+1
| | | | | | Thanks Jordan. llvm-svn: 167438
* [analyzer] Rename 'EmitReport' to 'emitReport'.Jordan Rose2012-11-021-5/+5
| | | | | | No functionality change. llvm-svn: 167275
* [analyzer] Fix a buildbot crash triggered by turning on dynamicAnna Zaks2012-09-251-1/+1
| | | | | | dispatch. llvm-svn: 164579
* Make helper functions static.Benjamin Kramer2012-09-101-3/+3
| | | | llvm-svn: 163505
* [analyzer] Remove cast inside dyn_cast.Anna Zaks2012-08-301-1/+1
| | | | llvm-svn: 162951
* [analyzer] Fixup for r162935 as per Jordan's review.Anna Zaks2012-08-301-3/+3
| | | | | | Thanks for catching this! llvm-svn: 162949
* [analyzer] Do not propagate the [super init] could be nil assumptionAnna Zaks2012-08-301-8/+32
| | | | | | | | from callee to caller. radar://12109638 llvm-svn: 162935
* [analyzer] Rename addTrackNullOrUndefValueVisitor to trackNullOrUndefValue.Jordan Rose2012-08-281-1/+1
| | | | | | | | | | | This helper function (in the clang::ento::bugreporter namespace) may add more than one visitor, but conceptually it's tracking a single use of a null or undefined value and should do so as best it can. Also, the BugReport parameter has been made a reference to underscore that it is non-optional. llvm-svn: 162720
* [analyzer] Fixup to r162399. Initialize the member variable.Anna Zaks2012-08-221-0/+2
| | | | llvm-svn: 162405
* [analyzer] Add osx.cocoa.NonNilReturnValue checker.Anna Zaks2012-08-221-0/+45
| | | | | | | | The checker adds assumptions that the return values from the known APIs are non-nil. Teach the checker about NSArray/NSMutableArray/NSOrderedSet objectAtIndex, objectAtIndexedSubscript. llvm-svn: 162398
* [analyzer] When a symbol is null, we should track its constraints.Jordan Rose2012-08-031-2/+1
| | | | | | | | Because of this, we would previously emit NO path notes when a parameter is constrained to null (because there are no stores). Now we show where we made the assumption, which is much more useful. llvm-svn: 161280
* [analyzer] Rename Calls.{h,cpp} to CallEvent.{h,cpp}. No functionality change.Jordan Rose2012-07-261-1/+1
| | | | llvm-svn: 160815
* [analyzer] Finish replacing ObjCMessage with ObjCMethodDecl and friends.Jordan Rose2012-07-021-27/+26
| | | | | | | | The preObjCMessage and postObjCMessage callbacks now take an ObjCMethodCall argument, which can represent an explicit message send (ObjCMessageSend) or an implicit message generated by a property access (ObjCPropertyAccess). llvm-svn: 159559
* [analyzer] Add ObjCLoopChecker: objects from NSArray et al are non-nil.Jordan Rose2012-06-111-0/+74
| | | | | | | | | | | | While collections containing nil elements can still be iterated over in an Objective-C for-in loop, the most common Cocoa collections -- NSArray, NSDictionary, and NSSet -- cannot contain nil elements. This checker adds that assumption to the analyzer state. This was the cause of some minor false positives concerning CFRelease calls on objects in an NSArray. llvm-svn: 158319
* [analyzer] When looking for a known class, only traverse the hierarchy once.Jordan Rose2012-06-111-48/+50
| | | | | | | | | This has a small hit in the case where only one class is interesting (NilArgChecker) but is a big improvement when looking for one of several interesting classes (VariadicMethodTypeChecker), in which the most common case is that there is no match. llvm-svn: 158318
* [analyzer] Check that the arguments to NSOrderedSet creation methods are ↵Jordy Rose2012-04-061-0/+12
| | | | | | | | valid ObjC objects. Patch by Sean McBride! llvm-svn: 154194
* [analyzer] Implement basic path diagnostic pruning based on "interesting" ↵Ted Kremenek2012-03-091-1/+2
| | | | | | | | | | | | | | | | | symbols and regions. Essentially, a bug centers around a story for various symbols and regions. We should only include the path diagnostic events that relate to those symbols and regions. The pruning is done by associating a set of interesting symbols and regions with a BugReporter, which can be modified at BugReport creation or by BugReporterVisitors. This patch reduces the diagnostics emitted in several of our test cases. I've vetted these as having desired behavior. The only regression is a missing null check diagnostic for the return value of realloc() in test/Analysis/malloc-plist.c. This will require some investigation to fix, and I have added a FIXME to the test case. llvm-svn: 152361
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-4/+4
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-5/+5
| | | | llvm-svn: 149798
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.Ted Kremenek2012-01-261-4/+4
| | | | | | | | At this point this is largely cosmetic, but it opens the door to replace ProgramStateRef with a smart pointer that more eagerly acts in the role of reclaiming unused ProgramState objects. llvm-svn: 149081
* [analyzer] Make the entries in 'Environment' context-sensitive by making ↵Ted Kremenek2012-01-061-5/+7
| | | | | | | | | | | | | | | | | | entries map from (Stmt*,LocationContext*) pairs to SVals instead of Stmt* to SVals. This is needed to support basic IPA via inlining. Without this, we cannot tell if a Stmt* binding is part of the current analysis scope (StackFrameContext) or part of a parent context. This change introduces an uglification of the use of getSVal(), and thus takes two steps forward and one step back. There are also potential performance implications of enlarging the Environment. Both can be addressed going forward by refactoring the APIs and optimizing the internal representation of Environment. This patch mainly introduces the functionality upon when we want to build upon (and clean up). llvm-svn: 147688
* [analyzer] Refactor checkers to use helper function for getting callee Decl ↵Anna Zaks2011-12-011-8/+2
| | | | | | | | and name. We are getting name of the called function or it's declaration in a few checkers. Refactor them to use the helper function in the CheckerContext. llvm-svn: 145576
* [analyzer] Rename generateNode -> addTransition in CheckerContextAnna Zaks2011-10-261-4/+4
| | | | | | Also document addTransition methods. llvm-svn: 143059
* [analyzer] Simplify CheckerContextAnna Zaks2011-10-251-1/+1
| | | | | | | | | Remove dead members/parameters: ProgramState, respondsToCallback, autoTransition. Remove addTransition method since it's the same as generateNode. Maybe we should rename generateNode to genTransition (since a transition is always automatically generated)? llvm-svn: 142946
* [analyzer] Remove TransferFuncs.h, then deal with the fallout.Jordy Rose2011-09-021-0/+1
| | | | | | And with that, TransferFuncs is gone! llvm-svn: 139003
* Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) ↵Anna Zaks2011-08-191-1/+1
| | | | | | | | | | | | API in favor of addVisitor(BugReporterVisitor*). 1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well. 2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor. 3) Modify all the checkers to use the new API. llvm-svn: 138126
* Remove EnhancedBugReport and RangedBugReport - pull all the extra ↵Anna Zaks2011-08-171-5/+5
| | | | | | functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME. llvm-svn: 137894
* Rename GRState to ProgramState, and cleanup some code formatting along the way.Ted Kremenek2011-08-151-5/+5
| | | | llvm-svn: 137665
* Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer ↵Ted Kremenek2011-08-121-9/+9
| | | | | | and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. llvm-svn: 137537
* [analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can ↵Ted Kremenek2011-08-121-1/+1
| | | | | | | | separate TypedRegions that implement getValueType() from those that don't. Patch by Olaf Krzikalla! llvm-svn: 137498
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* [analyzer] Place checking for Core Foundation "Create" rule into a proper ↵Ted Kremenek2011-07-161-1/+1
| | | | | | API. No functionality change. llvm-svn: 135349
* Make the VariadicMethodTypeChecker accept block pointers as Objective-C ↵Anders Carlsson2011-04-191-0/+4
| | | | | | pointers. Fixes PR9746. llvm-svn: 129741
* Teach VariadicMethodTypeChecker to not crash when processing methods ↵Ted Kremenek2011-04-121-1/+2
| | | | | | declared in protocols. llvm-svn: 129395
* Teach VariadicMethodTypeChecker about pointers attributed as 'NSObject'.Ted Kremenek2011-03-171-0/+4
| | | | llvm-svn: 127798
* Teach VariadicMethodTypeChecker that CF references are valid arguments to ↵Ted Kremenek2011-03-171-0/+5
| | | | | | variadic Objective-C methods. llvm-svn: 127797
* VariadicMethodTypeChecker: don't warn for null pointer constants passed to ↵Ted Kremenek2011-03-161-0/+5
| | | | | | variadic Objective-C methods. llvm-svn: 127719
* Tweak VariadicMethodTypeChecker to only create one ExplodedNode when issuing ↵Ted Kremenek2011-03-141-7/+11
| | | | | | | | multiple warnings for the same message expression. Also add a test case showing that we correctly report multiple warnings for the same message expression. llvm-svn: 127605
* Add an Objective-C checker that checks that arguments passed to some ↵Anders Carlsson2011-03-131-0/+141
| | | | | | | | variadic Objective-C methods are of Objective-C pointer types. Ted or Argiris, I'd appreciate a review! llvm-svn: 127572
* Make the Objective-C checker look for subclasses of NSString instead of just ↵Anders Carlsson2011-03-081-13/+14
| | | | | | NSString and NSMutableString. llvm-svn: 127268
* [analyzer] Rename CheckerV2 -> Checker.Argyrios Kyrtzidis2011-03-011-5/+5
| | | | llvm-svn: 126726
* [analyzer] Remove unused checker stuff from AnalysisConsumer and some unused ↵Argyrios Kyrtzidis2011-02-281-3/+0
| | | | | | headers. llvm-svn: 126690
OpenPOWER on IntegriCloud