summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-4/+4
| | | | | | | | | | | 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. llvm-svn: 59947
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-12/+11
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-6/+5
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* convert some more warnings to NOTEs.Chris Lattner2008-11-231-2/+2
| | | | llvm-svn: 59923
* remove warn_previous_declarationChris Lattner2008-11-231-7/+4
| | | | llvm-svn: 59922
* Make all the 'redefinition' diagnostics more consistent, and make the Chris Lattner2008-11-231-15/+15
| | | | | | "previously defined here" diagnostics all notes. llvm-svn: 59920
* make some objc redefinition warnings more consistent: call definitions Chris Lattner2008-11-231-0/+3
| | | | | | | "definitions", not declarations. Point out the location of the original definition. llvm-svn: 59919
* Tweak duplicate category diagnostic to work like the duplicate protocol ↵Chris Lattner2008-11-231-0/+1
| | | | | | | | diagnostic. Also, point out where the previous decl was. This unxfails two tests. llvm-svn: 59918
* Convert IdentifierInfo's to be printed the same as DeclarationNames Chris Lattner2008-11-231-9/+8
| | | | | | | | | | | | | | | | | | | | | with implicit quotes around them. This has a bunch of follow-on effects and requires tweaking to a whole lot of code. This causes a regression in two tests (xfailed) by causing it to emit things like: Line 10: duplicate interface declaration for category 'MyClass1' ('Category1') instead of: Line 10: duplicate interface declaration for category 'MyClass1(Category1)' I will fix this in a follow-up commit. As part of this, I had to start switching stuff to use ->getDeclName() instead of Decl::getName() for consistency. This is good, but I was planning to do this as an independent patch. There will be several follow-on patches to clean up some of the mess, but this patch is already too big. llvm-svn: 59917
* remove another old Diag method.Chris Lattner2008-11-201-25/+25
| | | | llvm-svn: 59713
* remove another old-school Diag method.Chris Lattner2008-11-201-2/+2
| | | | llvm-svn: 59712
* stop calling II::getName() unnecesarily in semaChris Lattner2008-11-191-40/+33
| | | | llvm-svn: 59609
* remove one more old-style Diag method.Chris Lattner2008-11-191-4/+4
| | | | llvm-svn: 59589
* Switch several more Sema Diag methods over. This simplifies theChris Lattner2008-11-191-33/+33
| | | | | | | | __builtin_prefetch code to only emit one diagnostic per builtin_prefetch. While this has nothing to do with the rest of the patch, the code seemed like overkill when I was updating it. llvm-svn: 59588
* start converting Sema over to using its canonical Diag method.Chris Lattner2008-11-181-18/+12
| | | | llvm-svn: 59561
* Fix <rdar://problem/6329769> [sema] crash on duplication definition of ↵Steve Naroff2008-11-181-3/+6
| | | | | | | | | | interface with protocols. As soon as we detect duplicate interfaces, discontinue further semantic checks (returning the original interface). This is now consistent with how we handle protocols (and less error prone in general). llvm-svn: 59541
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-2/+3
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* Make it an error if an Objective-C declaration is not in the global scope.Anders Carlsson2008-11-041-5/+39
| | | | llvm-svn: 58705
* Fix typo.Steve Naroff2008-10-211-1/+1
| | | | llvm-svn: 57899
* Fix <rdar://problem/6261178> clang-on-xcode: [sema] multiple method warning ↵Steve Naroff2008-10-211-9/+37
| | | | | | | | | | | | is over enthusiastic. Fix <rdar://problem/6265257> warnings for ambiguous message send swamp other warnings. Reworked Sema::MatchTwoMethodDeclarations() to optionally match based on method size and alignment (the default in GCC). Changed Sema::LookupInstanceMethodInGlobalPool() to use this feature. Added -Wno-struct-selector-match to driver, however didn't hook it up yet. Added a FIXME that says this. llvm-svn: 57898
* Fix <rdar://problem/6239726> Parser rejects: type of property 'list' does ↵Steve Naroff2008-10-161-3/+1
| | | | | | | | | not match type of ivar and http://llvm.org/bugs/show_bug.cgi?id=2893 llvm-svn: 57640
* Fix <rdar://problem/6191148> [sema] Objective-C method lookup (at global ↵Steve Naroff2008-09-301-0/+15
| | | | | | | | scope) fails to handle overloaded selectors properly. Long standing bug in Sema::ActOnInstanceMessage(). We now warn when messaging an "id" with multiple method signatures in scope. The diags are a little verbose, however they can be streamlined if necessary. llvm-svn: 56843
* Improved fix for <rdar://problem/6247781> Parser rejecting properly ↵Steve Naroff2008-09-301-6/+11
| | | | | | | | mismatched properties. Needed to make sure the relaxed type checking only applies to "readonly" properties. llvm-svn: 56838
* Fix <rdar://problem/6247781> Parser rejecting properly mismatched properties.Steve Naroff2008-09-301-4/+4
| | | | llvm-svn: 56821
* Fix <rdar://problem/6253149> property declaration doesn't declare getter and ↵Steve Naroff2008-09-291-0/+21
| | | | | | setter. llvm-svn: 56785
* Fix <rdar://problem/6252129> implementation of method in category doesn't ↵Steve Naroff2008-09-281-0/+1
| | | | | | effectively declare it for methods below. llvm-svn: 56771
* Parser support for prefix __attribute__ on @protocol.Daniel Dunbar2008-09-261-1/+3
| | | | llvm-svn: 56642
* Sema support for format and noreturn attributes on Objective-C methods.Daniel Dunbar2008-09-261-2/+3
| | | | llvm-svn: 56640
* Implement type checking of Objective-C property attributes.Daniel Dunbar2008-09-231-9/+76
| | | | | | | | | | - readonly and readwrite are mutually exclusive. - assign, copy, and retain are mutually exclusive. - copy and retain are invalid on non-object types. - Warn about using default 'assign' property on object types (attempting to follow gcc behavior). llvm-svn: 56507
* Prevent invalid warnings about incomplete implementations for methodsDaniel Dunbar2008-09-041-12/+22
| | | | | | which are inherited from base clases or protocols. llvm-svn: 55790
* Add synthesized property methods to protocols and categories in Sema.Daniel Dunbar2008-08-271-12/+25
| | | | | | | | | | | | | | | | - It is not clear that this is the right approach, but this is at least consistent with how interfaces are handled. - This means NeXT now emits the correct metadata for properties in protocols. - This currently introduces a spurious warning involving inherited properties in protocols or categories; however, it also fixes some situations where we were failing to emit a warning. I will scrub this code tomorrow and fix this issue as well as number of other missed warnings / error situations that appear to exist. llvm-svn: 55407
* Move implicit Obj-C param creation into ObjCMethodDecl.Daniel Dunbar2008-08-261-19/+3
| | | | | | | | | | - Add ObjCMethodDecl::createImplicitParams. - Remove ObjCMethodDecl::set{Self,Cmd}Decl - Remove Sema::CreateImplicitParameter No (intended) functionality change. llvm-svn: 55356
* Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)Daniel Dunbar2008-08-261-3/+3
| | | | | | | | | - Change enum name to Kind. - Change enum constants to English strings. Also, fix getPropertyImplementation (which probably should be renamed) llvm-svn: 55354
* Fix attributes on Obj-C interfaces & methods.Daniel Dunbar2008-08-201-2/+9
| | | | | | | - Drop MethodAttrs parameter to ObjCMethodDecl - Call ProcessDeclAttributeList for interface & method decls. llvm-svn: 55068
* Sema::ActOnStartProtocolInterface(): Make sure the protocol decl has a valid ↵Steve Naroff2008-08-131-1/+2
| | | | | | | | | | | | | | | | start location. The following case resulted in an invalid start location: // start location not being set for ObjCProtocolDecl AST (when a forward reference is in scope). @protocol Buggy; @protocol Buggy @optional - whatever; @end llvm-svn: 54740
* More #include cleaningDaniel Dunbar2008-08-111-1/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* Minor #include cleaningDaniel Dunbar2008-08-111-0/+2
| | | | | | | - Drop TokenKinds.h from Action.h - Move DeclSpec.h from Sema.h into individual Sema .cpp files llvm-svn: 54625
* remove two uses of getCanonicalType I missed.Chris Lattner2008-07-271-1/+2
| | | | llvm-svn: 54114
* change more instances of QualType::getCanonicalType to callChris Lattner2008-07-261-2/+2
| | | | | | ASTContext::getCanonicalType instead (PR2189) llvm-svn: 54105
* remove a helper method.Chris Lattner2008-07-261-2/+4
| | | | llvm-svn: 54101
* Pull protocol resolution of out ActOnStartClassInterface, this is also the Chris Lattner2008-07-261-18/+3
| | | | | | last client of the old ParseObjCProtocolReferences, so it also removes it. llvm-svn: 54094
* refactor protocol resolution out of ActOnStartCategoryInterfaceChris Lattner2008-07-261-18/+3
| | | | llvm-svn: 54093
* pull protocol resolution out into ActOnStartProtocolInterface.Chris Lattner2008-07-261-21/+9
| | | | | | | This temporarily duplicates ParseObjCProtocolReferences, but it will be removed in the future. llvm-svn: 54092
* simplify some code.Chris Lattner2008-07-261-7/+15
| | | | llvm-svn: 54091
* remove duplicate error message.Chris Lattner2008-07-261-6/+6
| | | | llvm-svn: 54090
* Move fix in r54013 from the parser to sema.Steve Naroff2008-07-251-2/+5
| | | | llvm-svn: 54032
* minor cleanup to the actions interface to pass around SmallVectorImpl insteadChris Lattner2008-07-211-41/+42
| | | | | | | | | | | | | | | | | | | | | | of a specific smallvector size. Fix protocol lists to pass down proper location info, so we get diagnostics like this: t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever' @interface NSWhatever : NSObject <NSCopying> ^ instead of this: t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever' @interface NSWhatever : NSObject <NSCopying> ^ Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation> llvm-svn: 53883
* move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,Chris Lattner2008-07-211-15/+14
| | | | | | simplifying code along the way and fixing a problem and memory leak or two. llvm-svn: 53876
* add forward definition protocols to the protocol list for a class.Chris Lattner2008-07-211-13/+16
| | | | llvm-svn: 53864
* references to completely undeclared protocols should be errors. Chris Lattner2008-07-211-10/+16
| | | | | | References to forward definitions should be warnings. llvm-svn: 53863
OpenPOWER on IntegriCloud