summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespaceKovarththanan Rajaratnam2009-11-2841-119/+104
| | | | llvm-svn: 90028
* Improve diagnostics in ReturnStackAddressChecker for returning a ↵Ted Kremenek2009-11-261-0/+8
| | | | | | stack-allocated block. Implements the rest of <rdar://problem/7387385>. llvm-svn: 89940
* Add a PostVisitBlockExpr() method to RetainReleaseChecker to query forTed Kremenek2009-11-261-1/+27
| | | | | | | | the set of variables "captured" by a block. Until the analysis gets more sophisticated, for now we stop the retain count tracking of any objects (transitively) referenced by these variables. llvm-svn: 89929
* Teach RegionStoreManager::RemoveDeadBindings() about BlockDataRegions. Any ↵Ted Kremenek2009-11-261-4/+17
| | | | | | VarRegion for a "captured" variable should also be considered live. llvm-svn: 89928
* Add iterators to BlockDataRegion that allow clients to iterate over the ↵Ted Kremenek2009-11-261-1/+61
| | | | | | VarRegions for "captured" variables for a block. llvm-svn: 89927
* Added batch versions of GRState::scanReachableSymbols() so that clients can ↵Ted Kremenek2009-11-261-0/+21
| | | | | | scan a collection of SVals or MemRegions all at once. llvm-svn: 89926
* Enhance LiveVariables to understand that blocks can extend the liveness of a ↵Ted Kremenek2009-11-262-15/+92
| | | | | | | | | | | | | | | variable by "capturing" them in a BlockExpr. This required two changes: 1) Added 'getReferencedgetReferencedBlockVars()' to AnalysisContext so that clients can iterate over the "captured" variables in a block. 2) Modified LiveVariables to take an AnalysisContext& in its constructor and to call getReferencedgetReferencedBlockVars() when it processes a BlockExpr*. llvm-svn: 89924
* Add missing case in switch statement.Ted Kremenek2009-11-251-1/+2
| | | | llvm-svn: 89903
* Refine MemRegions for blocks. Add a new region calledTed Kremenek2009-11-255-7/+43
| | | | | | | | | | | 'BlockDataRegion' to distinguish between the code associated with a block (which is represented by 'BlockTextRegion') and an instance of a block, which includes both code and data. 'BlockDataRegion' has an associated LocationContext, which can be used to eventually model the lifetime of a block object once LocationContexts can represent scopes (and iterations around a loop, etc.). llvm-svn: 89900
* Remove recently added FIXME. The appropriate FIXME is already in ↵Ted Kremenek2009-11-251-2/+0
| | | | | | MemRegionManager::getVarRegion(). llvm-svn: 89897
* Add FIXME.Ted Kremenek2009-11-251-0/+2
| | | | llvm-svn: 89892
* Add post-visit Checker support in GRExprEngine for BlockExpr.Ted Kremenek2009-11-251-1/+7
| | | | llvm-svn: 89890
* Add a new RetainReleaseChecker class (that subclasses CheckerVisitor) to ↵Ted Kremenek2009-11-251-0/+22
| | | | | | extend the functionality of the retain/release checker using the new Checker interface. Pieces of CFRefCount will gradually be migrated to this new class over time. llvm-svn: 89889
* Move RegisterChecks() to the end of the file. No functionality change.Ted Kremenek2009-11-251-57/+59
| | | | llvm-svn: 89888
* Make RegisterInternalChecks() part of GRExprEngine's private implementation ↵Ted Kremenek2009-11-251-30/+32
| | | | | | by making it a static function within GRExprEngine.cpp. llvm-svn: 89884
* Register internal checks with GRExprEngine when it is constructed, not ↵Ted Kremenek2009-11-251-1/+5
| | | | | | manually in AnalysisConsumer.cpp. llvm-svn: 89883
* When dispatching to Checker objects in GRExprEngine::CheckerVisit(),Ted Kremenek2009-11-251-4/+12
| | | | | | | | | only stop processing the checkers after all the nodes for a current check have been processed. This (I believe) handles the case where PredSet (the input nodes) contains more than one node due to state bifurcation. Zhongxing: can you review this? llvm-svn: 89882
* Add really basic support for blocks in the retain/release checker. For now, ↵Ted Kremenek2009-11-251-3/+14
| | | | | | anytime we pass a tracked object to a block call we stop tracking it. llvm-svn: 89831
* Allow building of CFGs for ASTs that contain BlockExprs.Ted Kremenek2009-11-251-3/+6
| | | | llvm-svn: 89830
* Add transfer function support for BlockExpr.Ted Kremenek2009-11-251-0/+12
| | | | llvm-svn: 89829
* Split CodeTextRegion into FunctionTextRegion and BlockTextRegion. This a ↵Ted Kremenek2009-11-256-16/+49
| | | | | | precursor to having basic static analysis support for blocks. llvm-svn: 89828
* For the nil-receiver checker, take into account the behavioral changes that ↵Ted Kremenek2009-11-241-6/+19
| | | | | | got introduced in Mac OS X 10.5 and later, notably return values of double, float, etc., will not be garbage. Fixes <rdar://problem/6829160>. llvm-svn: 89809
* Cleanups and fixes to the nil-receiver checker, some of it fallout theTed Kremenek2009-11-242-114/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | initial transition of the nil-receiver checker to the Checker interface as done in r89745. Some important changes include: 1) We consolidate the BugType object used for nil receiver bug reports, and don't include the type of the returned value in the BugType (which would be wrong if a nil receiver bug was reported more than once) 2) Added a new (temporary) flag to CheckerContext: DoneEvauating. This is used by GRExprEngine when evaluating message expressions to not continue evaluating the message expression if this flag is set. This flag is currently set by the nil receiver checker. This is an intermediate solution to allow the nil-receiver checker to properly work as a plug-in outside of GRExprEngine. Basically, this flag indicates that the entire message expression has been evaluated, not just a precondition (which is what the nil-receiver checker does). This flag *should not* be repurposed for general use, but just to pull more things out of GRExprEngine that already in there as we devise a better interface in the Checker class. 3) Cleaned up the logic in the nil-receiver checker, making the control-flow a lot easier to read. llvm-svn: 89804
* We can remove this file now.Zhongxing Xu2009-11-242-31/+0
| | | | llvm-svn: 89751
* Refactor undefined result checker. This is the last one.Zhongxing Xu2009-11-245-154/+122
| | | | llvm-svn: 89750
* Refactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into Zhongxing Xu2009-11-244-157/+134
| | | | | | CallAndMessageChecker. llvm-svn: 89745
* rename UndefinedArgChecker to CallAndMessageChecker.Zhongxing Xu2009-11-243-16/+16
| | | | llvm-svn: 89735
* Rename: UndefinedArgChecker.cpp => CallAndMessageChecker.cppZhongxing Xu2009-11-242-1/+1
| | | | llvm-svn: 89734
* Enhance null dereference diagnostics by indicating what variable (if any) ↵Ted Kremenek2009-11-242-4/+27
| | | | | | was dereferenced. Addresses <rdar://problem/7039161>. llvm-svn: 89726
* After performing a bounds check in ArrayBoundChecker, record the fact that a ↵Ted Kremenek2009-11-231-0/+6
| | | | | | bounds check succeeded by transitioning the ExplodedGraph. llvm-svn: 89712
* Clean up the Checker API a little more, resolving some hidden bugsTed Kremenek2009-11-2319-49/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | along the way. Important changes: 1) To generate a sink node, use GenerateSink(); GenerateNode() is for generating regular transitions. This makes the API clearer and also allows us to use the 'bool' option to GenerateNode() for a different purpose. 2) GenerateNode() now automatically adds the generated node to the destination ExplodedNodeSet (autotransition) unless the client specifies otherwise with a bool flag. Several checkers did not call 'addTransition()' after calling 'GenerateNode()', causing the simulation path to be prematurely culled when a non-fail stop bug was encountered. 3) Add variants of GenerateNode()/GenerateSink() that take neither a Stmt* or a GRState*; most callers of GenerateNode() just pass in the same Stmt* as provided when the CheckerContext object is created; we can just use that the majority of the time. This cleanup also allows us to potentially coelesce the APIs for evaluating branches and end-of-paths (which currently directly use builders). 4) addTransition() no longer needs to be called except for a few cases. We now have a variant of addTransition() that takes a GRState*; this allows one to propagate the updated state without caring about generating a new node explicitly. This nicely cleaned up a bunch of cases that called autoTransition() with a bunch of conditional logic surround the call (that common logic has now been swallowed up by addTransition() itself). llvm-svn: 89707
* Provide out-of-line definition for destructor of Checker.Ted Kremenek2009-11-232-0/+19
| | | | llvm-svn: 89688
* Tweak UndefBranchChecker to register the most nested "undefined" expression ↵Ted Kremenek2009-11-231-3/+4
| | | | | | with bugreporter::registerTrackNullOrUndefValue instead of the condition itself. llvm-svn: 89682
* Cleanup title/description of "undefined branch" BugType and add some test ↵Ted Kremenek2009-11-231-2/+1
| | | | | | cases for this check. llvm-svn: 89679
* Fix CMake buildDouglas Gregor2009-11-231-0/+1
| | | | llvm-svn: 89650
* UndefBranchChecker: more bug reporter helper information emit.Zhongxing Xu2009-11-232-90/+54
| | | | llvm-svn: 89643
* Initial refactor of UndefBranchChecker. We still use GRBranchNodeBuilderZhongxing Xu2009-11-234-41/+99
| | | | | | in the checker directly. But I don't have a better approach for now. llvm-svn: 89640
* Change CheckDeadStores to use Expr::isNullPointerConstant, which will ↵Ted Kremenek2009-11-221-6/+5
| | | | | | | | correctly determine whether an expression is a null pointer constant. Patch by Kovarththanan Rajaratnam! llvm-svn: 89621
* Undefined compound assignment result is checked in ↵Zhongxing Xu2009-11-221-9/+0
| | | | | | UndefinedAssignmentChecker. So this check is redundant. llvm-svn: 89592
* Remove invalid comments. The result is undefined only when operands are ↵Zhongxing Xu2009-11-221-2/+0
| | | | | | undefined. llvm-svn: 89591
* Save and restore the HasGen flag in MallocChecker.Zhongxing Xu2009-11-221-0/+1
| | | | llvm-svn: 89590
* Don't include a dead header.Benjamin Kramer2009-11-221-1/+0
| | | | llvm-svn: 89587
* Remove UndefinedAssignmentChecker's header.Zhongxing Xu2009-11-223-3/+21
| | | | llvm-svn: 89585
* Make FixedAddressChecker and experimental check; it currently produces a ton ↵Ted Kremenek2009-11-212-1/+2
| | | | | | of false positives when analyzing some projects (e.g., Wine). llvm-svn: 89560
* Restructure DereferenceChecker slightly to handle caching out when we would ↵Ted Kremenek2009-11-211-19/+22
| | | | | | report a null dereference more than once. llvm-svn: 89526
* Pull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker ↵Ted Kremenek2009-11-216-237/+191
| | | | | | also handled undefined receivers in message expressions. llvm-svn: 89524
* More checker refactoring. Passing undefined values in a message expression ↵Ted Kremenek2009-11-213-65/+34
| | | | | | is now handled by UndefinedArgChecker. llvm-svn: 89519
* Fix typo GCC 4.3 warned about.Benjamin Kramer2009-11-201-1/+1
| | | | llvm-svn: 89453
* Add simple static analyzer checker to check for sending 'release', 'retain', ↵Ted Kremenek2009-11-201-0/+61
| | | | | | etc. directly to a class. Fixes <rdar://problem/7252064>. llvm-svn: 89449
* Unused ivar checker: ivars referenced by lexically nested functions should ↵Ted Kremenek2009-11-201-1/+32
| | | | | | not be flagged as unused. Fixes <rdar://problem/7254495>. llvm-svn: 89448
OpenPOWER on IntegriCloud