summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Diagnose when accessing property in a class method andFariborz Jahanian2010-12-031-4/+6
| | | | | | | no property accessor class method to be found, instead of crashing in IRGen. // rdar://8703553 llvm-svn: 120855
* Extend ExternalASTSource with the ability to lazily complete theDouglas Gregor2010-12-011-1/+31
| | | | | | | | | | | | | definition of an Objective-C class. Unlike with C/C++ classes, we don't have a well-defined point in Sema where Objective-C classes are checked for completeness, nor do we need to involve Sema when completing a class. Therefore, we take the appropriate of having the external AST source mark a particular Objective-C class as having an external declaration; when using one of the accessors of an Objective-C class that has an external declaration, we request that the external AST source fill in the Objective-C class definition. llvm-svn: 120627
* For an Objective-C @synthesize statement, e.g.,Douglas Gregor2010-11-171-3/+10
| | | | | | | | | @synthesize foo = _foo; keep track of the location of the ivar ("_foo"). Teach libclang to visit the ivar as a member reference. llvm-svn: 119447
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-301-1/+1
| | | | | | PR8423 llvm-svn: 117775
* Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ↵Ted Kremenek2010-09-011-20/+20
| | | | | | | | | | | | | ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols (and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in an @interface declaration. 'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced in both the @interface and class extensions. The latter is needed for semantic analysis/codegen, while the former is needed to maintain the lexical information of the original source. Fixes <rdar://problem/8380046>. llvm-svn: 112691
* Support for IRGen of synthesize bitfield ivars inFariborz Jahanian2010-08-231-3/+10
| | | | | | objc-nonfragile-abi2 (radar 7824380). llvm-svn: 111823
* objective-c ivar refactoring patch. IterationsFariborz Jahanian2010-08-201-1/+55
| | | | | | | | over ivars for a varienty of puposes is now consolidated into two small routines; DeepCollectObjCIvars and ShallowCollectObjCIvars. llvm-svn: 111679
* Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor2010-08-111-23/+3
| | | | | | | | and create separate decl nodes for forward declarations and the definition," which appears to be causing significant Objective-C breakage. llvm-svn: 110803
* - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for ↵Sebastian Redl2010-08-091-3/+23
| | | | | | | | | | forward declarations and the definition. - Eagerly create ObjCInterfaceTypes for declarations. - The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another. - Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated. llvm-svn: 110610
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-70/+1
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* atch for implementation of objective-c's -WselectorFariborz Jahanian2010-07-221-1/+3
| | | | | | | warning flag in clang. Little more to do for a PCH issue. Radar 6507158. llvm-svn: 109129
* Patch to synthesize property ivars on demand asFariborz Jahanian2010-07-171-2/+3
| | | | | | | part of the new property synthesis by default. wip. llvm-svn: 108599
* Patch to provide separate ASTs for multiple ObjC class extension Fariborz Jahanian2010-06-221-6/+15
| | | | | | declarations (implements radar 7928731). llvm-svn: 106597
* Remember type source information for Objective C property declarations.John McCall2010-06-041-1/+1
| | | | llvm-svn: 105484
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-171-0/+12
| | | | | | | | 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
* Implement method type encoding in the presenseFariborz Jahanian2010-04-081-2/+4
| | | | | | of c-style arguments. Completes radar 7445205. llvm-svn: 100813
* AST: Add ObjCIvarDecl::getContainingInterface().Daniel Dunbar2010-04-021-0/+23
| | | | llvm-svn: 100227
* Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional ↵Daniel Dunbar2010-04-021-1/+17
| | | | | | | | invariants on the provided DeclContext. - Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is. llvm-svn: 100213
* Make the CIndex API more resilient to being used on invalid code.Ted Kremenek2010-03-191-1/+4
| | | | llvm-svn: 98981
* Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ↵Ted Kremenek2010-03-151-10/+9
| | | | | | | | ObjCInterfaceDecl. Also change this method to lookup property declarations using DeclContext::lookup(). llvm-svn: 98574
* Change ObjCCategoryDecl::FindPropertyDeclaration() to lookupTed Kremenek2010-03-151-33/+42
| | | | | | property decls using DeclContext::lookup(). llvm-svn: 98571
* Make 'findPropertyDecl()' a static method of ObjCPropertyDecl.Ted Kremenek2010-03-151-0/+13
| | | | llvm-svn: 98570
* Remove unused 'IVars' field from ObjCInterfaceDecl. That functionalityTed Kremenek2010-03-111-1/+0
| | | | | | has migrated to DeclContext. llvm-svn: 98213
* Keep track of type source information in the return type of anDouglas Gregor2010-03-081-3/+4
| | | | | | | | | | Objective-C method declaration, e.g., for - (Foo *)myMethod; we now have TypeSourceInfo for the Foo*. llvm-svn: 97942
* More support for ivars in class extension.Fariborz Jahanian2010-02-231-0/+17
| | | | llvm-svn: 96850
* Class continuation now has its own property ast forFariborz Jahanian2010-02-151-6/+8
| | | | | | | | those declared in it. This is to allow duplicate property diagnostics for properties declared in class extensions multiple times (radar 7629420) and for future use. llvm-svn: 96276
* Patch to implement rewriting of properties.Fariborz Jahanian2010-01-211-1/+2
| | | | | | Fixes radar 7562952. llvm-svn: 94087
* Improve location information for Objective-C category declarations. WeDouglas Gregor2010-01-161-2/+4
| | | | | | | | | | | | | previously only had a single location (the @ in @interface); now we know where the @ is (for the start of the declaration), where the class name is (that's the normal "location" now for diagnostics), and where the category name is. Also, eliminated the redundant "end" location, since ObjCContainerDecl already has better @end information. The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught CIndex how to use the new locations. llvm-svn: 93639
* Keep track of the source locations for each protocol reference inDouglas Gregor2010-01-161-8/+31
| | | | | | | | Objective-C classes, protocol definitions, forward protocol declarations, and categories. This information isn't actually used yet; that's coming next. llvm-svn: 93636
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* Add ObjCClassDecl::getSourceRange().Ted Kremenek2009-11-181-0/+6
| | | | llvm-svn: 89179
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-13/+28
| | | | | | @class. llvm-svn: 89170
* Property declared in continuation class can only be used toFariborz Jahanian2009-11-021-0/+21
| | | | | | | change a readonly property declared in the class (and its inherited protocols) to writable property. (Fixes radar 7350645). llvm-svn: 85836
* - Add/tweak some comments.Steve Naroff2009-10-291-3/+3
| | | | | | | | - change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl(). No functionality change. llvm-svn: 85528
* tweaked my last patch to 1) preserve the protocol inFariborz Jahanian2009-10-051-3/+1
| | | | | | | | | extension class's protocol list so its AST is complete. 2) Because of this no need to issue warning on unimplemeted methods coming from the extended class protocols because warning is issued when class definition is seen. llvm-svn: 83326
* Patch to implement Protocols on class extensions.Fariborz Jahanian2009-10-051-0/+41
| | | | | | <rdar://problem/7269631> Protocols on class extensions don't work llvm-svn: 83322
* - Remove Sema::FindMethodInNestedImplementations().Steve Naroff2009-10-011-1/+10
| | | | | | | | | - Add ObjCInterfaceDecl::lookupPrivateInstanceMethod(). - Convert clients. No functionality change - One less method in Sema:-) llvm-svn: 83224
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-37/+37
| | | | llvm-svn: 81346
* Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam ↵Anders Carlsson2009-09-081-17/+0
| | | | | | Weinig! llvm-svn: 81237
* Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis2009-08-191-2/+3
| | | | | | | | | | | | interfaces. DeclaratorDecl contains a DeclaratorInfo* to keep type source info. Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl. EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo. Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet. llvm-svn: 79392
* Patch to warn if a property which is 'assign' by defaultFariborz Jahanian2009-08-111-0/+45
| | | | | | may not implement NSCopying protocol in -fobjc-gc[-only] mode. llvm-svn: 78726
* Implement ObjCMethodDecl::getCanonicalDecl().Argyrios Kyrtzidis2009-07-281-0/+20
| | | | llvm-svn: 77298
* -Add ObjCCategoryImplDecl::getCategoryClass() which returns the category ↵Argyrios Kyrtzidis2009-07-281-1/+11
| | | | | | | | | interface decl. -Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl. llvm-svn: 77297
* Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl.Argyrios Kyrtzidis2009-07-281-5/+3
| | | | llvm-svn: 77296
* Make ObjCImplDecl inherit from ObjCContainerDecl.Argyrios Kyrtzidis2009-07-271-22/+0
| | | | | | ObjCContainerDecl now is the root class for objc decls that contain methods. llvm-svn: 77235
* Refactor ObjCImplDecl::getInstanceMethod/getClassMethod into oneArgyrios Kyrtzidis2009-07-251-25/+3
| | | | | | ObjCImplDecl::getMethod. llvm-svn: 77094
* Refactor ObjCInterfaceDecl::lookupInstanceMethod/lookupClassMethod into oneArgyrios Kyrtzidis2009-07-251-43/+8
| | | | | | ObjCInterfaceDecl::lookupMethod. llvm-svn: 77093
* Refactor ObjCProtocolDecl::lookupInstanceMethod/lookupClassMethod into oneArgyrios Kyrtzidis2009-07-251-18/+5
| | | | | | ObjCProtocolDecl::lookupMethod. llvm-svn: 77092
* Refactor ObjCContainerDecl::getInstanceMethod/getClassMethod into oneArgyrios Kyrtzidis2009-07-251-23/+3
| | | | | | | | ObjCContainerDecl::getMethod. Avoids code duplication. llvm-svn: 77091
* Disambiguate an if statement.Duncan Sands2009-07-211-2/+2
| | | | llvm-svn: 76547
OpenPOWER on IntegriCloud