summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> ↵Argyrios Kyrtzidis2010-12-221-3495/+0
| | | | | | libclangGRCore llvm-svn: 122421
* [analyzer] Refactoring: include/clang/Checker -> include/clang/GRArgyrios Kyrtzidis2010-12-221-8/+8
| | | | llvm-svn: 122420
* Remove explicit summaries from retain/releaseTed Kremenek2010-12-171-26/+0
| | | | | | | checker that are automatically handled now by the Cocoa conventions logic. llvm-svn: 122047
* Move CocoaConventions.[h,cpp] from libCheckerTed Kremenek2010-12-171-1/+1
| | | | | | | | | to libAnalysis. Similar to Format (format string checking), CocoaConventions has the potential to serve clients other than the static analyzer. llvm-svn: 122040
* Minor refactoring; have BugReport::getRanges return a pair of iterator, no ↵Argyrios Kyrtzidis2010-12-041-4/+4
| | | | | | functionality change. llvm-svn: 120873
* Merge ValueManager into SValBuilder.Ted Kremenek2010-12-021-11/+11
| | | | llvm-svn: 120696
* Rename all 'AssumeXXX' methods in libCheckerTed Kremenek2010-12-011-2/+2
| | | | | | to 'assumeXXX'. llvm-svn: 120614
* Rename all 'EvalXXX' methods in libChecker toTed Kremenek2010-12-011-20/+20
| | | | | | 'evalXXX'. llvm-svn: 120609
* Adjust method calls to reflect name changes inTed Kremenek2010-11-241-20/+20
| | | | | | | | | | ImmutableSet/ImmtuableMap/ImmutableList APIs. Along the way, clean up some method names in the static analyzer so that they are more descriptive and/or start with lowercase letters. llvm-svn: 120071
* Tweak retain/release checker diagnostics to specify a leak occurs because an ↵Ted Kremenek2010-10-151-2/+2
| | | | | | | | object is not referenced later in the path, not that it isn't referenced later in the code. Fixes <rdar://problem/8527839>. llvm-svn: 116636
* Refactored BugReporter to refer to EndNode as ErrorNode. We currently make ↵Tom Care2010-09-161-1/+1
| | | | | | the assumption that EndNode == ErrorNode, but upcoming changes will break this. llvm-svn: 114065
* Remove dead code.Ted Kremenek2010-08-171-110/+0
| | | | llvm-svn: 111304
* Makes GRState::makeWithStore private, to encourage clients to make store ↵Jordy Rose2010-08-031-8/+5
| | | | | | | | changes through GRState instead of directly accessing the StoreManager. Also adds cover methods for InvalidateRegion(s) and EnterStackFrame to GRState. This is in preparation for proposed region change notifications. No functionality change. llvm-svn: 110137
* Fix idempotent operations false positive caused by ivars not being ↵Ted Kremenek2010-08-021-2/+11
| | | | | | | | invalidated in function calls when the enclosing object had retain/release state. Fixes <rdar://problem/8261992>. llvm-svn: 110068
* Constify all references to Stmt* and CFGBlock* in libChecker.Zhongxing Xu2010-07-201-18/+20
| | | | llvm-svn: 108811
* Constify.Zhongxing Xu2010-07-201-12/+15
| | | | llvm-svn: 108804
* remove const_cast.Zhongxing Xu2010-07-201-2/+1
| | | | llvm-svn: 108803
* Fix PR 7475 by enhancing the static analyzer to also invalidate bindings for ↵Ted Kremenek2010-07-011-96/+98
| | | | | | | | | | | non-static global variables when calling a function/method whose impact on global variables we cannot accurately estimate. This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily determining the value of a global. llvm-svn: 107423
* Add an ivar to SymbolReaper for the current statement, and then stop passing ↵Jordy Rose2010-07-011-3/+2
| | | | | | the current statement around everywhere. Preparation for symbolic extents. llvm-svn: 107422
* Introduce Type::isIntegralOrEnumerationType(), to cover those placesDouglas Gregor2010-06-161-1/+1
| | | | | | | | | | in C++ that involve both integral and enumeration types. Convert all of the callers to Type::isIntegralType() that are meant to work with both integral and enumeration types over to Type::isIntegralOrEnumerationType(), to prepare to eliminate enumeration types as integral types. llvm-svn: 106071
* Update retain-release checker to understand changes to how 'super' is ↵Ted Kremenek2010-05-211-7/+51
| | | | | | | | represented in the ASTs. Fixes <rdar://problem/8015556>. llvm-svn: 104389
* Pass around an error SourceRange instead of an Expr* when reporting errorsTed Kremenek2010-05-211-10/+10
| | | | | | in the Objective-C memory checker. llvm-svn: 104388
* Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointedJohn McCall2010-05-171-2/+2
| | | | | | out. The remaining ones are okay. llvm-svn: 103973
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Overhaul the AST representation of Objective-C message sendDouglas Gregor2010-04-211-36/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expressions, to improve source-location information, clarify the actual receiver of the message, and pave the way for proper C++ support. The ObjCMessageExpr node represents four different kinds of message sends in a single AST node: 1) Send to a object instance described by an expression (e.g., [x method:5]) 2) Send to a class described by the class name (e.g., [NSString method:5]) 3) Send to a superclass class (e.g, [super method:5] in class method) 4) Send to a superclass instance (e.g., [super method:5] in instance method) Previously these four cases where tangled together. Now, they have more distinct representations. Specific changes: 1) Unchanged; the object instance is represented by an Expr*. 2) Previously stored the ObjCInterfaceDecl* referring to the class receiving the message. Now stores a TypeSourceInfo* so that we know how the class was spelled. This both maintains typedef information and opens the door for more complicated C++ types (e.g., dependent types). There was an alternative, unused representation of these sends by naming the class via an IdentifierInfo *. In practice, we either had an ObjCInterfaceDecl *, from which we would get the IdentifierInfo *, or we fell into the case below... 3) Previously represented by a class message whose IdentifierInfo * referred to "super". Sema and CodeGen would use isStr("super") to determine if they had a send to super. Now represented as a "class super" send, where we have both the location of the "super" keyword and the ObjCInterfaceDecl* of the superclass we're targetting (statically). 4) Previously represented by an instance message whose receiver is a an ObjCSuperExpr, which Sema and CodeGen would check for via isa<ObjCSuperExpr>(). Now represented as an "instance super" send, where we have both the location of the "super" keyword and the ObjCInterfaceDecl* of the superclass we're targetting (statically). Note that ObjCSuperExpr only has one remaining use in the AST, which is for "super.prop" references. The new representation of ObjCMessageExpr is 2 pointers smaller than the old one, since it combines more storage. It also eliminates a leak when we loaded message-send expressions from a precompiled header. The representation also feels much cleaner to me; comments welcome! This patch attempts to maintain the same semantics we previously had with Objective-C message sends. In several places, there are massive changes that boil down to simply replacing a nested-if structure such as: if (message has a receiver expression) { // instance message if (isa<ObjCSuperExpr>(...)) { // send to super } else { // send to an object } } else { // class message if (name->isStr("super")) { // class send to super } else { // send to class } } with a switch switch (E->getReceiverKind()) { case ObjCMessageExpr::SuperInstance: ... case ObjCMessageExpr::Instance: ... case ObjCMessageExpr::SuperClass: ... case ObjCMessageExpr::Class:... } There are quite a few places (particularly in the checkers) where send-to-super is effectively ignored. I've placed FIXMEs in most of them, and attempted to address send-to-super in a reasonable way. This could use some review. llvm-svn: 101972
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-171-1/+1
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* Checker: random include cleanup.Benjamin Kramer2010-03-271-2/+1
| | | | llvm-svn: 99731
* Extend ObjCMessageExpr for class method sends with the source locationDouglas Gregor2010-03-081-2/+2
| | | | | | of the class name. llvm-svn: 97943
* Recognize attributes ns_returns_not_retained and cf_returns_not_retainedTed Kremenek2010-02-181-2/+16
| | | | | | in the static analyzer. llvm-svn: 96539
* Sort @includes.Ted Kremenek2010-02-181-11/+11
| | | | llvm-svn: 96537
* Reapply r95546, no intended change in performance or functionality.Benjamin Kramer2010-02-081-144/+70
| | | | llvm-svn: 95552
* Revert 95546 since it changed the algorithmic characteristics of the ↵Ted Kremenek2010-02-081-69/+146
| | | | | | convention lookup. llvm-svn: 95547
* Simplify code with StringRef.Benjamin Kramer2010-02-081-146/+69
| | | | | | 3 files changed, 76 insertions(+), 153 deletions(-) llvm-svn: 95546
* Revert 95541.Ted Kremenek2010-02-081-16/+15
| | | | llvm-svn: 95545
* Rename: GRState::getSVal(Stmt*) => getExprVal(),Zhongxing Xu2010-02-081-15/+16
| | | | | | GRState::getSVal(MemRegion*) => Load(). llvm-svn: 95541
* More GRState* -> Store changes.Zhongxing Xu2010-02-051-1/+3
| | | | llvm-svn: 95360
* Move more naming conventions logic out of the retain/release checker to ↵Ted Kremenek2010-01-271-87/+10
| | | | | | CocoaConventions.h. llvm-svn: 94682
* Remove unnecessary ASTContext* argument from isRefType().Ted Kremenek2010-01-271-5/+5
| | | | llvm-svn: 94665
* Start pulling out pieces of the monolithic retain/release checker intoTed Kremenek2010-01-271-125/+5
| | | | | | | | | reusable and modular API pieces. Start by pulling the logic for deriving the Cocoa naming convention into a separate API, header, and source file. llvm-svn: 94662
* Move 'LocalCheckers.h' to the 'Checkers' subdirectory.Ted Kremenek2010-01-261-1/+1
| | | | llvm-svn: 94609
* Move BugReporter.h, PathDiagnostic.h, and BugType.h to ↵Ted Kremenek2010-01-251-3/+3
| | | | | | 'include/Checker/BugReporter' llvm-svn: 94428
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-0/+3790
(1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
OpenPOWER on IntegriCloud