aboutsummaryrefslogtreecommitdiff
path: root/Sema
AgeCommit message (Collapse)Author
2007-10-06simplify the interface to create ObjcClassDecl's.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06simplify the interface for creating ObjcForwardProtocolDeclChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05This is the first patch toward supporting protocol conformingFariborz Jahanian
objective-c types. It also removes use of Scope* parameter in getObjCProtocolDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet ofChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42645 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05Patch for 1) Checking for duplicate methods decls in intterface and category.Fariborz Jahanian
2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42641 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04this patch accomodates clattner's comments on expression processing in ↵Fariborz Jahanian
@try-statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42611 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04Fixed tabs in couple of sources.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42601 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04Fixed all my recent test cases to have the RUN command andFariborz Jahanian
fixed consequence of these changes in clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03Finish renaming ObjC declaration actions.Steve Naroff
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42587 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03Renamed getCatLoc() to getLocation() to be consistant for suchFariborz Jahanian
getter names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42577 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02Rename several ObjC action methods to use the "ActOn" prefix (still a few ↵Steve Naroff
more to do). Remove Action::ObjCStartCategoryInterface/ObjCFinishInterface - they are unused. . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42559 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02Unified such names as protocol references, instance methods and class methodsFariborz Jahanian
and their accessors in a variety of objective-c classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not ↵Steve Naroff
Parser). Add Sema::CheckImplementationIvars() to replace the previous action. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42553 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02Rename ObjcInterfaceDecl::getIsForwardDecl() to isForwardDecl().Steve Naroff
Rename ObjcProtocolDecl::getIsForwardProtoDecl() to isForwardDecl(). Rename ObjcInterfaceDecl::setIsForwardDecl() to setForwardDecl(). Rename ObjcProtocolDecl::setIsForwardProtoDecl() to setForwardDecl(). Two reasons: #1: boolean predicates should start with "is". #2: Since these two sets of methods represent the same concept, they should be named the same (polymorphism is good:-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42545 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02Previously, I warned those methods not implemented in implementation ↵Fariborz Jahanian
class/category. Now, I also warn those class/categories which are incomplete because of this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02- Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().Steve Naroff
- Add ObjcMessageExpr::getSelector(), getClassName(). - Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed). - Remove FIXME for printing ObjCMessageExpr's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42543 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02ObjcCategoryDecl Does not subclass from ScopedDecl any more.Fariborz Jahanian
Ted may want to take a look at the change I made at FGRecStmtDeclVisitor.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42535 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02This patch introduces the ObjcCategoryImplDecl class and does the checking ↵Fariborz Jahanian
related to unimplemented methods in category implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42531 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01Move ObjC decls to DeclObjC.h, a new AST header.Steve Naroff
Update clients and add to project file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01Took care of clatter's suggestions, dated.Fariborz Jahanian
September 30, 2007 12:36:58 AM PDT and September 30, 2007 12:50:05 AM PDT git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42490 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30Fix a bug I just introduced.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42479 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30simplify an expressionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42477 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29This patch fixes all issues mentioned in clattner's feedback of Fariborz Jahanian
September 28, 2007 4:39:24 PM PDT Please let me know if I missed anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29Code clean up. Moved couple of static functions to be private members of ↵Fariborz Jahanian
Sema class. Avoiding passing a Sema object to these utility functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29Patch to remove use of has table for protocol name lookup. This patch ↵Fariborz Jahanian
mirrors my previous patch to do the same for class name lookup using a hash table. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29Removed use of hash table for class decls and do a name look up directly.Fariborz Jahanian
There is still an issue if doing ScopedLookup is an overkill and we can just access the decl using the identifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42463 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.Steve Naroff
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42452 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28Patch to warn on umimplemented methods coming from class's Fariborz Jahanian
protocols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27Patch for method implementation. It populates ObjcImplementationDecl object ↵Fariborz Jahanian
with method implementation declarations . It checks and warns on those methods declared in class interface and not implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27Fix some use of uninit variables issues, reported by Anton.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42396 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference ↵Steve Naroff
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42395 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26This patch inserts ivars declared in @implementation in its object and verifies Fariborz Jahanian
that they conform(in type, name and numbers) to those declared in @interface. Test case highlights kind of checking we do here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42360 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25Patch to make ObjcImplementationDecl derived from TypeDecl and supprt legacyFariborz Jahanian
objective-c code with no @interface declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25This patch introduces a new class to keep track of class implementation ↵Fariborz Jahanian
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22Use APFloat for the representation of FP immediates, ask the targetChris Lattner
for *which* apfloat to use for a particular type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22This patch adds to new things to clang:Fariborz Jahanian
1. Handles saving and checking on protocols used in an @interface declaration 2. Checks and saves class's super class. 3. Adds semantic check to category declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21Make case sorting deterministic by not depending on pointer Chris Lattner
values. Patch mostly by Gabor Greif for PR1682. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42203 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-21This patch instantiates objects for forward protocols and in general handles ↵Fariborz Jahanian
use of protocols referenced in @protocol declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20Handle forward declaration of classes and prevent re-instantiation ofFariborz Jahanian
ObjcInterfaceClass Objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-20Match to do some semantic analysis on objective-c class decl.Fariborz Jahanian
1. Detect used of undeclared/forward declared super class. 2. Detect duplicate definition of a class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19Remove SelectorTable/SelectorInfo, simply store all selectors in the central ↵Steve Naroff
IdentifierTable. Rationale: We currently have a separate table to unique ObjC selectors. Since I don't need all the instance data in IdentifierInfo, I thought this would save space (and make more sense conceptually). It turns out the cost of having duplicate entries for unary selectors (i.e. names without colons) outweighs the cost difference between the IdentifierInfo & SelectorInfo structures. Here is the data: Two tables: *** Selector/Identifier Stats: # Selectors/Identifiers: 51635 Bytes allocated: 1999824 One table: *** Identifier Table Stats: # Identifiers: 49500 Bytes allocated: 1990316 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19Remove #include of config.h, it is no longer needed.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42126 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Remove alloca import...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Progress on message expressions...Steve Naroff
- 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... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Patch for object creation and handling of category declarations.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42104 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18alloca.h doesn't exist on Windows.Hartmut Kaiser
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18alloca.h is needed on SolarisGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42088 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Uses more description name for method implementation kind argument.Fariborz Jahanian
Moves such argument as the last argument and uses defaul value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17Patch to remove ObjcProtoMethodDecl and use ObjcMethodDeclFariborz Jahanian
instead for @protocol method decls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17Patch to add objective-c's @protocl type declaration.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42060 91177308-0d34-0410-b5e6-96231b3b80d8