summaryrefslogtreecommitdiffstats
path: root/clang/Sema/Sema.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove addition of protocol names to declaration scopes, use a separateFariborz Jahanian2007-10-091-2/+5
| | | | | | | DenseMap to keep track of such declarations and derive ObjcProtocolDecl directyly from NamedScope. llvm-svn: 42801
* rename some "Parse" actions to "ActOn". Move code around inChris Lattner2007-10-091-2/+2
| | | | | | | | ParseFunctionDefinition so that ActOnFunctionDefBody is always called if ActOnStartOfFunctionDef is called. This fixes a crash reported by Nuno Lopes. llvm-svn: 42793
* Convert Selector Maps/Sets to use stronger typing (now that we have ↵Steve Naroff2007-10-081-1/+1
| | | | | | DenseMapInfo in IdentifierTable.h). llvm-svn: 42767
* move ImplementationClassInfo out of ASTContext into Sema.Chris Lattner2007-10-071-1/+5
| | | | llvm-svn: 42714
* This is the first patch toward supporting protocol conformingFariborz Jahanian2007-10-051-0/+5
| | | | | | | objective-c types. It also removes use of Scope* parameter in getObjCProtocolDecl. llvm-svn: 42649
* Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet ofChris Lattner2007-10-051-3/+3
| | | | | | | | Selector's instead of requiring void* to be used. I converted one use of DenseSet<void*> over to use DenseSet<Selector> but the others should change as well. llvm-svn: 42645
* Patch for 1) Checking for duplicate methods decls in intterface and category.Fariborz Jahanian2007-10-051-2/+8
| | | | | | 2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>. llvm-svn: 42641
* Finish renaming ObjC declaration actions.Steve Naroff2007-10-031-7/+7
| | | | | | | | | | | | Add comments. Switch to new indentation style for the Action class. Since many actions take many arguments, the new style will... - make it easier to add/remove arguments without messing up the indentation... - make it easier to add comments to each argument (see ActOnMethodDeclaration for an example)... - in general, just makes it easier to see what is being passed. The rest of Actions will be converted "lazily"...there is no immediate need to hack all the existing methods. llvm-svn: 42587
* Rename several ObjC action methods to use the "ActOn" prefix (still a few ↵Steve Naroff2007-10-021-9/+9
| | | | | | | | | more to do). Remove Action::ObjCStartCategoryInterface/ObjCFinishInterface - they are unused. . llvm-svn: 42559
* Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not ↵Steve Naroff2007-10-021-3/+6
| | | | | | | | Parser). Add Sema::CheckImplementationIvars() to replace the previous action. llvm-svn: 42553
* Previously, I warned those methods not implemented in implementation ↵Fariborz Jahanian2007-10-021-1/+2
| | | | | | | | class/category. Now, I also warn those class/categories which are incomplete because of this. llvm-svn: 42544
* - Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().Steve Naroff2007-10-021-3/+2
| | | | | | | | - Add ObjcMessageExpr::getSelector(), getClassName(). - Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed). - Remove FIXME for printing ObjCMessageExpr's. llvm-svn: 42543
* This patch introduces the ObjcCategoryImplDecl class and does the checking ↵Fariborz Jahanian2007-10-021-0/+14
| | | | | | | | related to unimplemented methods in category implementation. llvm-svn: 42531
* Code clean up. Moved couple of static functions to be private members of ↵Fariborz Jahanian2007-09-291-0/+12
| | | | | | | | Sema class. Avoiding passing a Sema object to these utility functions. llvm-svn: 42472
* Patch to remove use of has table for protocol name lookup. This patch ↵Fariborz Jahanian2007-09-291-0/+3
| | | | | | | | mirrors my previous patch to do the same for class name lookup using a hash table. llvm-svn: 42471
* Removed use of hash table for class decls and do a name look up directly.Fariborz Jahanian2007-09-291-4/+9
| | | | | | | There is still an issue if doing ScopedLookup is an overkill and we can just access the decl using the identifier. llvm-svn: 42463
* Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.Steve Naroff2007-09-281-3/+3
| | | | | | | | | | | | This motivated implementing a devious clattner inspired solution:-) This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema). This change was critical to make now, before we have too many clients. I still need to add some comments to the Selector class...will likely add later today/tomorrow. llvm-svn: 42452
* Patch to warn on umimplemented methods coming from class's Fariborz Jahanian2007-09-281-2/+0
| | | | | | protocols. llvm-svn: 42436
* Patch for method implementation. It populates ObjcImplementationDecl object ↵Fariborz Jahanian2007-09-271-0/+2
| | | | | | | | with method implementation declarations . It checks and warns on those methods declared in class interface and not implemented. llvm-svn: 42412
* Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference ↵Steve Naroff2007-09-271-25/+18
| | | | | | | | | | | | | | | | | | | | is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set). SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits: #1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable. #2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%. #3: It results in many API simplifications. Here are some highlights: - Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages). - Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo). - Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured). I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later. Thanks to Chris for talking this through with me and suggesting this approach. llvm-svn: 42395
* This patch inserts ivars declared in @implementation in its object and verifies Fariborz Jahanian2007-09-261-0/+4
| | | | | | | that they conform(in type, name and numbers) to those declared in @interface. Test case highlights kind of checking we do here. llvm-svn: 42360
* This patch introduces a new class to keep track of class implementation ↵Fariborz Jahanian2007-09-251-2/+10
| | | | | | | | | info. It also adds more semantic checks for class and protocol declarations. Test cases are good indications of kind of checking being done in this patch. llvm-svn: 42311
* This patch instantiates objects for forward protocols and in general handles ↵Fariborz Jahanian2007-09-211-0/+5
| | | | | | | | use of protocols referenced in @protocol declarations. llvm-svn: 42191
* Progress on message expressions...Steve Naroff2007-09-181-9/+14
| | | | | | | | | | | - Add ObjcMessageExpr AST node and associated constructors. - Add SourceLocation's to ActOnKeywordMessage/ActOnUnaryMessage API. - Instantiate message expressions... - Replace alloca usage with SmallString. Next step, installing a correct type, among other tweaks... llvm-svn: 42116
* Patch for object creation and handling of category declarations.Fariborz Jahanian2007-09-181-0/+5
| | | | llvm-svn: 42104
* Uses more description name for method implementation kind argument.Fariborz Jahanian2007-09-181-6/+6
| | | | | | Moves such argument as the last argument and uses defaul value. llvm-svn: 42073
* Patch to remove ObjcProtoMethodDecl and use ObjcMethodDeclFariborz Jahanian2007-09-171-4/+2
| | | | | | instead for @protocol method decls. llvm-svn: 42070
* Patch to add objective-c's @protocl type declaration.Fariborz Jahanian2007-09-171-2/+10
| | | | llvm-svn: 42060
* Finish defining Action API for message expressions.Steve Naroff2007-09-171-0/+13
| | | | llvm-svn: 42059
* - Refactored ObjcKeywordInfo into ObjcKeywordInfo, ObjcKeywordDecl, and ↵Steve Naroff2007-09-171-1/+1
| | | | | | | | | | | | ObjcKeywordMessage. - Removed helper ObjcGetSelectorInfo(), moving the code directly into ObjcBuildMethodDeclaration(). - Many refinements to ParseObjCMessageExpression(). - Add ActOnMessageExpression(). Next step, finish the message actions and (finally) create/instantiate an ObjcMessageExpr AST. llvm-svn: 42050
* Fixes/tweaks that prevent "defaults-i.m" from compiling.Steve Naroff2007-09-161-1/+1
| | | | | | | - Allow classnames as the receiver (removing a FIXME from ParseObjCMessageExpression). - Added a FIXME to ParseObjCMessageExpression()...we need to return a message expr AST node! llvm-svn: 42001
* Rename statement actions (from Parse-prefix to ActOn-prefix).Steve Naroff2007-09-161-29/+29
| | | | llvm-svn: 42000
* Rename expression actions (from Parse-prefix to ActOn-prefix).Steve Naroff2007-09-161-22/+22
| | | | llvm-svn: 41997
* Start converting Action methods from Parse-prefix to ActOn-prefix.Steve Naroff2007-09-151-10/+10
| | | | | | The previous naming scheme was confusing, since it resulted in both the Parser and Action modules having methods with the same name. In addition, the Action module never does any parsing... llvm-svn: 41986
* Rename Action::ParseRecordBody() to ProcessFieldDecls(), and add a ↵Steve Naroff2007-09-141-6/+5
| | | | | | | | | | visibility argument. Remove Action::ObjcAddVisibilityToIvars(). No need for an extra API when it is trivial to add this info to the previous hook. In general, I want to start migrating away from having Actions prefixed with "Parse" (which is confusing, since the Action API doesn't do any parsing, per se). llvm-svn: 41973
* Patch to store ivars into interface class object.Fariborz Jahanian2007-09-141-3/+3
| | | | llvm-svn: 41961
* Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.Steve Naroff2007-09-131-1/+1
| | | | | | Decl is now svelte:-) llvm-svn: 41935
* Phase 2 of making the Decl class more lightweight...Steve Naroff2007-09-131-3/+3
| | | | | | | | Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl. Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later. llvm-svn: 41934
* Patch for collecting ivars before running action on them.Fariborz Jahanian2007-09-131-2/+3
| | | | llvm-svn: 41932
* Add "ScopedDecl" AST, used by ValueDecl and TypeDecl. Steve Naroff2007-09-131-3/+4
| | | | | | This allows us to sink the "Next" field, which isn't used by FieldDecl and ObjcIvarDecl. llvm-svn: 41931
* Patch for building method declaration nodes. Also fixed a segfault in ↵Fariborz Jahanian2007-09-121-0/+7
| | | | | | | | cocoa.m due to use of @property. llvm-svn: 41880
* Fix the following bug submitted by Ted Kremenek:Steve Naroff2007-09-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | void func() { int xx = xx; // incorrectly diagnosed 'xx' as an undeclared identifier. } This smallish bug resulted in a largish fix. Here are some highlights: - Needed to make sure ParseDeclarator is called *before* parsing any initializer. Removed the "Init" argument to ParseDeclarator. - Added AddInitializerToDecl() to the Action & Sema classes. In Sema, this hook is responsible for validating the initializer and installing it into the respective decl. - Moved several semantic checks from ParseDeclarator() to FinalizeDeclaratorGroup(). Previously, this hook was only responsible for reversing a list. Now it plays a much larger semantic role. All of the above changes ended up simplifying ParseDeclarator(), which is goodness... llvm-svn: 41877
* - Add an ObjcIvarDecl AST node (a subclass of FieldDecl).Steve Naroff2007-09-111-2/+5
| | | | | | | - Instantiate the node in Sema::ParseField(), based on the type of the TagDecl. - Add Sema::ObjcAddInstanceVariable(), responsible for adorning/adding the ObjcIvarDecl. llvm-svn: 41864
* Early patch to collect objective-c methods inserts them inFariborz Jahanian2007-09-101-0/+2
| | | | | | class object. llvm-svn: 41801
* The goal of this commit is to get just enough Sema support to recognize ↵Steve Naroff2007-09-061-0/+11
| | | | | | | | | | | Objective-C classes as types. That said, the AST nodes ObjcInterfaceDecl, ObjcInterfaceType, and ObjcClassDecl are *very* preliminary. The good news is we no longer need -parse-noop (aka MinimalActions) to parse cocoa.m. llvm-svn: 41752
* Make sure initializer type promotions get propagated.Steve Naroff2007-09-041-3/+4
| | | | | | This fixes a recent regression with Codegen/mandel.c. llvm-svn: 41696
* Silence VC++ warnings, patch by Hartmut KaiserChris Lattner2007-09-041-2/+2
| | | | llvm-svn: 41693
* More fun with initializers! Steve Naroff2007-09-041-3/+8
| | | | | | | | | - Fixed many bugs, enhanced test case considerably, added a diagnostic, etc. - Refactored CheckInitList() into CheckVariableInitList()/CheckConstantInitList(). - Added CheckInitExpr(). - Support for multi-dimensional arrays looking good. llvm-svn: 41690
* Finish getting "array-init.c" to work properly.Steve Naroff2007-09-031-3/+4
| | | | | | | | Array scalar initialization is now is reasonable shape. Next step, structure and array of structure initializers. llvm-svn: 41681
* More progress on array initializers.Steve Naroff2007-09-021-1/+1
| | | | | | | | - Added Expr::isConstantExpr(). - Added type checking for InitListExpr elements. - Added diagnostic for trying to initialize a variable sized object. llvm-svn: 41674
OpenPOWER on IntegriCloud