summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-88/+59
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Extend the parser to support pack expansions within exceptionDouglas Gregor2010-12-201-2/+13
| | | | | | | specifications. We can't yet instantiate them, however, since I tripped over PR8835. llvm-svn: 122292
* Added ParenType type node.Abramo Bagnara2010-12-101-1/+1
| | | | llvm-svn: 121488
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-031-1/+1
| | | | llvm-svn: 120828
* In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (seeCraig Silverstein2010-11-181-1/+1
| | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to rjmccall for all the coaching! Approved by rjmccall llvm-svn: 119697
* Region-allocate all AttributeList objects from a factory object instead of ↵Ted Kremenek2010-11-101-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | manually managing them using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up. This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList objects and then blows them away all at once. While conceptually simple, most of the changes in this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications. This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its underlying allocator as we enter/leave key methods in the Parser. This means that we get simple memory management while still having the ability to finely control memory use if necessary. Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic in many large files with attributes. This fixes the leak reported in: <rdar://problem/8650003> llvm-svn: 118675
* Diagnose attempst to template using declarations and using directives.John McCall2010-11-101-14/+42
| | | | | | Recover from the latter and fail early for the former. Fixes PR8022. llvm-svn: 118669
* tidy upChris Lattner2010-11-091-5/+5
| | | | llvm-svn: 118626
* fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange ↵Chris Lattner2010-11-091-1/+0
| | | | | | being constructed. llvm-svn: 118625
* Tag references shouldn't ever get template parameter lists.John McCall2010-10-191-4/+9
| | | | | | Fixes rdar://problem/8568507 llvm-svn: 116843
* Redirect templated friend class decls to a new Sema callback andJohn McCall2010-10-191-3/+14
| | | | | | | construct an unsupported friend when there's a friend with a templated scope specifier. Fixes a consistency crash, rdar://problem/8540527 llvm-svn: 116786
* Parse default arguments within member functions in source order, fromDouglas Gregor2010-10-121-9/+7
| | | | | | Manuel Klimek! Fixes PR7715. llvm-svn: 116311
* Add parsing support for Microsoft attributes. MS attributes will just be ↵Francois Pichet2010-10-111-0/+26
| | | | | | skipped and not inserted into the AST for now. llvm-svn: 116203
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-1/+2
| | | | | | bit by me). llvm-svn: 116122
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-0/+19
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* Allow the use of C++0x deleted functions as an extension in C++98.Anders Carlsson2010-09-241-1/+3
| | | | llvm-svn: 114762
* Eliminate the comma locations from all of the Sema routines that dealDouglas Gregor2010-09-091-2/+1
| | | | | | | | with comma-separated lists. We never actually used the comma locations, nor did we store them in the AST, but we did manage to waste time during template instantiation to produce fake locations. llvm-svn: 113495
* Improve recovery when there is a stray ']' or ')' before the ';' atDouglas Gregor2010-09-071-3/+4
| | | | | | the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
* Improve recovery when a comma is missing between enumerators in anDouglas Gregor2010-09-071-5/+5
| | | | | | enumeration definition. Fixes <rdar://problem/7159693>. llvm-svn: 113201
* Improve diagnostic and recovery when missing a comma between base orDouglas Gregor2010-09-071-0/+6
| | | | | | member initializers in a C++ constructor. Fixes <rdar://problem/7796492>. llvm-svn: 113199
* Enable inline namespaces in C++03 as an extension.Sebastian Redl2010-08-311-0/+4
| | | | llvm-svn: 112566
* Basic code completion support for the base and member initializers inDouglas Gregor2010-08-281-6/+13
| | | | | | a constructor. llvm-svn: 112330
* Parser support for inline namespacesSebastian Redl2010-08-271-7/+14
| | | | llvm-svn: 112320
* One who seeks knowledge learns something new every day.John McCall2010-08-261-27/+25
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Parse all kinds of declarations as part of a linkage-specification,Douglas Gregor2010-08-241-1/+1
| | | | | | from Francois Pichet! Fixes PR7754. llvm-svn: 111912
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-8/+8
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-33/+31
| | | | llvm-svn: 111901
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-2/+3
| | | | llvm-svn: 111863
* Push DeclGroupRefs and TemplateNames in an opaque but type-safe wayJohn McCall2010-08-231-3/+3
| | | | | | through the parser. llvm-svn: 111800
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-4/+4
| | | | llvm-svn: 111795
* DeclPtrTy -> Decl *John McCall2010-08-211-35/+35
| | | | llvm-svn: 111733
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-3/+3
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* -Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis2010-08-111-2/+2
| | | | | | | | -There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility. To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods. Store the bitfield in PCH. llvm-svn: 110868
* Allow multiple __declspec attributes after a class-key.John McCall2010-08-051-1/+1
| | | | | | Patch by Francois Pichet! llvm-svn: 110344
* Fixed typedef inside extern "C".Abramo Bagnara2010-07-301-0/+1
| | | | llvm-svn: 109865
* Improve error recovery when presented with an ill-formed template-idJohn McCall2010-07-301-5/+9
| | | | | | | | (e.g. due to a broken template argument) following template parameters. Fixes rdar://problem/8254267 llvm-svn: 109853
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-261-3/+14
| | | | llvm-svn: 109396
* Treat template parameters as part of the declaration-specifiers for theJohn McCall2010-07-161-4/+7
| | | | | | | | purpose of access control. Fixes PR7644. I can't actually find anything directly justifying this, but it seems obvious. llvm-svn: 108521
* Move the "current scope" state from the Parser into Action. ThisDouglas Gregor2010-07-021-37/+37
| | | | | | | | | | | | | | allows Sema some limited access to the current scope, which we only use in one way: when Sema is performing some kind of declaration that is not directly driven by the parser (e.g., due to template instantiatio or lazy declaration of a member), we can find the Scope associated with a DeclContext, if that DeclContext is still in the process of being parsed. Use this to make the implicit declaration of special member functions in a C++ class more "scope-less", rather than using the NULL Scope hack. llvm-svn: 107491
* Partial fix for PR7267 based on comments by John McCall on an earlier patch.Chandler Carruth2010-06-281-0/+22
| | | | | | | | | | | | | | | | | | This is more targeted, as it simply provides toggle actions for the parser to turn access checking on and off. We then use these to suppress access checking only while we parse the template-id (included scope specifier) of an explicit instantiation and explicit specialization of a class template. The specialization behavior is an extension, as it seems likely a defect that the standard did not exempt them as it does explicit instantiations. This allows the very common practice of specializing trait classes to work for private, internal types. This doesn't address instantiating or specializing function templates, although those apparently already partially work. The naming and style for the Action layer isn't my favorite, comments and suggestions would be appreciated there. llvm-svn: 106993
* When semantic analysis fail to introduce a class or class template,Douglas Gregor2010-06-211-30/+35
| | | | | | | | just skip over the body of the class or class template: it's a semantic disaster that's likely to cause invariants to break. Fixes part of <rdar://problem/8104754>. llvm-svn: 106496
* When parsing cached C++ method declarations/definitions, save theDouglas Gregor2010-06-161-0/+2
| | | | | | | | "previous token" location at the end of the class definition. This eliminates a badly-placed error + Fix-It when the ';' following a class definition is missing. Fixes <rdar://problem/8066414>. llvm-svn: 106175
* Make the "extra ';' inside a struct or union" diagnostic moreDouglas Gregor2010-06-161-0/+1
| | | | | | precise. Fixes PR7336. llvm-svn: 106170
* Allow an asm label specifier on C++ methods, like GCC does.Chris Lattner2010-06-131-2/+11
| | | | | | Patch by David Majnemer! llvm-svn: 105909
* Added AccessSpecDecl node.Abramo Bagnara2010-06-051-1/+6
| | | | llvm-svn: 105525
* Don't try to parse class template specializations in C. It can onlyDouglas Gregor2010-05-301-3/+1
| | | | | | lead to heartache. Fixes <rdar://problem/8044088>. llvm-svn: 105178
* Don't just skip over the entire tag definition if the parser action didn'tJohn McCall2010-05-281-10/+8
| | | | | | | give us a decl back. Makes -cc1 -parse-noop handle a substantially larger amount of the C++ grammar. llvm-svn: 104940
* Improve code completion in failure cases in two ways:Douglas Gregor2010-05-251-5/+5
| | | | | | | | | | | 1) Suppress diagnostics as soon as we form the code-completion token, so we don't get any error/warning spew from the early end-of-file. 2) If we consume a code-completion token when we weren't expecting one, go into a code-completion recovery path that produces the best results it can based on the context that the parser is in. llvm-svn: 104585
* Propagate access specifiers to anonymous union members nested within classes.John McCall2010-05-211-1/+1
| | | | | | Fixes <rdar://problem/7987650>. llvm-svn: 104376
* mutable is a storage class that can follow a class/struct/union definition. ↵Douglas Gregor2010-05-171-0/+1
| | | | | | Fixes PR7153 llvm-svn: 103954
OpenPOWER on IntegriCloud