summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add value invalidation logic for block-captured variables. Conceptually ↵Ted Kremenek2009-12-031-2/+10
| | | | | | invoking a block (without specific reasoning of what the block does) can invalidate any value to it by reference when the block was created. llvm-svn: 90431
* Add batch version of 'StoreManager::InvalidateRegion()' for invalidating ↵Ted Kremenek2009-12-031-17/+32
| | | | | | multiple regions as once. After adopting this in the CFRefCount::EvalCall(), we see a reduction in analysis time of 1.5% when analyzing all of SQLite3. llvm-svn: 90405
* Hard bifurcate the state into nil receiver and non-nil receiver, so thatZhongxing Xu2009-12-021-22/+9
| | | | | | | | | | | we don't need to use the DoneEvaluation hack when check for ObjCMessageExpr. PreVisitObjCMessageExpr() only checks for undefined receiver or arguments. Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface. llvm-svn: 90296
* Port BugReporter and BugType to StringRef.Benjamin Kramer2009-11-291-6/+6
| | | | llvm-svn: 90086
* lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespaceKovarththanan Rajaratnam2009-11-281-26/+25
| | | | llvm-svn: 90028
* 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
* Refine MemRegions for blocks. Add a new region calledTed Kremenek2009-11-251-1/+1
| | | | | | | | | | | '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
* 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
* 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
* Refactor NilReceiverStructRet and NilReceiverLargerThanVoidPtrRet into Zhongxing Xu2009-11-241-0/+10
| | | | | | CallAndMessageChecker. llvm-svn: 89745
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* Pull static variable within function (for slightly faster startup time).Ted Kremenek2009-11-131-2/+4
| | | | llvm-svn: 87065
* retain/release checker: refactor some of the summary lookup logic for ↵Ted Kremenek2009-11-131-288/+293
| | | | | | instance method summaries. No real functionality change, but it paves the way for new enhancements. llvm-svn: 87062
* Rename: StripCasts describes what it does better. Zhongxing Xu2009-11-101-1/+1
| | | | | | getBaseRegion will be used in another method. llvm-svn: 86649
* Change GRTransferFuncs::RegisterChecks() to take a GRExprEngine& instead of ↵Ted Kremenek2009-11-031-2/+4
| | | | | | a BugReporter&. This paves the way for pulling some of the retain/release checker into a "Checker" class. llvm-svn: 85971
* Move 'static inline' functions GetNullarySelector() and GetUnarySelector() ↵Ted Kremenek2009-11-031-14/+0
| | | | | | from CFRefCount.cpp to ASTContext.h. These functions are likely to be generally useful. llvm-svn: 85886
* retain/release checker: CGBitmapContextCreateWithData() returns an owned object.Ted Kremenek2009-11-031-1/+4
| | | | llvm-svn: 85867
* retain/release checker: Add special handling of CGBitmapContextCreateWithData().Ted Kremenek2009-11-031-0/+11
| | | | | Fixes: <rdar://problem/7358899> llvm-svn: 85864
* retain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start ↵Ted Kremenek2009-10-201-4/+6
| | | | | | | before '_' when determining Cocoa fundamental rule. Fixes: <rdar://problem/7265711> llvm-svn: 84569
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-181-1/+1
| | | | llvm-svn: 84436
* Simplify more.Daniel Dunbar2009-10-171-9/+5
| | | | llvm-svn: 84342
* Simplify.Daniel Dunbar2009-10-171-25/+4
| | | | llvm-svn: 84341
* retain/release checker: Stop tracking reference counts for any symbols ↵Ted Kremenek2009-10-161-8/+7
| | | | | | | | touched by StoreManager::InvalidateRegion(). This fixes <rdar://problem/7257223> and <rdar://problem/7283470>. llvm-svn: 84223
* Educate the retain/release checker about [NSCursor dragCopyCursor].Ted Kremenek2009-10-151-0/+5
| | | | | | This fixes <rdar://problem/7306898> llvm-svn: 84213
* retain/release checker: Use simpler utility method for creating class method ↵Ted Kremenek2009-10-151-7/+5
| | | | | | summaries. No functionality change. llvm-svn: 84210
* Remove stale comment.Ted Kremenek2009-10-141-3/+1
| | | | llvm-svn: 84157
* retain/release checker: Recognize that calls toTed Kremenek2009-10-141-3/+26
| | | | | | | | | | 'CVPixelBufferCreateWithPlanarBytes()' and 'CVPixelBufferCreateWithBytes' (Core Video API) can indirectly release a pixel buffer object via a callback. This fixes <rdar://problem/7283567>. llvm-svn: 84064
* retain/release checker: retained objects passed to pthread_create (asTed Kremenek2009-10-131-1/+7
| | | | | | | | the data argument) should not be tracked further until we support full IPA. (fixes <rdar://problem/7299394>) llvm-svn: 84047
* Fix bad grammar in static analyzer diagnostic. Reported by Robert Purves!Ted Kremenek2009-10-011-2/+2
| | | | llvm-svn: 83204
* Fix:Ted Kremenek2009-09-271-1/+1
| | | | | | | | | | | | | | | | <rdar://problem/6914474> checker doesn't realize that variable might have been assigned if a pointer to that variable was passed to another function via a structure The problem here was the RegionStoreManager::InvalidateRegion didn't invalidate the bindings of invalidated regions. This required a rewrite of this method using a worklist. As part of this fix, changed ValueManager::getConjuredSymbolVal() to require a 'void*' SymbolTag argument. This tag is used to differentiate two different symbols created at the same location. llvm-svn: 82920
* Fix: <rdar://problem/7242015> [RegionStore] variable passed-by-reference ↵Ted Kremenek2009-09-221-8/+9
| | | | | | (via integer) to function call not invalidated llvm-svn: 82523
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-7/+7
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Fix: <rdar://problem/5905851> do not report a leak when post-dominated by a callTed Kremenek2009-09-141-0/+4
| | | | | | to a noreturn or panic function llvm-svn: 81803
* Make AnalysisManager stateless. Now other analyzer components only depends onZhongxing Xu2009-09-101-5/+5
| | | | | | local node information. llvm-svn: 81433
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-638/+637
| | | | llvm-svn: 81346
* retain/release checker: [CIContext createCGImage...] and friends returned CFTed Kremenek2009-08-281-5/+8
| | | | | | | objects that are not automatically garbage collected. This fixes <rdar://problem/7174400>. llvm-svn: 80387
* Rename 'bindExpr' to 'BindExpr'.Ted Kremenek2009-08-271-5/+5
| | | | llvm-svn: 80294
* Simplify 'Environment' to contain only one map from 'const Stmt*' to SVals, ↵Ted Kremenek2009-08-271-5/+5
| | | | | | greatly simplifying the logic of the analyzer in many places. We now only distinguish between block-level expressions and subexpressions in Environment::RemoveDeadBindings and GRState pretty-printing. llvm-svn: 80194
* Remove CodeDecl and CFG from GRExprEngine and GRStateManager.Zhongxing Xu2009-08-251-7/+7
| | | | | | | Now AnalysisManager is the only place we can get CodeDecl. This leads to an API change: GRState::bindExpr() now takes the CFG argument. llvm-svn: 79980
* Remove Decl and CFG from ExplodedGraph. This leads to a series small changes.Zhongxing Xu2009-08-251-1/+1
| | | | llvm-svn: 79973
* Remove 'SelfRegion' field from both BasicStoreManager and RegionStoreManager.Ted Kremenek2009-08-211-7/+13
| | | | | | | | | | | | | | | | | | SelfRegion represented the object bound to 'self' (when analyzing Objective-C methods) upon entry to a method. Having this region stored on the side ignores the current stack frame that we might be analyzing (among other things), and is a problem for interprocedural analysis. For RegionStoreManager, the value for SelfRegion is just lazily created. For BasicStoreManager, the value for SelfRegion is bound eagerly to 'self', but no explicit tracking of SelfRegion on the side is made. As part of this change, remove the restriction in BasicStoreManager that we only track ivars for 'self'. This shouldn't actually change anything in terms of precision, and simplifies the logic. llvm-svn: 79694
* retain/release checker: Treat NSObject method '-awakeAfterUsingCoder:'Ted Kremenek2009-08-201-4/+9
| | | | | | just as if it behaved like an init function. This fixes <rdar://problem/7129086>. llvm-svn: 79515
* retain/release checker: Special case handling of CFAttributedStringSetAttribute,Ted Kremenek2009-08-201-4/+6
| | | | | | | fixing <rdar://problem/7152619>. Along the way, merge test cases in 'test/Analysis/rdar-6539791.c' into 'test/Analysis/retain-release.m'. llvm-svn: 79499
* Remove unused parameter BugReporter due to previous patch.Zhongxing Xu2009-08-181-4/+2
| | | | llvm-svn: 79328
* Extend the ProgramPoint to include the context information LocationContext,Zhongxing Xu2009-08-151-4/+7
| | | | | | | which is either a stack frame context of the function or a local scope context. llvm-svn: 79072
* Last step of template cleanup: merge *BuilderImpl to *Builder.Zhongxing Xu2009-08-061-25/+25
| | | | | | Some Builders need further cleanup. llvm-svn: 78301
* As GRState seems general enough, it is time to merge some template classes Zhongxing Xu2009-08-061-63/+63
| | | | | | | and their impl base classes. This can greatly simply some code of the core analysis engine. This patch merges ExplodedNodeImpl into ExplodedNode. llvm-svn: 78270
* Get rid of "smart" quotes. Per report on cfe-dev.Eli Friedman2009-08-051-1/+1
| | | | llvm-svn: 78230
OpenPOWER on IntegriCloud