aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
AgeCommit message (Collapse)Author
2009-04-23Per discussions with Ken Ferry and Paul Marks (<rdar://problem/6815234>) greatlyTed Kremenek
extend the number of objects tracked by the retain/release checker by assuming that all class and instance methods should follow Cocoa object "getter" and "alloc/new" conventions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20get a CodeTextRegion when visiting FunctionDecl reference.Zhongxing Xu
get FunctionDecl with more general utility method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor
lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09- Move ownership of MemRegionManager into ValueManager.Ted Kremenek
- Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly simplifies the calling interface to clients. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor
No functionality change (really). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09analyzer: Introduce a new class, ValueManager, that serves as an aggregateTed Kremenek
"manager of symbolic values", wrapping BasicValueFactory, SymbolManager, and MemRegionManager. While these individual managers nicely separate functionality in the analyzer, constructing symbolic values can sometimes be cumbersome because it requires using multiple managers at once. The goal of this class is to create some factory methods to create SVals that require the use of these different managers, thus (hopefully) simplifying the analyzer API for clients. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09stop using loc::SymbolVal.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09stop using loc::SymbolVal.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09clean up code with new API.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09clean up code with new API.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09Add a new method because sometimes the type of the conjured symbol is not theZhongxing Xu
type of the expression where we create the symbol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09make a conjured symbol as the original code.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09clean up code with new API.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Remove GetLeakNode. This isn't the right approach.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Eagerly compute the leak location when a leak occurs at the end of a path.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07retain/release checker: When hunting for the leak location, don't walk theTed Kremenek
ExplodedGraph backwards. That may inadvertently result in reverse control-flow edges in the PathDiagostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Sentence-case bug type.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03retain/release checker: don't track NSPanel until we have better reasoning aboutTed Kremenek
the subtle ownership issues of such objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Fix grammar.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Title-case the names of bug types.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01- Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocationTed Kremenek
instead of a FullSourceLoc. This resulted in a bunch of small edits in various clients. - Updated BugReporter to include an alternate PathDiagnostic generation algorithm for PathDiagnosticClients desiring more control-flow pieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-26analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek
Zhongxing and I discussed by email. Main changes: - Removed SymIntConstraintVal and SymIntConstraint - Added SymExpr as a parent class to SymbolData, SymSymExpr, SymIntExpr - Added nonloc::SymExprVal to wrap SymExpr - SymbolRef is now just a typedef of 'const SymbolData*' - Bunch of minor code cleanups in how some methods were invoked (no functionality change) This changes are part of a long-term plan to have full symbolic expression trees. This will be useful for lazily evaluating complicated expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67731 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20retain/release checker: Tracking autorelease counts for objects. We're still notTed Kremenek
completely there with accurately modeling autorelease pools. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17Stub out some code for support for NSDeallocateObject. This is enabled yet untilTed Kremenek
we resolve the semantics of this function when GC is enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17retain/release checker: Add support for reasoning about -dealloc.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowedTed Kremenek
to return an owning pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11Remove '[naming convention]' from bug type.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09retain/release checker: Allow allocations to fail by returning nil.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece andTed Kremenek
PathDiagnosticControlFlowPiece to distinguish (in the class hierarchy) between events and control-flow diagnostic pieces. Clients must now use these directly when constructing PathDiagnosticPieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05Minor tweak: Recognize 'CGCF' prefix in addition to 'CF' and 'CG'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05BasicStore:Ted Kremenek
- Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal binding. This mirrors some of the idea of RegionStore, but is far simpler and not nearly as functional. This leads to some code simplification and some potential for some minor precision hacks. Along the way... - constify the use of MemRegion* in a few places - add operator<<(llvm::raw_ostream, const MemRegion*) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05Fix message titleTed Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04For now, do not track NSWindow objects and it's subclasses.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Add prototype support for invalidating fields for structures passed-by-referenceTed Kremenek
to unknown functions. Most of this logic should be eventually moved to RegionStore and be made lazy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Added the notion of a "boundable region", which is a region that can have a ↵Ted Kremenek
direct binding in the StoreManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Use GetSValAsScalarOrLoc instead of GetSVal to prevent unintended structure ↵Ted Kremenek
or array "loads". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03Rework use of loc::SymbolVal in the retain/release checker to use the new methodTed Kremenek
SVal::getAsLocSymbol(). This simplifies the code and allows the retain/release checker to (I believe) also correctly reason about location symbols wrapped in SymbolicRegions. Along the way I cleaned up SymbolRef a little, disallowing implicit casts to 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01Rename AnonTypedRegion to TypedViewRegion.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Create a new TypeNodes.def file that enumerates all of the types,Douglas Gregor
giving them rough classifications (normal types, never-canonical types, always-dependent types, abstract type representations) and making it far easier to make sure that we've hit all of the cases when decoding types. Switched some switch() statements on the type class over to using this mechanism, and filtering out those things we don't care about. For example, CodeGen should never see always-dependent or non-canonical types, while debug info generation should never see always-dependent types. More switch() statements on the type class need to be moved over to using this approach, so that we'll get warnings when we add a new type then fail to account for it somewhere in the compiler. As part of this, some types have been renamed: TypeOfExpr -> TypeOfExprType FunctionTypeProto -> FunctionProtoType FunctionTypeNoProto -> FunctionNoProtoType There shouldn't be any functionality change... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Refine some grammar in the retain/release diagnostics.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25Fix recently introduced switch case fallthrough bug.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25retain/release checker: Implement basic tracking of autorelease stack. Next ↵Ted Kremenek
thing is to wire up pools with their contents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24Fix broken logic from my last commit. Branches only occur at basic blocks ↵Ted Kremenek
that end with terminators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24Fix diagnostic regression where the leak diagnostic could appear earlier in ↵Ted Kremenek
the path than the branches taken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24retain/release checker:Ted Kremenek
- For autorelease pool tracking, keep information about the stack of pools separate from their contents. Also, keep track of the number of times an autorelease pool will send the "release" message to an object when the pool is destroyed. - Update CFRefCount::Update to return a new state instead of a reference count binding. This will allow us to implement more complicated semantics with autorelease pools. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23Add more boilerplate logic to more accurately reason about autorelease pools.Ted Kremenek
This doesn't change the current functionality, but better codifies the autorelease pool stack itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23Fix 80 col. violations.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23Per Chris L.'s suggestion, use getAsFunctionType() instead of ↵Ted Kremenek
getDesguaredType(). Constify some pointers along the way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23retain/release checker: For now don't track the retain count of NSWindow ↵Ted Kremenek
objects (opt for false negatives). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23Remove typo.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65302 91177308-0d34-0410-b5e6-96231b3b80d8