summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-141-0/+16
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!Peter Collingbourne2011-02-111-7/+7
| | | | llvm-svn: 125399
* Implement the suggested resolution to core issue 547, extended to alsoDouglas Gregor2011-01-311-2/+3
| | | | | | | | | allow ref-qualifiers on function types used as template type arguments. GNU actually allows cv-qualifiers on function types in many places where it shouldn't, so we currently categorize this as a GNU extension. llvm-svn: 124584
* Allow Microsoft attributes in a constructor's parameter list.Francois Pichet2011-01-311-0/+4
| | | | | | This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang. llvm-svn: 124573
* Improve the extension warning for the use of ref-qualifiers, toDouglas Gregor2011-01-261-2/+2
| | | | | | | distinguish them from rvalue references. Using the rvalue-references warning was weird when the ref-qualifier was '&'. llvm-svn: 124316
* Rvalue references for *this: parse ref-qualifiers.Douglas Gregor2011-01-261-2/+31
| | | | llvm-svn: 124276
* Downgrade the error about rvalue references to an extension warningDouglas Gregor2011-01-251-1/+1
| | | | | | | | and turn on __has_feature(cxx_rvalue_references). The core rvalue references proposal seems to be fully implemented now, pending lots more testing. llvm-svn: 124169
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-1/+0
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Fix an embarrassing think in the disambiguation logic for the ellipsis in a ↵Douglas Gregor2011-01-051-1/+0
| | | | | | parameter-type-list llvm-svn: 122924
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-169/+128
| | | | | | | 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
* Implement parsing of function parameter packs and non-type templateDouglas Gregor2010-12-231-1/+16
| | | | | | | | | | | | parameter packs (C++0x [dcl.fct]p13), including disambiguation between unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for cases like void f(T...) where T may or may not contain unexpanded parameter packs. llvm-svn: 122520
* Added ParenType type node.Abramo Bagnara2010-12-101-2/+2
| | | | llvm-svn: 121488
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-031-4/+7
| | | | llvm-svn: 120828
* After parsing a ':' in an enum-specifier within class context,Douglas Gregor2010-12-011-4/+50
| | | | | | | | | | disambiguate between an expression (for a bit-field width) and a type (for a fixed underlying type). Since the disambiguation can be expensive (due to tentative parsing), we perform a simplistic disambiguation based on one-token lookahead before going into the full-blown tentative parsing. Based on a patch by Daniel Wallin. llvm-svn: 120582
* Remove the other FIXME I added. This is covered by the Index test and not ↵Nico Weber2010-11-221-2/+0
| | | | | | testable via -ast-dump. llvm-svn: 119971
* Try to get the bots green after r119966.Nico Weber2010-11-221-2/+3
| | | | llvm-svn: 119968
* Fix the source range of CXXNewExprs. Fixes http://llvm.org/pr8661.Nico Weber2010-11-221-3/+6
| | | | llvm-svn: 119966
* When parsing something that looks like an ill-formedDouglas Gregor2010-11-191-5/+4
| | | | | | | | protocol-qualifier list without a leading type (e.g., <#blah#>), don't complain about it being an archaic protocol-qualifier list unless it actually parses as one. llvm-svn: 119805
* Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.Argyrios Kyrtzidis2010-11-161-2/+10
| | | | | | Fixes rdar://8365458 llvm-svn: 119359
* Region-allocate all AttributeList objects from a factory object instead of ↵Ted Kremenek2010-11-101-48/+43
| | | | | | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | Recover from the latter and fail early for the former. Fixes PR8022. llvm-svn: 118669
* fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange ↵Chris Lattner2010-11-091-0/+1
| | | | | | being constructed. llvm-svn: 118625
* Parse attributes on enumerators and instantiate attributes on enum decls.John McCall2010-10-221-1/+6
| | | | llvm-svn: 117182
* Teach the C++ simple-type-specifier parser and tentative parses aboutDouglas Gregor2010-10-211-58/+20
| | | | | | protocol-qualified types such as id<Protocol>. llvm-svn: 117081
* Add parsing support for Microsoft attributes. MS attributes will just be ↵Francois Pichet2010-10-111-0/+4
| | | | | | 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/+41
| | | | | | bit by me). llvm-svn: 116122
* When we encounter a '==' in a context expecting a '=', assume the user made ↵Argyrios Kyrtzidis2010-10-081-1/+2
| | | | | | | | | | | | | a typo: t.c:1:7: error: invalid '==' at end of declaration; did you mean '='? int x == 0; ^~ = Implements rdar://8488464. llvm-svn: 116035
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-5/+22
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* vla expressions used in __typeof__ must be evaluated.Fariborz Jahanian2010-09-281-4/+11
| | | | | | Fixes rdar://8476159. llvm-svn: 114982
* Allow the use of C++0x deleted functions as an extension in C++98.Anders Carlsson2010-09-241-1/+5
| | | | llvm-svn: 114762
* Implement code completion for Objective-C class message sends that areDouglas Gregor2010-09-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | missing the opening bracket '[', e.g., NSArray <CC> at function scope. Previously, we would only give trivial completions (const, volatile, etc.), because we're in a "declaration name" scope. Now, we also provide completions for class methods of NSArray, e.g., alloc Note that we already had support for this after the first argument, e.g., NSArray method:x <CC> would get code completion for class methods of NSArray whose selector starts with "method:". This was already present because we recover as if NSArray method:x were a class message send missing the opening bracket (which was committed in r114057). llvm-svn: 114078
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-161-1/+14
| | | | | | | | | | | | | | | | sends. These are far trickier than instance messages, because we typically have something like NSArray alloc] where it appears to be a declaration of a variable named "alloc" up until we see the ']' (or a ':'), and at that point we can't backtrace. So, we use a combination of syntactic and semantic disambiguation to treat this as a message send only when the type is an Objective-C type and it has the syntax of a class message send (which would otherwise be ill-formed). llvm-svn: 114057
* When parsing default function arguments, do not mark any declarationsDouglas Gregor2010-09-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | used in the default function argument as "used". Instead, when we actually use the default argument, make another pass over the expression to mark any used declarations as "used" at that point. This addresses two kinds of related problems: 1) We were marking some declarations "used" that shouldn't be, because we were marking them too eagerly. 2) We were failing to mark some declarations as "used" when we should, if the first time it was instantiated happened to be an unevaluated context, we wouldn't mark them again at a later point. I've also added a potentially-handy visitor class template EvaluatedExprVisitor, which only visits the potentially-evaluated subexpressions of an expression. I bet this would have been useful for noexcept... Fixes PR5810 and PR8127. llvm-svn: 113700
* Eliminate the comma locations from all of the Sema routines that dealDouglas Gregor2010-09-091-1/+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 a comma is missing between enumerators in anDouglas Gregor2010-09-071-0/+8
| | | | | | enumeration definition. Fixes <rdar://problem/7159693>. llvm-svn: 113201
* Add symantic support for the Pascal calling convention viaDawn Perchik2010-09-031-10/+47
| | | | | | | "__attribute((pascal))" or "__pascal" (and "_pascal" under -fborland-extensions). Support still needs to be added to llvm. llvm-svn: 112939
* Enable inline namespaces in C++03 as an extension.Sebastian Redl2010-08-311-2/+2
| | | | llvm-svn: 112566
* Parser support for inline namespacesSebastian Redl2010-08-271-0/+11
| | | | llvm-svn: 112320
* Suggest "const" and "volatile" code completions after a functionDouglas Gregor2010-08-271-0/+5
| | | | | | declarator, the very definition of "low-hanging fruit". llvm-svn: 112274
* One who seeks knowledge learns something new every day.John McCall2010-08-261-16/+16
| | | | | | | | | 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
* Reformatting.John McCall2010-08-251-3/+3
| | | | llvm-svn: 112018
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-12/+12
| | | | | | | 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-30/+32
| | | | llvm-svn: 111901
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-2/+2
| | | | llvm-svn: 111863
* Introduce a new code-completion point when we're parsing aDouglas Gregor2010-08-231-15/+34
| | | | | | | | | declarator. Here, we can only see a few things (e.g., cvr-qualifiers, nested name specifiers) and we do not want to provide other non-macro completions. Previously, we would end up in recovery mode and would provide a large number of non-relevant completions. llvm-svn: 111818
* When complaining about a duplicate declspec, provide a Fix-It thatDouglas Gregor2010-08-231-1/+6
| | | | | | | removes the copy. Patch from Eelis van der Weegen, tweaked/updated by me. llvm-svn: 111807
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-5/+5
| | | | llvm-svn: 111795
* DeclPtrTy -> Decl *John McCall2010-08-211-46/+45
| | | | llvm-svn: 111733
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-2/+2
| | | | | | | | | - 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
* Get rid of extra nesting when checking for invalid type,Fariborz Jahanian2010-08-171-5/+5
| | | | | | per Doug's comment. llvm-svn: 111328
OpenPOWER on IntegriCloud