summaryrefslogtreecommitdiffstats
path: root/clang/Parse/Parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-647/+0
| | | | | | | | | | lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
* A much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987.Steve Naroff2008-02-141-3/+14
| | | | llvm-svn: 47103
* Allow the parser to detect invalid DeclSpec's. This fixes ↵Steve Naroff2008-02-121-1/+4
| | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=1987. This commit only "guards" the call to ParseDeclarationSpecifiers() in ParseDeclarationOrFunctionDefinition(). We could consider guarding all calls, however this is a bit radical (since it effectively stops parsing the declaration once we have a bad declspec). Will discuss with Chris tomorrow. llvm-svn: 46984
* Put back the top-level asm code; all tests pass now.Anders Carlsson2008-02-081-9/+14
| | | | llvm-svn: 46868
* Back out 46855 for now, it causes test failures on Darwin.Anders Carlsson2008-02-081-12/+10
| | | | llvm-svn: 46867
* Handle top-level asm declarations.Anders Carlsson2008-02-071-10/+12
| | | | llvm-svn: 46855
* Fix a fixme, by only parsing extern "C" in C++ mode.Chris Lattner2008-01-121-2/+1
| | | | llvm-svn: 45905
* Add first pieces of support for parsing and representing Chris Lattner2008-01-121-0/+9
| | | | | | extern "C" in C++ mode. Patch by Mike Stump! llvm-svn: 45904
* Substituted all instances of the string "Objc" for "ObjC". This fixesTed Kremenek2008-01-071-16/+16
| | | | | | | some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. llvm-svn: 45715
* New declarations/defs for Objc2's foreach-statement. This is work in progress.Fariborz Jahanian2008-01-021-0/+1
| | | | llvm-svn: 45511
* Issue diagnostic when objective-c's @interface is preceeded by a type specifier.Fariborz Jahanian2008-01-021-0/+3
| | | | llvm-svn: 45491
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | discussion of this change. llvm-svn: 45410
* - Use Tok.isObjCAtKeyword instead of ↵Chris Lattner2007-12-271-2/+6
| | | | | | | | | | | | Tok.getIdentifierInfo()->getObjCKeywordID(). The later fails if the token is not an identifier. - Replace tabs with spaces. - Various other cleanups. Patch by Nico Weber! llvm-svn: 45368
* TargetInfo no longer includes a reference to SourceManager.Ted Kremenek2007-12-121-1/+1
| | | | | | | | | | | | | | | Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. llvm-svn: 44957
* Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek2007-12-111-1/+1
| | | | | | | | | | | | | | | | | | SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. llvm-svn: 44878
* Yesterday, I simplified how we stream top-level decls.Steve Naroff2007-11-291-3/+5
| | | | | | | After a discussion with Ted, we both came to the conclusion that adding a "HandleTopLevelDeclaration" hook to ASConsumer is far more elegant. The default implementation of HandleTopLevelDeclaration will be responsible for iterating over the ScopedDecl (which has a chain of the decls:-). TODO: Once Ted adds HandleTopLevelDeclaration, make sure TagDecls are chainged appropriately... llvm-svn: 44445
* Several fixes/simplifications surrounding how we stream top-level decl AST's.Steve Naroff2007-11-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Store inline asm code in the AST.Anders Carlsson2007-11-201-3/+5
| | | | llvm-svn: 44255
* Rewrite method definition bodies. Also renamed a method to distinguish ↵Steve Naroff2007-11-131-1/+1
| | | | | | between method declarations and definitions. llvm-svn: 44080
* Replace 3 method definition functions (ObjcParseMethodDefinition, ↵Steve Naroff2007-11-111-45/+1
| | | | | | | | ParseObjCInstanceMethodDefinition, ParseObjCClassMethodDefinition) with 1 method definition function (ParseObjCMethodDefinition). Less code/confusion. llvm-svn: 43999
* This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() ↵Steve Naroff2007-11-111-1/+0
| | | | | | | | | | | | | | | 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
* Represent method definitions as separate AST nodes. Pretty print will come next.Fariborz Jahanian2007-11-101-10/+20
| | | | llvm-svn: 43979
* Some code clean up in the form of name changes for functions whichFariborz Jahanian2007-11-091-5/+7
| | | | | | process method definitions. llvm-svn: 43967
* First patch toward rewriting of method definitions. This is work in progress.Fariborz Jahanian2007-11-081-2/+27
| | | | llvm-svn: 43915
* Refactored parsing of main function body for reuse by objective-c methods.Fariborz Jahanian2007-11-081-15/+1
| | | | llvm-svn: 43898
* More infrastructure to recognize objective-c's type qualifiers (in,inout, etc.)Fariborz Jahanian2007-10-311-1/+1
| | | | llvm-svn: 43580
* resolve a fixme, by moving __builtin_va_list to a more logicalChris Lattner2007-10-101-19/+0
| | | | | | place and making it correctly parameterized on the target. llvm-svn: 42830
* Make sure methods with no return type default to "id".Steve Naroff2007-10-091-2/+3
| | | | | | | | | | 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). llvm-svn: 42817
* avoid a noop virtual method call on the hot scope poping path.Chris Lattner2007-10-091-2/+4
| | | | llvm-svn: 42809
* Add two new Token helper functions, "is" and "isNot". This allows us to writeChris Lattner2007-10-091-23/+23
| | | | | | | | | | | | | | | | | | | stuff like this: // If we don't have a comma, it is either the end of the list (a ';') or // an error, bail out. if (Tok.isNot(tok::comma)) break; instead of: // If we don't have a comma, it is either the end of the list (a ';') or // an error, bail out. if (Tok.getKind() != tok::comma) break; There is obviously no functionality change, but the code reads a bit better and is more terse. llvm-svn: 42795
* rename some "Parse" actions to "ActOn". Move code around inChris Lattner2007-10-091-16/+16
| | | | | | | | ParseFunctionDefinition so that ActOnFunctionDefBody is always called if ActOnStartOfFunctionDef is called. This fixes a crash reported by Nuno Lopes. llvm-svn: 42793
* Patch for method implementation. It populates ObjcImplementationDecl object ↵Fariborz Jahanian2007-09-271-0/+1
| | | | | | | | with method implementation declarations . It checks and warns on those methods declared in class interface and not implemented. llvm-svn: 42412
* Start converting Action methods from Parse-prefix to ActOn-prefix.Steve Naroff2007-09-151-2/+2
| | | | | | 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
* Fix the following bug submitted by Ted Kremenek:Steve Naroff2007-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Some small tweaks to the recent Objc support...Steve Naroff2007-09-101-2/+2
| | | | llvm-svn: 41803
* The goal of this commit is to get just enough Sema support to recognize ↵Steve Naroff2007-09-061-0/+1
| | | | | | | | | | | 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
* Author: F. JahanianFariborz Jahanian2007-08-311-0/+12
| | | | | | | | | | | | | Log: Implement parsing of objective-c's new @property declaration. Modified: include/clang/Basic/DiagnosticKinds.def include/clang/Parse/Parser.h Parse/ParseObjc.cpp Parse/Parser.cpp llvm-svn: 41644
* cleanup context-sensitive objc keyword recognition. Patch by Fariborz Jahanian.Chris Lattner2007-08-291-0/+11
| | | | llvm-svn: 41583
* Break the assumption that any sort of scope (e.g. a loop scope) can Chris Lattner2007-08-261-5/+4
| | | | | | | | hold declarations. Instead, introduce a new "DeclScope" scope type that holds them explicitly. For now, all scopes have this bit, but in the future we can use them to fix some issues Neil noticed. llvm-svn: 41431
* read and ignore the body of a namespace.Chris Lattner2007-08-251-1/+1
| | | | llvm-svn: 41403
* refactor enough of the top-level parsing logic to parse andChris Lattner2007-08-251-0/+1
| | | | | | ignore 'namespace foo {}' llvm-svn: 41400
* C++ explicitly allows an empty source file.Chris Lattner2007-08-251-1/+2
| | | | llvm-svn: 41399
* - Cleanup "hack" comment and fix typos.Steve Naroff2007-08-231-2/+2
| | | | | | - Use getLang().ObjC2 when appropriate. llvm-svn: 41333
* Add support for parsing protocols.Steve Naroff2007-08-221-2/+2
| | | | | | Now we can parse quite a bit of "Foundation.h" (a couple bugs remain). llvm-svn: 41300
* update todo markersChris Lattner2007-08-221-3/+3
| | | | llvm-svn: 41267
* Start parsing ObjC classes/categories!Steve Naroff2007-08-201-0/+7
| | | | | | | Next step, refactor Parser::ParseStructUnionBody() so that struct declarations can be shared with Objective-C (for declaring instance variables). llvm-svn: 41200
* add support for a top-level __extension__ marker, implementing a todo.Chris Lattner2007-08-101-3/+10
| | | | llvm-svn: 41004
* Fix a comment, patch by Kevin Andre!Chris Lattner2007-07-241-1/+1
| | | | llvm-svn: 40466
* Make parser scope cache be a member of the parser instead of a global,Chris Lattner2007-07-151-17/+10
| | | | | | which makes it multithread clean. llvm-svn: 39863
* Finally bite the bullet and make the major change: split the clang namespaceChris Lattner2007-06-151-2/+2
| | | | | | | | | | | | | out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659
OpenPOWER on IntegriCloud