summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-2/+2
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* GRExprEngine/CFRefCount/GRSimpleVals: We don't do any special handling (yet) ↵Ted Kremenek2008-11-131-2/+2
| | | | | | of vector types. Add explicit checks that when we process integers that they really are scalars. llvm-svn: 59225
* Update method names involving GRStateRef. No functionality change.Ted Kremenek2008-11-121-9/+9
| | | | llvm-svn: 59153
* Fix regression with handling of CFMakeCollectable.Ted Kremenek2008-11-051-1/+6
| | | | llvm-svn: 58771
* initXXX methods can return owned objectsTed Kremenek2008-11-051-2/+7
| | | | llvm-svn: 58758
* Handle prefix '_' that may appear in front of the name of 'Release' functionsTed Kremenek2008-11-041-6/+3
| | | | llvm-svn: 58666
* Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wcharSanjiv Gupta2008-10-311-1/+1
| | | | | | | | | | etc more generic. For some targets, long may not be equal to pointer size. For example: PIC16 has int as i16, ptr as i16 but long as i32. Also fixed a few build warnings in assert() functions in CFRefCount.cpp, CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp. llvm-svn: 58501
* Extend "followsFundamentalRule" to ignore prefix '_' characters.Ted Kremenek2008-10-301-2/+2
| | | | llvm-svn: 58469
* IOServiceGetMatchingServices is a release function.Ted Kremenek2008-10-291-2/+14
| | | | llvm-svn: 58362
* Use "followsFundamentalRule" to determine if an instance method allocates ↵Ted Kremenek2008-10-241-8/+9
| | | | | | memory. llvm-svn: 58114
* followsFundamentalRule() returns true if "alloc" or "new" appear at the ↵Ted Kremenek2008-10-241-16/+22
| | | | | | beginning of the string, not anywhere within it. llvm-svn: 58112
* Issue warnings about owned objects returned from a method that does not ↵Ted Kremenek2008-10-241-54/+74
| | | | | | match the established Cocoa naming conventions. llvm-svn: 58108
* Disable warning about potential leaks of returned values until we test it a ↵Ted Kremenek2008-10-231-3/+33
| | | | | | little more (lots of noise). llvm-svn: 58021
* Warn about potentially leaked objects that are returned from methods whose ↵Ted Kremenek2008-10-221-16/+64
| | | | | | names do not follow the Cocoa Memory Management guidelines. llvm-svn: 58012
* Enhance reference-count checker to correctly identify CG "release" ↵Ted Kremenek2008-10-221-5/+13
| | | | | | functions. This fixes <rdar://problem/6303488>. llvm-svn: 57997
* Handle [NSAutoreleasePool addObject:] (an alternative way to add objects to ↵Ted Kremenek2008-10-211-2/+27
| | | | | | | | the current autorelease pool). Added initial code for tracking stack of autorelease pools. llvm-svn: 57908
* retain/release checker: Check if a tracked value escapes if we also try ↵Ted Kremenek2008-10-181-5/+21
| | | | | | binding it to the store and the store doesn't support that binding (i.e., it cannot track it). This has the nice feature that the checker will automatically get more powerful if we use a more powerful store model. llvm-svn: 57755
* When conjuring symbols to recover path-sensitivity, don't conjure symbols ↵Ted Kremenek2008-10-171-8/+21
| | | | | | that represent an entire struct. We need to implement struct temporaries as an actual "region", and then bind symbols to the FieldRegion of those temporaries. llvm-svn: 57739
* - constify some uses of MemRegion* (MemRegion should be immutable).Ted Kremenek2008-10-171-2/+2
| | | | | | | | | - Added new region "SymbolicRegion", which maps symbol values to the region domain. - Enhanced BasicStore::getFieldLValue() to return a FieldRegion (using SymbolicRegion) - Added some utility methods to GRState for fetch svals from the store. - Fixed regression in CheckNSError (we weren't getting the value bound to the parameter) llvm-svn: 57717
* This patch did the following renaming. There should be no functional changes.Zhongxing Xu2008-10-171-53/+53
| | | | | | | | | | RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc llvm-svn: 57671
* This is a big patch, but the functionality change is small and the rest of ↵Ted Kremenek2008-10-041-26/+68
| | | | | | | | | | | | | | the patch consists of deltas due to API changes. This patch overhauls the "memory region" abstraction that was prototyped (but never really used) as part of the Store.h. This patch adds MemRegion.h and MemRegion.cpp, which defines the class MemRegion and its subclasses. This classes serve to define an abstract representation of memory, with regions being layered on other regions to to capture the relationships between fields and variables, variables and the address space they are allocated in, and so on. The main motivation of this patch is that key parts of the analyzer assumed that all value bindings were to VarDecls. In the future this won't be the case, and this patch removes lval::DeclVal and replaces it with lval::MemRegionVal. Now all pieces of the analyzer must reason about abstract memory blocks instead of just variables. There should be no functionality change from this patch, but it opens the door for significant improvements to the analyzer such as field-sensitivity and object-sensitivity, both which were on hold until the memory abstraction got generalized. The memory region abstraction also allows type-information to literally be affixed to a memory region. This will allow the some now redundant logic to be removed from the retain/release checker. llvm-svn: 57042
* Add a QualType to ConjuredSymbol to represent the type and size of the symbol.Ted Kremenek2008-10-011-1/+3
| | | | | | Use this updated interface when invalidating arguments passed by reference; the type of symbol is of the object passed by reference, not the reference itself. llvm-svn: 56894
* Revert 56735. The old bug categories were more informative.Ted Kremenek2008-09-271-5/+1
| | | | llvm-svn: 56755
* Change "leaks" to have the category "Performance".Ted Kremenek2008-09-271-1/+5
| | | | llvm-svn: 56735
* Change casing of bug type.Ted Kremenek2008-09-211-1/+1
| | | | llvm-svn: 56405
* Add "category" to BugTypes, allowing bugs to be grouped.Ted Kremenek2008-09-201-5/+9
| | | | | | Changed casing of many bug names. The convention will be to have bug names (mostly) lower cased, and categories use some capitalization. llvm-svn: 56385
* Store: (static analyzer)Ted Kremenek2008-09-031-2/+2
| | | | | | | | | | | | | | | | | | | | | - Change definition of store::Region and store::Binding (once again) to make them real classes that just wrap pointers. This makes them more strictly typed, and allows specific implementations of Regions/Bindings to just subclass them. - minor renamings to RegionExtent and its subclasses - added a bunch of doxygen comments StoreManager: (static analyzer) - added 'iterBindings', an iteration method for iterating over the bindings of a store. It that takes a callback object (acting like a poor man's closure). - added 'getRVal' version for store::Binding. Will potentially phase the other versions of GetRVal in StoreManager out. - reimplemented 'getBindings' to be non-virtual and to use 'iterBindings' BasicStoreManager: (static analyzer) - implemented 'iterBindings' for BasicStoreManager llvm-svn: 55688
* Migrate the rest symbolic analysis stuff to BasicConstraintManager.Zhongxing Xu2008-08-291-1/+1
| | | | llvm-svn: 55536
* Added "getBindings" and "BindingAsString" to GRStateManager and StoreManager.Ted Kremenek2008-08-291-32/+25
| | | | | | | Migrated CFRefCount.cpp to use getBindings and BindingsAsString instead of making assumptions about the Store (removed dependence on GRState::vb_iterator). llvm-svn: 55522
* Migrate the retain/release checker to not manage the RefBindings::Factory objectTed Kremenek2008-08-171-46/+24
| | | | | | directly, but instead have GRStateManager manage it. llvm-svn: 54862
* GRState:Ted Kremenek2008-08-161-11/+7
| | | | | | | | | | | | | | - 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. llvm-svn: 54835
* Migrated retain/release checker to use the Generic Data Map in GRState (insteadTed Kremenek2008-08-141-143/+124
| | | | | | | | | | | | | | 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. llvm-svn: 54788
* Renamed GRState::CheckerStatePrinter to GRState::Printer.Ted Kremenek2008-08-131-10/+14
| | | | | | Updated checker state printer interface to allow transfer functions to return an arbitrary number of GRState::Printers. llvm-svn: 54762
* Rename ValueState -> GRState.Ted Kremenek2008-08-131-109/+109
| | | | | | Rename ValueStateManager -> GRStateManager. llvm-svn: 54721
* More cleanups. Add missing #include.Ted Kremenek2008-08-121-32/+7
| | | | llvm-svn: 54699
* More summary generation refactoring.Ted Kremenek2008-08-121-21/+23
| | | | llvm-svn: 54696
* Add variadic addInstMethSummary() and refactored addPanicSummary() to use ↵Ted Kremenek2008-08-121-85/+46
| | | | | | | | this method. (code reduction). Misc. cleanups. llvm-svn: 54694
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | | - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
* remove some unneeded calls to getCanonicalTypeChris Lattner2008-07-261-2/+1
| | | | llvm-svn: 54106
* Correctly handle NSAssertionHandle ↵Ted Kremenek2008-07-241-0/+1
| | | | | | | | -handleFailureInMethod:object:file:lineNumber:description: This fixes: http://llvm.org/bugs/show_bug.cgi?id=2593 llvm-svn: 53993
* Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to ↵Ted Kremenek2008-07-221-7/+2
| | | | | | GRExprEngineInternalChecks.cpp. llvm-svn: 53909
* "currentHandler" is a nullary selectorTed Kremenek2008-07-181-1/+1
| | | | llvm-svn: 53763
* Fix caching bug.Ted Kremenek2008-07-181-4/+6
| | | | llvm-svn: 53759
* Add panic support for NSAssertionHandler.Ted Kremenek2008-07-181-8/+66
| | | | llvm-svn: 53758
* Update signature of EvalAssume.Ted Kremenek2008-07-171-3/+3
| | | | llvm-svn: 53745
* isRetain() and isRelease() now only returns true if "Retain"/"Release" ↵Ted Kremenek2008-07-151-2/+4
| | | | | | appears in the suffix of a function's name. llvm-svn: 53621
* Support retain/release tracking for CoreGraphics (CGxxxRef) objects.Ted Kremenek2008-07-151-12/+83
| | | | llvm-svn: 53617
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-101-29/+33
| | | | | | | | | 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. llvm-svn: 53423
* Fix PR2519: correctly handle CFDictionaryCreate.Ted Kremenek2008-07-091-9/+31
| | | | llvm-svn: 53334
* Updated clients of ImmutableMap::SlimFind to use ImmutableMap::lookup instead.Ted Kremenek2008-07-071-34/+24
| | | | llvm-svn: 53172
OpenPOWER on IntegriCloud