summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* Some utilities for using the smart pointers in Actions, especially Sema. ↵Sebastian Redl2008-12-134-6/+7
| | | | | | Convert a few functions. llvm-svn: 60983
* Convert remaining expression parsers to smart pointers. Now on to the Action ↵Sebastian Redl2008-12-133-105/+105
| | | | | | connection. llvm-svn: 60982
* fix a buggy fall through that caused a crash-on-invalid. rdar://6248081Chris Lattner2008-12-121-5/+5
| | | | llvm-svn: 60961
* use smarter error recovery for do/while.Chris Lattner2008-12-121-4/+7
| | | | llvm-svn: 60933
* apply the new error recovery smarts we have for if's to while's and switch's.Chris Lattner2008-12-121-42/+49
| | | | llvm-svn: 60932
* merge recovery-2.c into recovery-3.c.Chris Lattner2008-12-121-9/+22
| | | | | | | | | | Substantially improve error recovery after broken if conditions by parsing the full if when we have a semantic error instead of using parser recovery techniques to recover from a semantic error. This fixes rdar://6094870 - spurious error after invalid 'if' condition llvm-svn: 60929
* minor refactoring of ParseParenExpressionChris Lattner2008-12-121-13/+16
| | | | llvm-svn: 60928
* Convert a big bunch of expression parsers to use smart pointers.Sebastian Redl2008-12-116-92/+93
| | | | llvm-svn: 60906
* Convert some more expression parsers to use smart pointers.Sebastian Redl2008-12-114-82/+81
| | | | llvm-svn: 60904
* Convert selected expression parsers to use smart pointers.Sebastian Redl2008-12-116-120/+122
| | | | llvm-svn: 60900
* Convert the remaining statement parsers to smart pointers.Sebastian Redl2008-12-112-25/+26
| | | | llvm-svn: 60895
* Convert some more statement parsers to smart pointers.Sebastian Redl2008-12-111-76/+79
| | | | llvm-svn: 60892
* Convert a number of statement parsers to smart pointers.Sebastian Redl2008-12-114-87/+88
| | | | llvm-svn: 60888
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* Added a warning when referencing an if's condition variable in theDouglas Gregor2008-12-101-0/+3
| | | | | | | | | | | | | | | "else" clause, e.g., if (int X = foo()) { } else { if (X) { // warning: X is always zero in this context } } Fixes rdar://6425550 and lets me think about something other than DeclContext. llvm-svn: 60858
* Use a scoped object to manage entry/exit from a parser scope rather than ↵Douglas Gregor2008-12-108-90/+70
| | | | | | explicitly calling EnterScope/ExitScope llvm-svn: 60830
* Modify the move emulation according to the excellent design of Howard ↵Sebastian Redl2008-12-109-181/+189
| | | | | | 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-0911-222/+108
| | | | llvm-svn: 60791
* Lay the groundwork for converting the entire parser-sema chain to smart ↵Sebastian Redl2008-12-092-6/+9
| | | | | | pointers. llvm-svn: 60782
* Consistently use smart pointers for stmt and expr nodes in parser local ↵Sebastian Redl2008-12-0911-522/+530
| | | | | | 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
* improve comment.Chris Lattner2008-12-081-1/+1
| | | | llvm-svn: 60718
* fix typo.Zhongxing Xu2008-12-081-1/+1
| | | | llvm-svn: 60686
* Add support for calls to dependent names within templates, e.g.,Douglas Gregor2008-12-061-1/+2
| | | | | | | | | | | | | | | | | | template<typename T> void f(T x) { g(x); // g is a dependent name, so don't even bother to look it up g(); // error: g is not a dependent name } Note that when we see "g(", we build a CXXDependentNameExpr. However, if none of the call arguments are type-dependent, we will force the resolution of the name "g" and replace the CXXDependentNameExpr with its result. GCC actually produces a nice error message when you make this mistake, and even offers to compile your code with -fpermissive. I'll do the former next, but I don't plan to do the latter. llvm-svn: 60618
* Representation of template type parameters and non-type templateDouglas Gregor2008-12-052-2/+2
| | | | | | | | | | | | | | | 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
* Add better comments to ::new parsing. Thanks to Doug for the review.Sebastian Redl2008-12-022-2/+4
| | | | llvm-svn: 60423
* Make the parser handle ::new and ::delete correctly.Sebastian Redl2008-12-022-1/+12
| | | | llvm-svn: 60421
* Update cmake build; patch by Csaba Hruska.Eli Friedman2008-12-021-0/+1
| | | | llvm-svn: 60418
* Handle new by passing the Declaration to the Action, not a processed type.Sebastian Redl2008-12-022-60/+50
| | | | llvm-svn: 60413
* A little more scaffolding for parsing templates:Douglas Gregor2008-12-021-38/+44
| | | | | | | | | - Template parameter scope to hold the template parameters - Template parameter context for parsing declarators - Actions for template type parameters and non-type template parameters llvm-svn: 60387
* Basic support for parsing templates, from Andrew SuttonDouglas Gregor2008-12-013-3/+301
| | | | llvm-svn: 60384
* Improve error recovery when parsing a function definition failsDouglas Gregor2008-12-011-1/+1
| | | | llvm-svn: 60380
* Parse the exception-specification throw(...), a Microsoft extensionDouglas Gregor2008-12-011-5/+16
| | | | llvm-svn: 60359
* Implement the GNU __null extensionDouglas Gregor2008-11-291-0/+4
| | | | llvm-svn: 60235
* Attempt to unravel the if/else mess in Parser::ParseDirectDeclarator.Argyrios Kyrtzidis2008-11-261-44/+74
| | | | llvm-svn: 60124
* Add some comments.Argyrios Kyrtzidis2008-11-262-1/+14
| | | | llvm-svn: 60119
* Implement some suggestions by Daniel:Argyrios Kyrtzidis2008-11-264-21/+28
| | | | | | | | -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
* Set default property attributes on each property.Fariborz Jahanian2008-11-261-1/+5
| | | | | | | | Implemented anonymous category (also know as continuation class) used to override main class's property attribute. This is work in propgress. llvm-svn: 60114
* Only call TryAnnotateScopeToken when parsing C++.Daniel Dunbar2008-11-251-1/+2
| | | | | | | - This improves -parse-noop of Carbon.h by +2%, and I believe compensates for the majority of the performance regression in r58913. llvm-svn: 60063
* Use RAII objects to ensure proper destruction of expression and statement ↵Sebastian Redl2008-11-259-99/+253
| | | | | | AST nodes in the parser in most cases, even on error. llvm-svn: 60057
* Simple parsing of exception specifications, with no semantic analysis yetDouglas Gregor2008-11-252-3/+42
| | | | llvm-svn: 60005
* 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-234-4/+4
| | | | llvm-svn: 59921
* Convert IdentifierInfo's to be printed the same as DeclarationNames Chris Lattner2008-11-233-7/+7
| | | | | | | | | | | | | | | | | | | | | with implicit quotes around them. This has a bunch of follow-on effects and requires tweaking to a whole lot of code. This causes a regression in two tests (xfailed) by causing it to emit things like: Line 10: duplicate interface declaration for category 'MyClass1' ('Category1') instead of: Line 10: duplicate interface declaration for category 'MyClass1(Category1)' I will fix this in a follow-up commit. As part of this, I had to start switching stuff to use ->getDeclName() instead of Decl::getName() for consistency. This is good, but I was planning to do this as an independent patch. There will be several follow-on patches to clean up some of the mess, but this patch is already too big. llvm-svn: 59917
* remove some more old Diag methods, replace with a single static helper functionChris Lattner2008-11-221-24/+23
| | | | llvm-svn: 59868
* Teach tentative parsing to handle block pointers (rdar://6394309)Chris Lattner2008-11-221-1/+2
| | | | llvm-svn: 59853
* 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
* Implementation of new and delete parsing and sema.Sebastian Redl2008-11-213-14/+264
| | | | | | This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first. llvm-svn: 59835
* Tiny fix to the parsing of linkage-specificationsDouglas Gregor2008-11-212-4/+4
| | | | llvm-svn: 59820
* Daniel really really likes = instead of += :)Chris Lattner2008-11-201-1/+1
| | | | llvm-svn: 59716
OpenPOWER on IntegriCloud