summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add storage layout to ObjC classes.Fariborz Jahanian2008-12-131-0/+1
| | | | llvm-svn: 60993
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* Support for implementation of property in the case whereFariborz Jahanian2008-12-091-1/+1
| | | | | | | the synthesis is in an implementation of s subclass of a super class where the property has been declared. llvm-svn: 60792
* Sema::ActOnMethodDeclaration(): Make sure we perform the default ↵Steve Naroff2008-12-091-2/+7
| | | | | | | | | function/array conversion for parameter types. This fixes <rdar://problem/6424064> checker on xcode: (possible bad AST) can the type of a method parameter really have "isFunctionType() == true"? and http://llvm.org/bugs/show_bug.cgi?id=2997. llvm-svn: 60781
* Changed 'readonly' 'retain/copy' diagnostics intoFariborz Jahanian2008-12-081-2/+3
| | | | | | warning as it is allowed in gcc and will break projects. llvm-svn: 60710
* Since we do not allow a readonly property to be 'copy'retain', weFariborz Jahanian2008-12-081-5/+1
| | | | | | | must allow the continuation class to extend it to a 'readwrite' and 'copy/retain'. llvm-svn: 60709
* Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it ↵Douglas Gregor2008-12-081-2/+2
| | | | | | belongs llvm-svn: 60708
* Setters returning a typedef of 'void' should not cause error.Fariborz Jahanian2008-12-061-1/+2
| | | | | | Bug reported by Chris L. llvm-svn: 60635
* Use of properties declared in protocols in the categoryFariborz Jahanian2008-12-061-6/+56
| | | | | | | via the category's protocol list1s, with appropriate diagnsostics and a test case. llvm-svn: 60634
* Improve error reporting of property and setter/getterFariborz Jahanian2008-12-061-2/+6
| | | | | | type mimatches. llvm-svn: 60630
* Check for correct'void' return type for setter methods.Fariborz Jahanian2008-12-061-1/+1
| | | | llvm-svn: 60629
* Changed a 'FIXME' into new comment. Added a test caseFariborz Jahanian2008-12-061-1/+3
| | | | | | testing declaration of properties in categories. llvm-svn: 60625
* Patch to diagnose a variety of misuse of propertyFariborz Jahanian2008-12-061-4/+14
| | | | | | | attributes. Example would be, readonly, assign or assign, copy, etc. llvm-svn: 60620
* This test checks for duplicate implementation of the same Fariborz Jahanian2008-12-051-2/+33
| | | | | | | | property. It also checks for duplicate use of the same ivar in two different iproperty implementations. It also caught an error for a test case used in CodeGen :). llvm-svn: 60610
* (instance/class) Method type checking between class and its implementation.Fariborz Jahanian2008-12-051-23/+50
| | | | | | | (instance/class) Method type checking between category and its implementation. And a test case for all. llvm-svn: 60598
* Representation of template type parameters and non-type templateDouglas Gregor2008-12-051-0/+14
| | | | | | | | | | | | | | | parameters, with some semantic analysis: - Template parameters are introduced into template parameter scope - Complain about template parameter shadowing (except in Microsoft mode) Note that we leak template parameter declarations like crazy, a problem we'll remedy once we actually create proper declarations for templates. Next up: dependent types and value-dependent/type-dependent expressions. llvm-svn: 60597
* Patch for diagnosing type mismatch between Fariborz Jahanian2008-12-051-0/+28
| | | | | | | methods in class and its implementation. This is work in progress. llvm-svn: 60573
* Output better diagnostics for continuation classFariborz Jahanian2008-12-041-1/+1
| | | | | | property attribute mis-specification. llvm-svn: 60562
* More type-checking of setter/getter methods. This is stillFariborz Jahanian2008-12-021-3/+39
| | | | | | work in prgress. llvm-svn: 60430
* This patch corrects problem in searching for a setter/getter method forFariborz Jahanian2008-12-021-3/+3
| | | | | | | | a property. Previous scheme of seaching in interface's list of methods would not work because this list is not yet constructed. This is in preparation for doing semantic check on viability of setter/getter method declarations. llvm-svn: 60386
* Removed a FIXME. Added a test case for anonymous category.Fariborz Jahanian2008-11-261-4/+4
| | | | llvm-svn: 60115
* Set default property attributes on each property.Fariborz Jahanian2008-11-261-5/+74
| | | | | | | | Implemented anonymous category (also know as continuation class) used to override main class's property attribute. This is work in propgress. llvm-svn: 60114
* Patch to remove bogus waring when a property declarationFariborz Jahanian2008-11-241-1/+1
| | | | | | is imported from a protocol into the implementation. llvm-svn: 59988
* 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
OpenPOWER on IntegriCloud