summaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAge
...
* Migrate the rest symbolic analysis stuff to BasicConstraintManager.Zhongxing Xu2008-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55536 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "getBindings" and "BindingAsString" to GRStateManager and StoreManager.Ted Kremenek2008-08-29
| | | | | | | | | Migrated CFRefCount.cpp to use getBindings and BindingsAsString instead of making assumptions about the Store (removed dependence on GRState::vb_iterator). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55522 91177308-0d34-0410-b5e6-96231b3b80d8
* Migrate the retain/release checker to not manage the RefBindings::Factory objectTed Kremenek2008-08-17
| | | | | | | directly, but instead have GRStateManager manage it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54862 91177308-0d34-0410-b5e6-96231b3b80d8
* GRState:Ted Kremenek2008-08-16
| | | | | | | | | | | | | | | - Remove ConstNotEq from GRState/GRStateManager (!= tracking uses GDM instead). - GRStateManager now can book-keep "contexts" (e.g., factory objects) for uses with data elements stored into the GDM. - Refactor pretty-printing of states to use GRState::Printer objects exclusively. This removed a huge amount of pretty-printing logic from GRExprEngine. CFRefCount - Simplified some API calls based on refinements to the GDM api. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54835 91177308-0d34-0410-b5e6-96231b3b80d8
* Migrated retain/release checker to use the Generic Data Map in GRState (insteadTed Kremenek2008-08-14
| | | | | | | | | | | | | | | of using CheckerState). Removed CheckerState from GRState. Added class GRStateRef which wraps GRState* and GRStateManager*. This is handy for generating new states with a single handle. Added member template set/get functions to GRStateRef/GRState/GRStateManager for accessing the Generic Data Map. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54788 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed GRState::CheckerStatePrinter to GRState::Printer.Ted Kremenek2008-08-13
| | | | | | | Updated checker state printer interface to allow transfer functions to return an arbitrary number of GRState::Printers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54762 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ValueState -> GRState.Ted Kremenek2008-08-13
| | | | | | | Rename ValueStateManager -> GRStateManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54721 91177308-0d34-0410-b5e6-96231b3b80d8
* More cleanups. Add missing #include.Ted Kremenek2008-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54699 91177308-0d34-0410-b5e6-96231b3b80d8
* More summary generation refactoring.Ted Kremenek2008-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54696 91177308-0d34-0410-b5e6-96231b3b80d8
* Add variadic addInstMethSummary() and refactored addPanicSummary() to use ↵Ted Kremenek2008-08-12
| | | | | | | | | this method. (code reduction). Misc. cleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54694 91177308-0d34-0410-b5e6-96231b3b80d8
* More #include cleaningDaniel Dunbar2008-08-11
| | | | | | | | | - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some unneeded calls to getCanonicalTypeChris Lattner2008-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54106 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly handle NSAssertionHandle ↵Ted Kremenek2008-07-24
| | | | | | | | | -handleFailureInMethod:object:file:lineNumber:description: This fixes: http://llvm.org/bugs/show_bug.cgi?id=2593 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53993 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to ↵Ted Kremenek2008-07-22
| | | | | | GRExprEngineInternalChecks.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53909 91177308-0d34-0410-b5e6-96231b3b80d8
* "currentHandler" is a nullary selectorTed Kremenek2008-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53763 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix caching bug.Ted Kremenek2008-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53759 91177308-0d34-0410-b5e6-96231b3b80d8
* Add panic support for NSAssertionHandler.Ted Kremenek2008-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53758 91177308-0d34-0410-b5e6-96231b3b80d8
* Update signature of EvalAssume.Ted Kremenek2008-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53745 91177308-0d34-0410-b5e6-96231b3b80d8
* isRetain() and isRelease() now only returns true if "Retain"/"Release" ↵Ted Kremenek2008-07-15
| | | | | | appears in the suffix of a function's name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53621 91177308-0d34-0410-b5e6-96231b3b80d8
* Support retain/release tracking for CoreGraphics (CGxxxRef) objects.Ted Kremenek2008-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53617 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-10
| | | | | | | | | | current store implementation is now encapsulated by BasicStore. These changes prompted some long due constification of ValueState. Much of the diffs in this patch include adding "const" qualifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53423 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2519: correctly handle CFDictionaryCreate.Ted Kremenek2008-07-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53334 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated clients of ImmutableMap::SlimFind to use ImmutableMap::lookup instead.Ted Kremenek2008-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53172 91177308-0d34-0410-b5e6-96231b3b80d8
* Use conjured symbols for variables whose values are invalidated whenTed Kremenek2008-07-03
| | | | | | | | | passed-by-reference to a function. This allows us to build up constraints for their new values and restore some lost path-sensitivity. This addresses a few false positives since in Adium. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53125 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactored some of the BugReporter interface so that data such as the ↵Ted Kremenek2008-07-02
| | | | | | | | | ASTContext&, PathDiagnosticClient*, can be provided by an external source. Split BugReporter into BugReporter and GRBugReporter so checkers not based on GRExprEngine can still use the BugReporter mechanism. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53048 91177308-0d34-0410-b5e6-96231b3b80d8
* Unlike NSWindow objects, NSPanel objects initially do not have self-ownership.Ted Kremenek2008-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52963 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily treat "Autorelease" as "StopTracking". This is the original ↵Ted Kremenek2008-07-01
| | | | | | behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52940 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "Autorelease" ArgEffect to better simulate "autorelease" messages. RightTed Kremenek2008-06-30
| | | | | | | | now this does the same thing as "MayEscape", but more functionality will go in here shortly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52904 91177308-0d34-0410-b5e6-96231b3b80d8
* CF ref checker:Ted Kremenek2008-06-25
| | | | | | | | | | | | | | | Tracked objects now have their type information tracked with them. Enhanced summaries for ObjC methods to include the type information of the receiver. Used the enhanced summaries to support the idiom that NSWindow owns itself (it sends a release message to itself upon close). Added some comments. Did some cleanups with the checker logic using operator overloading (reduced redundant code which I was concerned about being the source of bugs). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52741 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded method arguments.Ted Kremenek2008-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52668 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache ObjC summaries by IdentifierInfo*, not by ObjCInterfaceDecl.Ted Kremenek2008-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52667 91177308-0d34-0410-b5e6-96231b3b80d8
* Added ObjCSummaryCache, a new summary cache object to cache summaries for ↵Ted Kremenek2008-06-23
| | | | | | Objective-C methods. Instead of mapping from Selectors -> Summaries, we will now map from (ObjCInterfaceDecl*,Selectors) -> Summaries. This will allow more nuanced summary generation. This patch just swaps in the new data structure; the rest of the code works as before by allowing the ObjCInterfaceDecl* to be null. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52653 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename summary methods for "instance methods" to "class methods" (the names ↵Ted Kremenek2008-06-23
| | | | | | got screwed up). No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52650 91177308-0d34-0410-b5e6-96231b3b80d8
* The CF retain/release checker now assumes that allocations do not fail. ↵Ted Kremenek2008-06-23
| | | | | | Eventually we will add a flag to the driver to enable allocation failures (documented as a FIXME). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52632 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52378 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the CF retain checker about "_init" methods. Fixes: ↵Ted Kremenek2008-06-02
| | | | | | <rdar://problem/5956379> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51872 91177308-0d34-0410-b5e6-96231b3b80d8
* Prototyped support in the BugReporter to emit diagnostics of the form "p now ↵Ted Kremenek2008-05-22
| | | | | | aliases q". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51453 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand retain/release checker to consider methods/function calls that cause aTed Kremenek2008-05-22
| | | | | | | | | | | tracked object to "escape": it's reference count might be incremented by the called function, thus causing an object's lifetime to extend beyond when the local reference count is decremented to 0. This addresses: <rdar://problem/5933215> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51433 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache leaks by the allocation site, not the leak location.Ted Kremenek2008-05-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51198 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary ↵Ted Kremenek2008-05-09
| | | | | | to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50924 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for "drain".Ted Kremenek2008-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50831 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand the CF retain checker to allow the Create/Get rule to apply to anyTed Kremenek2008-05-07
| | | | | | | | | | | | | function that returns a CFxxxRef, not just functions whose name begins with CF. This implements <rdar://problem/5917879>. Added test case for this feature. Updated calls to CStrInCStrNoCase to swap their arguments, per compatibility with strcasestr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50829 91177308-0d34-0410-b5e6-96231b3b80d8
* Flip order of arguments to CStrInStrNoCase.Ted Kremenek2008-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50824 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not ↵Ted Kremenek2008-05-07
| | | | | | | | | portable. Correctly check if the result of CStrInCStrNoCase is NULL to generate summaries; before we were inverting the condition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50822 91177308-0d34-0410-b5e6-96231b3b80d8
* copy-paste: NS types are not typedefs.Ted Kremenek2008-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50817 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not treat **instance** methods "copyWithZone:" and "mutableCopyWithZone:" ↵Ted Kremenek2008-05-07
| | | | | | from NSObject as allocators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50802 91177308-0d34-0410-b5e6-96231b3b80d8
* Be less promiscuous with generating summaries for "new", "copy", "create".Ted Kremenek2008-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50798 91177308-0d34-0410-b5e6-96231b3b80d8
* Added auto-summary generation for createXXX, copyXXX, newXXX methods.Ted Kremenek2008-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50795 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't report leaks for autoreleased objects.Ted Kremenek2008-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50777 91177308-0d34-0410-b5e6-96231b3b80d8
* More comments.Ted Kremenek2008-05-06
| | | | | | | "#if 0" out some assumptions when auto-generating method summaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50772 91177308-0d34-0410-b5e6-96231b3b80d8