summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Update the initializer's type, in addition to the decl, if we've changed the ↵Christopher Lamb2007-11-291-1/+3
| | | | | | type of the decl based on it. llvm-svn: 44440
* Several fixes/simplifications surrounding how we stream top-level decl AST's.Steve Naroff2007-11-281-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following code... typedef struct cssm_data {} CSSM_DATA, *CSSM_DATA_PTR; struct Y { int A; }; struct X { int A; } D; struct X E, F; ...now produces the following output... > ../../Debug/bin/clang xx.c -ast-print Read top-level tag decl: 'cssm_data' typedef struct cssm_data CSSM_DATA; typedef struct cssm_data *CSSM_DATA_PTR; Read top-level tag decl: 'Y' Read top-level tag decl: 'X' Read top-level variable decl: 'D' Read top-level variable decl: 'E' Read top-level variable decl: 'F' ...which is much more accurate than the previous -ast-print output... typedef struct cssm_data CSSM_DATA; typedef struct cssm_data CSSM_DATA; Read top-level variable decl: 'D' Read top-level variable decl: 'E' Read top-level variable decl: 'E' llvm-svn: 44421
* Fix a bug checking for 'int foo(void)' that didn't look through typedefs of ↵Chris Lattner2007-11-281-1/+2
| | | | | | | | void. Bug pointed out by Michael Zolda, thanks! llvm-svn: 44408
* Set loc earlier in CheckSingleInitializer to avoid emitting a Chris Lattner2007-11-271-2/+1
| | | | | | | | | | | | | diagnostic without a location. This produces: simpleTest.c:2:18: error: initializer element is not constant int *myPointer = &(myArray[2]); ^~~~~~~~~~~~~ instead of: error: initializer element is not constant llvm-svn: 44375
* Move the null pointer constant check from ↵Steve Naroff2007-11-271-7/+3
| | | | | | | | Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible. Thanks to Seo Sanghyeon for the bug, follow-through, and patch! llvm-svn: 44366
* handle __vector_size__ like vector_sizeChris Lattner2007-11-271-2/+4
| | | | llvm-svn: 44358
* Improve function decl merging, patch by Oliver Hunt!Chris Lattner2007-11-201-10/+17
| | | | llvm-svn: 44253
* Now that we are passing back "free standing decls", make sure -ast-dump ↵Steve Naroff2007-11-171-1/+1
| | | | | | | | works like -ast-print. Also added a cast to be safe... llvm-svn: 44209
* Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the ↵Steve Naroff2007-11-171-1/+1
| | | | | | | | type. Adding basic printing to StmtPrinter::PrintRawDecl(). llvm-svn: 44208
* Implement support for variadic methods (work in progress).Steve Naroff2007-11-151-2/+3
| | | | llvm-svn: 44171
* Allow properties within a protocol. The case below was asserting...now it ↵Steve Naroff2007-11-141-1/+5
| | | | | | | | | | | | | | works fine. @protocol CAMediaTiming @property int beginTime; @end Comments in the code tell the rest of the story... llvm-svn: 44117
* implement test/Sema/typedef-prototype.c, allowing codeChris Lattner2007-11-141-10/+6
| | | | | | | | | | | to declare a function with a typedef: typedef int unary_int_func(int arg); unary_int_func add_one; This patch contributed by Seo Sanghyeon! llvm-svn: 44100
* Give AST-walk passes a way to access DeclSpec attributes on functions andNate Begeman2007-11-131-2/+6
| | | | | | variables. llvm-svn: 44073
* Rename Sema method to follow class naming conventionNate Begeman2007-11-131-5/+5
| | | | llvm-svn: 44069
* Patch to set context (interface, category, etc.) in which method is declared.Fariborz Jahanian2007-11-131-15/+7
| | | | llvm-svn: 44038
* Add category method definitions incrementally, removing a FIXME (like we do ↵Steve Naroff2007-11-121-16/+23
| | | | | | for class implementations). llvm-svn: 44027
* Fix regression to Sema::ObjcActOnStartOfMethodDef()...need to initialize ↵Steve Naroff2007-11-121-0/+1
| | | | | | InvalidType field to false. llvm-svn: 44023
* - Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();Steve Naroff2007-11-121-12/+13
| | | | | | | | - Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr. - Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars. - A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-) llvm-svn: 44015
* Remove Action::ObjcActOnMethodDefinition(). Rationale:Steve Naroff2007-11-121-45/+20
| | | | | | | | | - It is not an "action" - it is never called by the parser. - It was only used by one method, Sema::ObjcActOnStartOfMethodDef(). As a result, the logic it embodied is now directly implemented in Sema::ObjcActOnStartOfMethodDef(). llvm-svn: 44008
* Make sure @property is allowed within a category.Steve Naroff2007-11-121-2/+3
| | | | | | | | | Bug submitted by Keith Bauer. CookieJar:Desktop keith$ cat test.m #import <WebKit/WebKit.h> llvm-svn: 44007
* Remove Sema::ObjcBuildMethodParameter().Steve Naroff2007-11-121-75/+26
| | | | | | Modify Sema::ParseParamDeclarator() to work for both ActOnStartOfFunctionDef() and ObjcActOnStartOfMethodDef(). llvm-svn: 44006
* Replace 2 method definition actions (ActOnFunctionDefBody, ↵Steve Naroff2007-11-111-36/+9
| | | | | | ActOnMethodDefBody) with 1 method definition action (ActOnFinishFunctionBody). I can't think of any reason that we would need two action hooks. llvm-svn: 44000
* This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() ↵Steve Naroff2007-11-111-11/+31
| | | | | | | | | | | | | | | about private methods (r43989). While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end). Other details... - Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments. - Removed Parser::AllImplMethods (a nice cleanup). - Added location info to ObjcImplementationDecl (since we will need it very soon:-) - Modified message.m test to no longer allow the bogus diagnostic. llvm-svn: 43995
* Teach Sema::ActOnInstanceMessage() about private methods. That is, methods ↵Steve Naroff2007-11-111-2/+3
| | | | | | | | | | declared in an implementation (but not listed in the interface). This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late). I will complete this later... llvm-svn: 43989
* Fixed a bug which exposed the internally built type to user code.Fariborz Jahanian2007-11-101-2/+7
| | | | llvm-svn: 43987
* Minor code clean up in method def area.Fariborz Jahanian2007-11-101-3/+3
| | | | llvm-svn: 43980
* Represent method definitions as separate AST nodes. Pretty print will come next.Fariborz Jahanian2007-11-101-0/+28
| | | | llvm-svn: 43979
* Some code clean up in the form of name changes for functions whichFariborz Jahanian2007-11-091-24/+18
| | | | | | process method definitions. llvm-svn: 43967
* Added class context to method declarations. Provide "interface *" typeFariborz Jahanian2007-11-091-6/+23
| | | | | | to 'self' method of instance methods. llvm-svn: 43957
* Insert invisble arguments to method definition header.Fariborz Jahanian2007-11-091-1/+18
| | | | llvm-svn: 43948
* First patch toward rewriting of method definitions. This is work in progress.Fariborz Jahanian2007-11-081-0/+117
| | | | llvm-svn: 43915
* Patch for objc2's property ASTs, as well as pretty-priting the ASTs.Fariborz Jahanian2007-11-061-3/+53
| | | | llvm-svn: 43778
* improve decl merging logic to be more correct withChris Lattner2007-11-061-0/+5
| | | | | | functions. Patch contributed by Nuno Lopes, thanks! llvm-svn: 43757
* Add better validation for array types when merging decls. PatchChris Lattner2007-11-061-1/+41
| | | | | | contributed by Oliver Hunt, thanks! llvm-svn: 43750
* Remaining work to collect objective-c's type qualifiers and use them to encodeFariborz Jahanian2007-11-011-0/+25
| | | | | | method types. llvm-svn: 43617
* Propagate bitfield info.Devang Patel2007-11-011-1/+1
| | | | llvm-svn: 43613
* 1) More additions for objective-c's qualifier type.Fariborz Jahanian2007-10-311-2/+6
| | | | | | 2) Fixed a test failure (which should have failed all along!). llvm-svn: 43589
* Fixed problem with rewriting stand-alone @implementation (with no matching ↵Fariborz Jahanian2007-10-311-4/+7
| | | | | | | | @interface). A new test case added. llvm-svn: 43568
* Implement a more sensible strategy for ObjC built-in types (addressing a ↵Steve Naroff2007-10-311-23/+9
| | | | | | | | | | | | long standing FIXME in Sema::GetObjcIdType()). This removes several gross hacks to work around the previous "lazy" behavior. Two notes: - MinimalActions still needs to be taught about the built-in types (This breaks one of the -noop test cases). I started this, then added a FIXME. - I didn't convert Sema::GetObjcProtoType() yet. llvm-svn: 43567
* After Anders check-in, we can now encode 'Class' type.Fariborz Jahanian2007-10-311-2/+2
| | | | llvm-svn: 43556
* Added new type and bitfield fields in some decl types in preparation for ↵Fariborz Jahanian2007-10-311-0/+4
| | | | | | | | objective-c's type qualifiers. Added initialization of Class/SEMA types. llvm-svn: 43534
* minor tweaksChris Lattner2007-10-301-2/+2
| | | | llvm-svn: 43515
* Revisited my last patch to be able to do encoding of ivar types with 'id'.Fariborz Jahanian2007-10-301-9/+18
| | | | llvm-svn: 43507
* Added type encoding for 'id' type.Fariborz Jahanian2007-10-301-0/+8
| | | | llvm-svn: 43504
* - Add location info to category/protocol AST'sSteve Naroff2007-10-301-19/+24
| | | | | | - Rewrite categories. llvm-svn: 43501
* Remove a couple FIXME's for rewriting ObjC interfaces (which are now being ↵Steve Naroff2007-10-301-1/+1
| | | | | | rewritten properly). llvm-svn: 43494
* More support for rewriting ObjC intefaces. Still some edge cases to handle...Steve Naroff2007-10-301-10/+17
| | | | llvm-svn: 43493
* This commit contains lot's of small tweaks to how we pass around and store ↵Steve Naroff2007-10-291-13/+15
| | | | | | SourceLocation's for interfaces/protocols/categories/implementations. llvm-svn: 43475
* Start rewriting ObjC interfaces. As a start, we comment out all the methods. ↵Steve Naroff2007-10-261-2/+3
| | | | | | This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's. llvm-svn: 43404
* This patch allows synthesis generation of ivar offset for legacy objective-c ↵Fariborz Jahanian2007-10-261-2/+9
| | | | | | | | @implementation decl without an @interface decl. llvm-svn: 43403
OpenPOWER on IntegriCloud