summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Change uses of:Ted Kremenek2009-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Remove some uses of TypedViewRegion, and use getBaseRegion() in a context whereTed Kremenek2009-07-291-1/+1
| | | | | | we don't care about ElementRegions layered on top of a base region. llvm-svn: 77484
* Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.Ted Kremenek2009-07-221-12/+13
| | | | | | | | | | | | Educate GRExprEngine::VisitGraph() about 'PreStmt'. Mark the constructor of 'PostStmt' to be explicit, preventing implicit conversions and the selection of the wrong 'generateNode' method in GRStmtNodeBuilder. Constify a bunch of arguments, which falls out of the changes to ProgramPoint. llvm-svn: 76809
* Fix long-lurking bug in ObjCSummaryCache revealed by Torok's recent memoryTed Kremenek2009-07-211-41/+38
| | | | | | | poisoning changes to DenseMap. We were using an iterator after it had been invalidated by an insertion into the DenseMap. llvm-svn: 76677
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-3/+3
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-3/+3
| | | | | | | | | | | | | | | | | | | | | This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
* Remove ASTContext::isObjCObjectPointerType().Steve Naroff2009-07-161-1/+1
| | | | | | Convert all clients to use the new predicate on Type. llvm-svn: 76076
* This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff2009-07-101-55/+39
| | | | | | | | | | | | The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
* Remove dead code.Zhongxing Xu2009-07-091-1/+0
| | | | llvm-svn: 75127
* Fix <rdar://problem/7033733>. The CF_RETURNS_RETAINED attribute should work ↵Ted Kremenek2009-07-061-3/+11
| | | | | | if the return type on an Objective-C method is a CF type reference, not just an Objective-C object reference. llvm-svn: 74841
* Further cleanup of region invalidation code. No functionality change.Zhongxing Xu2009-07-061-47/+39
| | | | llvm-svn: 74816
* Start to gradually move region invalidation code into store manager.Zhongxing Xu2009-07-061-66/+3
| | | | | | No functionality change. llvm-svn: 74812
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-7/+6
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-301-1/+1
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-5/+5
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
OpenPOWER on IntegriCloud