Граф коммитов

274 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 4cabdfc51c Fixed a @compatible_alias bug. In the process, discovered unnecessary 2ndry lookup
ok class names and streamlined this logic to do the lookup once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 19:38:20 +00:00
Steve Naroff 8f74476413 Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:49:25 +00:00
Anders Carlsson 6eda8c9cef Add some more diagnostics for va_start, fix tests so they pass with these new diags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 17:48:41 +00:00
Fariborz Jahanian bece4ac257 Fixed a bug whereby, struct tag name matches a typedef/objc-class name
and hid them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:34:10 +00:00
Ted Kremenek bef679c131 Printf argument checking now supports dynamically-passed precision
specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42886 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 00:11:27 +00:00
Fariborz Jahanian 243b64b000 This patch implementa objective-c's @compatibilty-alias declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:42:27 +00:00
Anders Carlsson b2cf3573d7 Add __builtin_va_start to the list of builtins, make __builtin_va_list available to builtin functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42857 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 01:00:40 +00:00
Fariborz Jahanian 4b6c9051c6 Patch to create protocol conforming class types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:55:41 +00:00
Chris Lattner 22b73ba6c6 Fix 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:42:28 +00:00
Steve Naroff e21b573bbf Refinements to Sema::GetObjcIdType()...
- Cache the typedef, not the type (avoids importing AST/Type.h).
- Emit an error if "id" cannot be found.
- Comment the routine and add a FIXME to reconsider how we emulate GCC's new fangled behavior. This isn't a priority for now, since almost no code depends on having "id" built-in.
- Add a test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42845 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:24:43 +00:00
Steve Naroff 3b950178e2 - Make sure default return/argument types (for methods) default to "id".
- Cache the "id" type in Sema...initialize ObjcIdType and TUScope (oops).
- Fix ActOnInstanceMessage to allow for "id" type receivers...still work to do (next).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42842 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 21:53:07 +00:00
Anders Carlsson 2d85f8ba62 Emit a warning when the body of an if block is a NullStmt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:50:11 +00:00
Steve Naroff e440eb8158 Remove Scope argument from ObjC actions that either don't need it or can now use TUScope.
Also improve a recently added comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42826 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 17:32:04 +00:00
Chris Lattner 53b0dabbe5 Make a significant change to invert the control flow handling
predefined macros.  Previously, these were handled by the driver,
now they are handled by the preprocessor.

Some fallout of this:

1. Instead of preprocessing two buffers (the predefines, then the 
   main source file)  we now start preprocessing the main source 
   file and inject the predefines as a "psuedo #include" from the
   main source file.
2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify
   Preprocessor::isInPrimaryFile.
3. The driver doesn't have to know about standard #defines, the
   preprocessor knows, which is nice for people wanting to define
   their own drivers.
4. This allows us to put normal tokens in the predefine buffer,
   for example a definition for __builtin_va_list that is 
   target-specific, and a typedef for id in objc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 22:10:18 +00:00
Steve Naroff b216c8861c Make sure methods with no return type default to "id".
This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).

Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.

Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 22:01:59 +00:00
Fariborz Jahanian 8fe5c2a902 Minor code clean up to make it more readable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:22:59 +00:00
Chris Lattner 4de884d3fb Update DeclKind enums to reflect ObjcProtocolDecl's inheritance change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:18:24 +00:00
Fariborz Jahanian 05672a0ce8 Remove addition of protocol names to declaration scopes, use a separate
DenseMap to keep track of such declarations and derive ObjcProtocolDecl
directyly from NamedScope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:03:53 +00:00
Chris Lattner b652cea7d7 rename some "Parse" actions to "ActOn". Move code around in
ParseFunctionDefinition so that ActOnFunctionDefBody is always
called if ActOnStartOfFunctionDef is called.  This fixes a crash
reported by Nuno Lopes.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:14:05 +00:00
Fariborz Jahanian 22d71d6805 Prevent memory leak by not creating a category object when there is a
fatal error of category's undefined interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42790 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:05:22 +00:00
Steve Naroff eefc418b8e Convert Selector Maps/Sets to use stronger typing (now that we have DenseMapInfo in IdentifierTable.h).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:05:34 +00:00
Fariborz Jahanian 0332b6c838 Return NULL on invalid protocol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42754 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 16:07:03 +00:00
Chris Lattner c7229c338c move IdentifierTable.h from liblex to libbasic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:58:51 +00:00
Chris Lattner 60c52187e0 The identifier shouldn't be added to the scope, the decl should.
This fixes strange assertions that just started triggering.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:05:08 +00:00
Chris Lattner f836e3fea2 simplify some Selector interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 01:33:16 +00:00
Chris Lattner f387668708 move ImplementationClassInfo out of ASTContext into Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42714 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 01:13:46 +00:00
Chris Lattner 6a0e89eece switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 23:12:31 +00:00
Chris Lattner fd5de47147 introduce a new NamedDecl class, switch a couple of things over to using it.
NamedDecl is a Decl that has an IdentifierInfo (for example, ScopedDecl), 
but not ObjcMethodDecl.

Simplify some code in ActOnAddMethodsToObjcDecl, by doing the cast from 
DeclTy to Decl at the start of the method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 22:53:46 +00:00
Chris Lattner 7e620729fc simplify the interface to create ObjcClassDecl's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 20:08:36 +00:00
Chris Lattner b97de3eddf simplify the interface for creating ObjcForwardProtocolDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 20:05:59 +00:00
Fariborz Jahanian 245f92a886 This is the first patch toward supporting protocol conforming
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-05 21:01:53 +00:00
Chris Lattner 85994260c4 Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet of
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-05 20:15:24 +00:00
Fariborz Jahanian 85ff2646c1 Patch for 1) Checking for duplicate methods decls in intterface and category.
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-05 18:00:57 +00:00
Fariborz Jahanian b384d329e0 this patch accomodates clattner's comments on expression processing in @try-statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42611 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 20:19:06 +00:00
Fariborz Jahanian 3f5faf7c28 Fixed tabs in couple of sources.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42601 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 00:45:27 +00:00
Fariborz Jahanian 4b6df3fa95 Fixed all my recent test cases to have the RUN command and
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-04 00:22:33 +00:00
Steve Naroff 3a165b066e Finish renaming ObjC declaration actions.
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-03 21:00:46 +00:00
Fariborz Jahanian 79139a1217 Renamed getCatLoc() to getLocation() to be consistant for such
getter names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42577 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 16:23:52 +00:00
Steve Naroff 37e58d104d Rename several ObjC action methods to use the "ActOn" prefix (still a few 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-02 22:39:18 +00:00
Fariborz Jahanian 7ed9e0f97f Unified such names as protocol references, instance methods and class methods
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-02 22:05:16 +00:00
Steve Naroff a5997c4f36 Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not 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-02 21:43:37 +00:00
Steve Naroff 768f26ee58 Rename ObjcInterfaceDecl::getIsForwardDecl() to isForwardDecl().
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-02 20:26:23 +00:00
Fariborz Jahanian ca3adf7e8c Previously, I warned those methods not implemented in implementation 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 20:06:01 +00:00
Steve Naroff 6a8a9a41e9 - Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
- 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-02 20:01:56 +00:00
Fariborz Jahanian 60199032e4 ObjcCategoryDecl Does not subclass from ScopedDecl any more.
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-02 17:36:55 +00:00
Fariborz Jahanian 8f3fde00ad This patch introduces the ObjcCategoryImplDecl class and does the checking 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-02 16:38:50 +00:00
Steve Naroff 980e508ca7 Move ObjC decls to DeclObjC.h, a new AST header.
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-01 19:00:59 +00:00
Fariborz Jahanian 89204a1686 Took care of clatter's suggestions, dated.
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-10-01 16:53:59 +00:00
Chris Lattner 5c0fa30017 Fix a bug I just introduced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42479 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 08:31:00 +00:00
Chris Lattner b7f4f2adb0 simplify an expression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42477 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 08:01:04 +00:00