aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CheckObjCDealloc.cpp
AgeCommit message (Collapse)Author
2009-09-25Fix checking for a null pointer constant when the expression itself isDouglas Gregor
value-dependent. Audit (and fixed) all calls to Expr::isNullPointerConstant() to provide the correct behavior with value-dependent expressions. Fixes PR5041 and a crash in libstdc++ <locale>. In the same vein, properly compute value- and type-dependence for ChooseExpr. Fixes PR4996. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21Remove 'AnalysisContext::setDecl()', as we the Decl associated with anTed Kremenek
AnalysisContext should never change. Along the way, propagate some constness around. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16Remove ASTContext::isObjCObjectPointerType().Steve Naroff
Convert all clients to use the new predicate on Type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30De-ASTContext-ify DeclContext.Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis
subclasses. Timings showed no significant difference before and after the commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor
methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 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-02-11Per PR 3187, disable the missing -dealloc check for classes that subclass ↵Ted Kremenek
SenTestCase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64292 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08'self.myIvar = nil' (properties) only releases myIvar when the property has ↵Ted Kremenek
kind 'assign'. This fixes <rdar://problem/6380411>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner
uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22New AST node to access "implicit" setter/getter using property dor syntax.Fariborz Jahanian
Issuing diagnostics when assigning to read-only properties. This is work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04Add a new expression class, ObjCSuperExpr, to handle the Objective-C ↵Douglas Gregor
'super'. Remove ObjCThis from PredefinedExpr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58698 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30Distinguish between self.X = ... where self.X is a property reference and ↵Ted Kremenek
self.X is an implicit call to setX. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30Patch by Nikita Zhuk:Ted Kremenek
Fix PR 2978 false positive for missing release in -dealloc of an ivar retained via a property and then released by assigning nil to that property: http://llvm.org/bugs/show_bug.cgi?id=2978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29Patch by Nikita Zhuk:Ted Kremenek
The attached patch adds additional checks to -warn-objc-missing-dealloc. It checks that all ivars which are used in implementation of synthesized properties are either a) released in dealloc if the property has retain" or "copy" attribute OR b) not released in dealloc if the property has "assign" attribute git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58363 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10rename PreDefinedExpr -> PredefinedExprChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25Remove call to isSEL and isSEL itself since the call is dead ↵Ted Kremenek
(isObjCObjectPointerType() will never return true for selectors). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25Only warn about missing/incomplete -dealloc implementations when a class ↵Ted Kremenek
contains a non-SEL, non-IBOutlet ivar that references an ObjC object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54024 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24Use ASTContext::isObjCObjectPointerType() to check if an ivar is a reference ↵Ted Kremenek
to an Objective-C object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24Don't issue a missing +dealloc warning for classes that just contain SEL ivars.Ted Kremenek
This fixes PR 2592: http://llvm.org/bugs/show_bug.cgi?id=2592 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15For the MissingDealloc check, don't treat IBOutlet ivars as being needed to ↵Ted Kremenek
be released git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53647 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14Added method "EmitBasicReport" to BugReporter to simplify the emission of ↵Ted Kremenek
simple bug diagnostics. Refactored error reporting in CheckObjCDealloc and CheckObjCInstMethSignature to use this new bug reporting interface (major code simplification). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11Fix comment.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53473 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07Do not emit a "missing -dealloc" warning if a class contains no ivars that ↵Ted Kremenek
are pointers. This patch aims to address some of the concerns of PR 2517: http://llvm.org/bugs/show_bug.cgi?id=2517 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53168 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03Skip the "-dealloc" check if a ObjC class contains no ivars.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03For the -dealloc checker, check the LangOptions to determine whether or not ↵Ted Kremenek
the code is compiled with GC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03Added static analysis check to see if a subclass of NSObject implements ↵Ted Kremenek
-dealloc, and whether or not that implementation calls [super dealloc]. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53075 91177308-0d34-0410-b5e6-96231b3b80d8