summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/Analyzer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the unused, unmaintained, incomplete 'Index' library.Douglas Gregor2012-04-131-470/+0
| | | | llvm-svn: 154672
* Replace all comparisons between ObjCInterfaceDecl pointers with callsDouglas Gregor2011-12-151-2/+2
| | | | | | | | to declaresSameEntity(), as a baby step toward tracking forward declarations of Objective-C classes precisely. Part of <rdar://problem/10583531>. llvm-svn: 146618
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-4/+4
| | | | | | | | | | | | | | | | | | | | | 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-23/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Extend ObjCMessageExpr for class method sends with the source locationDouglas Gregor2010-03-081-2/+2
| | | | | | of the class name. llvm-svn: 97943
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-281-5/+4
| | | | llvm-svn: 90044
* Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:Argyrios Kyrtzidis2009-09-291-3/+2
| | | | | | | -A NamedDecl reference -A TypeLoc llvm-svn: 83095
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-15/+15
| | | | llvm-svn: 81346
* Fix gcc warning.Eli Friedman2009-07-301-2/+2
| | | | llvm-svn: 77555
* Add support for ObjC message expressions, in the Analyzer:Argyrios Kyrtzidis2009-07-301-2/+337
| | | | | | | -Accept an ObjC method and find all message expressions that this method may respond to. -Accept an ObjC message expression and find all methods that may respond to it. llvm-svn: 77551
* -Introduce the idx::Analyzer class used for getting indexing information, ↵Argyrios Kyrtzidis2009-07-291-0/+104
like finding references of a declaration across translation units. -Modify the index-test tool to use it. llvm-svn: 77536
OpenPOWER on IntegriCloud