summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use a scoped object to manage entry/exit from a parser scope rather than ↵Douglas Gregor2008-12-101-6/+3
| | | | | | explicitly calling EnterScope/ExitScope llvm-svn: 60830
* Modify the move emulation according to the excellent design of Howard ↵Sebastian Redl2008-12-101-10/+10
| | | | | | Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers. llvm-svn: 60809
* Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResultSebastian Redl2008-12-091-4/+3
| | | | llvm-svn: 60791
* Lay the groundwork for converting the entire parser-sema chain to smart ↵Sebastian Redl2008-12-091-0/+3
| | | | | | pointers. llvm-svn: 60782
* Consistently use smart pointers for stmt and expr nodes in parser local ↵Sebastian Redl2008-12-091-9/+10
| | | | | | variables. llvm-svn: 60761
* Fix PR3172: if we see an eof or } at the top level, reject it.Chris Lattner2008-12-081-0/+9
| | | | | | | This is important because ParseDeclarationOrFunctionDefinition skips to, but does not consume, an } on error. llvm-svn: 60719
* Representation of template type parameters and non-type templateDouglas Gregor2008-12-051-1/+1
| | | | | | | | | | | | | | | parameters, with some semantic analysis: - Template parameters are introduced into template parameter scope - Complain about template parameter shadowing (except in Microsoft mode) Note that we leak template parameter declarations like crazy, a problem we'll remedy once we actually create proper declarations for templates. Next up: dependent types and value-dependent/type-dependent expressions. llvm-svn: 60597
* Basic support for parsing templates, from Andrew SuttonDouglas Gregor2008-12-011-0/+2
| | | | llvm-svn: 60384
* Improve error recovery when parsing a function definition failsDouglas Gregor2008-12-011-1/+1
| | | | llvm-svn: 60380
* Add some comments.Argyrios Kyrtzidis2008-11-261-0/+9
| | | | llvm-svn: 60119
* Implement some suggestions by Daniel:Argyrios Kyrtzidis2008-11-261-6/+8
| | | | | | | | -Change Parser::ParseCXXScopeSpecifier to MaybeParseCXXScopeSpecifier -Remove Parser::isTokenCXXScopeSpecifier and fold it into MaybeParseCXXScopeSpecifier -Rename Parser::TryAnnotateScopeToken to TryAnnotateCXXScopeToken and only allow it to be called when in C++ llvm-svn: 60117
* Remove an empty if and add a reminder for when we implement C++ try-catch.Sebastian Redl2008-11-241-4/+1
| | | | llvm-svn: 59987
* make the 'to match this' diagnostic a note.Chris Lattner2008-11-231-1/+1
| | | | llvm-svn: 59921
* Split the DiagnosticInfo class into two disjoint classes:Chris Lattner2008-11-221-2/+2
| | | | | | | | | | one for building up the diagnostic that is in flight (DiagnosticBuilder) and one for pulling structured information out of the diagnostic when formatting and presenting it. There is no functionality change with this patch. llvm-svn: 59849
* Tiny fix to the parsing of linkage-specificationsDouglas Gregor2008-11-211-2/+2
| | | | llvm-svn: 59820
* Fix this:Argyrios Kyrtzidis2008-11-191-6/+12
| | | | | | | | | | | | With this snippet: void f(a::b); An assert is hit: Assertion failed: CachedTokens[CachedLexPos-1].getLocation() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token", file ..\..\lib\Lex\PPCaching.cpp, line 98 Introduce Preprocessor::RevertCachedTokens that reverts a specific number of tokens when backtracking is enabled. llvm-svn: 59636
* remove uses of IdentifierInfo::getName()Chris Lattner2008-11-191-2/+2
| | | | llvm-svn: 59607
* remove the last couple obsolete forms of Parser::Diag.Chris Lattner2008-11-181-12/+0
| | | | llvm-svn: 59510
* Change a couple of the Parser::Diag methods to return DiagnosticInfoChris Lattner2008-11-181-12/+14
| | | | | | | | | and let the clients push whatever they want into the DiagnosticInfo instead of hard coding a few forms. Also switch various clients to use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the canonical form to simplify the code a bit. llvm-svn: 59509
* This reworks some of the Diagnostic interfaces a bit to change how diagnosticsChris Lattner2008-11-181-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are formed. In particular, a diagnostic with all its strings and ranges is now packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a ton of random stuff. This has the benefit of simplifying the interface, making it more extensible, and allowing us to do more checking for things like access past the end of the various arrays passed in. In addition to introducing DiagnosticInfo, this also substantially changes how Diagnostic::Report works. Instead of being passed in all of the info required to issue a diagnostic, Report now takes only the required info (a location and ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to stuff strings and ranges into the DiagnosticInfo with the << operator. When the dtor runs on the DiagnosticInfo object (which should happen at the end of the statement), the diagnostic is actually emitted with all of the accumulated information. This is a somewhat tricky dance, but it means that the accumulated DiagnosticInfo is allowed to keep pointers to other expression temporaries without those pointers getting invalidated. This is just the minimal change to get this stuff working, but this will allow us to eliminate the zillions of variant "Diag" methods scattered throughout (e.g.) sema. For example, instead of calling: Diag(BuiltinLoc, diag::err_overload_no_match, typeNames, SourceRange(BuiltinLoc, RParenLoc)); We will soon be able to just do: Diag(BuiltinLoc, diag::err_overload_no_match) << typeNames << SourceRange(BuiltinLoc, RParenLoc)); This scales better to support arbitrary types being passed in (not just strings) in a type-safe way. Go operator overloading?! llvm-svn: 59502
* Change the diagnostics interface to take an array of pointers to Chris Lattner2008-11-181-2/+4
| | | | | | | | strings instead of array of strings. This reduces string copying in some not-very-important cases, but paves the way for future improvements. llvm-svn: 59494
* Eliminate all of the placeholder identifiers used for constructors,Douglas Gregor2008-11-171-1/+1
| | | | | | | | | destructors, and conversion functions. The placeholders were used to work around the fact that the parser and some of Sema really wanted declarators to have simple identifiers; now, the code that deals with declarators will use DeclarationNames. llvm-svn: 59469
* Implement support for C++ nested-name-specifiers ('foo::bar::x') in the ↵Argyrios Kyrtzidis2008-11-081-0/+71
| | | | | | | | Parser side. No Sema functionality change, just the signatures of the Action/Sema methods. llvm-svn: 58913
* Initial implementation of parsing, semantic analysis, and AST-buildingDouglas Gregor2008-11-051-4/+17
| | | | | | | | | | | | | for constructor initializations, e.g., class A { }; class B : public A { int m; public: B() : A(), m(17) { }; }; llvm-svn: 58749
* eliminate ObjCPropertyAttrs an corresponding enums, just useChris Lattner2008-10-201-12/+0
| | | | | | strcmp when needed. llvm-svn: 57817
* remove extraneous bracesChris Lattner2008-10-201-3/+2
| | | | llvm-svn: 57814
* simplify some other code for __extension__ processing.Chris Lattner2008-10-201-0/+1
| | | | llvm-svn: 57807
* implement a couple fixme's by implementing __extension__ properly.Chris Lattner2008-10-201-5/+4
| | | | llvm-svn: 57806
* fix indentationChris Lattner2008-10-201-2/+3
| | | | llvm-svn: 57788
* Implement support for C++ direct initializers in declarations, e.g. "int x(1);".Argyrios Kyrtzidis2008-10-061-1/+3
| | | | | | | | | | | | | | | This is how this kind of initializers appear in the AST: -The Init expression of the VarDecl is a functional type construction (of the VarDecl's type). -The new VarDecl::hasCXXDirectInitializer() returns true. e.g, for "int x(1);": -VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr). -hasCXXDirectInitializer() of VarDecl 'x' returns true. A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code. Note that codegening works now for "int x(1);" without any changes to CodeGen. llvm-svn: 57178
* Add Parser support for #pragma packDaniel Dunbar2008-10-041-0/+12
| | | | | | | - Uses Action::ActOnPragmaPack - Test case is XFAIL pending verifier fixes. llvm-svn: 57066
* Parser support for prefix __attribute__ on @protocol.Daniel Dunbar2008-09-261-3/+8
| | | | llvm-svn: 56642
* Pass SourceRanges by reference to the various Diag methods.Argyrios Kyrtzidis2008-08-241-1/+1
| | | | llvm-svn: 55284
* Add a Parser::Diag overload that can receive a custom string along with a ↵Argyrios Kyrtzidis2008-08-241-0/+6
| | | | | | SourceRange. llvm-svn: 55283
* make sure that ParseAST invokes the action for end of translation unit.Chris Lattner2008-08-231-3/+4
| | | | llvm-svn: 55222
* add action to know about end of translation unit.Chris Lattner2008-08-231-1/+3
| | | | llvm-svn: 55218
* we already have a handle on the 'in' keyword, don't bother getting two.Chris Lattner2008-08-231-1/+0
| | | | llvm-svn: 55217
* minor cleanup, remove finalize method.Chris Lattner2008-08-231-9/+3
| | | | llvm-svn: 55216
* Change Parser & Sema to use interned "super" for comparions.Daniel Dunbar2008-08-141-0/+2
| | | | | | | | | | | | | | - Added as private members for each because it is not clear where to put the common definition. Perhaps the IdentifierInfos all of these "pseudo-keywords" should be collected into one place (this would KnownFunctionIDs and Objective-C property IDs, for example). Remove Token::isNamedIdentifier. - There isn't a good reason to use strcmp when we have interned strings, and there isn't a good reason to encourage clients to do so. llvm-svn: 54794
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | - Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into implementation .cpp llvm-svn: 54626
* Fix rdar://6124613 a crash on invalid code.Chris Lattner2008-08-051-2/+4
| | | | llvm-svn: 54340
* Add more Parser/Sema support for GCC asm-label extension.Daniel Dunbar2008-08-051-1/+5
| | | | | | | | | | | | | - ActOnDeclarator now takes an additional parameter which is the AsmLabel if used. Its unfortunate that this bubbles up this high, but we cannot just lump it in as an attribute without mistakenly *accepting* it as an attribute. - The actual asm-label itself is, however, encoded as an AsmLabelAttr on the FunctionDecl. - Slightly improved parser error recovery on malformed asm-labels. - CodeGen support still missing... llvm-svn: 54339
* add a new diag helper that takes a range.Chris Lattner2008-07-261-0/+6
| | | | llvm-svn: 54081
* Make Declarator::getDeclSpec() return a const reference to avoidChris Lattner2008-06-261-1/+1
| | | | | | cases where mutation can introduce bugs. Propagate around 'const'. llvm-svn: 52772
* Add parsing support for C++ classes.Argyrios Kyrtzidis2008-06-241-0/+2
| | | | | | | Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place. Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass. llvm-svn: 52694
* K&R-style functions not allowed in C++.Argyrios Kyrtzidis2008-06-211-2/+3
| | | | llvm-svn: 52575
* Test commit to see if new account works.Mike Stump2008-06-191-60/+60
| | | | | | | I choose to remove extraneous whitespace at end of lines as a semantic nop for the test. llvm-svn: 52503
* Fix a couple crashes on invalid input.Chris Lattner2008-05-271-1/+2
| | | | llvm-svn: 51622
* Fix the scope of K&R-style argument declarations so that they don't Eli Friedman2008-05-201-1/+1
| | | | | | | | | extend beyond the end of the function. I'm not completely sure this is the right way to fix this bug, so someone familiar with the parser should double-check. llvm-svn: 51311
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-5/+12
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
OpenPOWER on IntegriCloud