summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTentative.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-0/+5
| | | | | | | | committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330
* Add support for alignment-specifiers in C1X and C++11, removePeter Collingbourne2011-09-291-0/+4
| | | | | | | support for the C++0x draft [[align]] attribute and add the C1X standard header file stdalign.h llvm-svn: 140796
* Modules: introduce the __module_private__ declaration specifier, whichDouglas Gregor2011-09-091-3/+6
| | | | | | | indicates that a declaration is only visible within the module it is declared in. llvm-svn: 139348
* Add support for Microsoft __ptr32 keyword. Francois Pichet2011-08-251-0/+1
| | | | | | Patch by Chris Cudmore! llvm-svn: 138533
* Add support for MSVC __unaligned attribute. Necessary to parse MSVC headers ↵Francois Pichet2011-08-181-1/+4
| | | | | | | | in 64-bit mode (ie: when _M_IA64 or _M_AMD64 is defined) more info: http://msdn.microsoft.com/en-us/library/ms177389.aspx llvm-svn: 137935
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-0/+6
| | | | llvm-svn: 136210
* Introduce DelayedCleanupPool useful for simplifying clean-up of certain ↵Argyrios Kyrtzidis2011-06-221-2/+1
| | | | | | | | | | resources that, while their lifetime is well-known and restricted, cleaning them up manually is easy to miss and cause a leak. Use it to plug the leaking of TemplateIdAnnotation objects. rdar://9634138. llvm-svn: 133610
* Implement __underlying_type for libc++.Alexis Hunt2011-05-191-0/+5
| | | | llvm-svn: 131633
* Implement the __is_trivially_copyable type traitAlexis Hunt2011-05-131-0/+1
| | | | llvm-svn: 131270
* Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin ↵Francois Pichet2011-04-281-0/+2
| | | | | | | | | | | | | | defines to real types. Otherwise statements like: __int64 var = __int64(0); would be expanded to: long long var = long long(0); and fail to compile. llvm-svn: 130369
* Add support for '__is_literal_type' spelling of the existingChandler Carruth2011-04-241-0/+1
| | | | | | | | '__is_literal' type trait for GCC compatibility. At least one relased version if libstdc++ uses this name for the trait despite it not being documented anywhere. llvm-svn: 130078
* Implement basic __is_trivial type-trait support, enough to close PR9472.Chandler Carruth2011-04-231-0/+1
| | | | | | | | | | | | | | | | | | This introduces a few APIs on the AST to bundle up the standard-based logic so that programmatic clients have access to exactly the same behavior. There is only one serious FIXME here: checking for non-trivial move constructors and move assignment operators. Those bits need to be added to the declaration and accessors provided. This implementation should be enough for the uses of __is_trivial in libstdc++ 4.6's C++98 library implementation. Ideas for more thorough test cases or any edge cases missing would be appreciated. =D llvm-svn: 130057
* Sort the type traits in a few places where they weren't previouslyChandler Carruth2011-04-231-1/+1
| | | | | | sorted in order to prepare for adding some new ones. llvm-svn: 130056
* C1X: implement static assertsPeter Collingbourne2011-04-151-0/+1
| | | | llvm-svn: 129555
* Insomniac refactoring: change how the parser allocates attributes so thatJohn McCall2011-03-241-1/+1
| | | | | | | | | AttributeLists do not accumulate over the lifetime of parsing, but are instead reused. Also make the arguments array not require a separate allocation, and make availability attributes store their stuff in augmented memory, too. llvm-svn: 128209
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-0/+10
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Push nested-name-specifier source-location information into dependentDouglas Gregor2011-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | template specialization types. This also required some parser tweaks, since we were losing track of the nested-name-specifier's source location information in several places in the parser. Other notable changes this required: - Sema::ActOnTagTemplateIdType now type-checks and forms the appropriate type nodes (+ source-location information) for an elaborated-type-specifier ending in a template-id. Previously, we used a combination of ActOnTemplateIdType and ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped around a DependentTemplateSpecializationType, which duplicated the keyword ("class", "struct", etc.) and nested-name-specifier storage. - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which it places into the returned type-source location information. - Sema::ActOnDependentTag now creates types with source-location information. llvm-svn: 126808
* Implement the Microsoft __is_convertible_to type trait, modeling theDouglas Gregor2011-01-271-0/+1
| | | | | | | | | | semantics after the C++0x is_convertible type trait. This implementation is not 100% complete, because it allows access errors to be hard errors (rather than just evaluating false). Original patch by Steven Watanabe! llvm-svn: 124425
* Rvalue references for *this: tentative parsing and template argument deduction.Douglas Gregor2011-01-261-0/+4
| | | | llvm-svn: 124295
* Add some tests for reference-collapsing and referencing bindingDouglas Gregor2011-01-201-0/+2
| | | | | | | | | involving rvalue references, to start scoping out what is and what isn't implemented. In the process, tweak some standards citations, type desugaring, and teach the tentative parser about && in ptr-operator. llvm-svn: 123913
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-3/+0
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-2/+2
| | | | | | | 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-4/+11
| | | | | | | | | | | | 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
* Handle parameter attributes when tentative parsing for function/variable ↵Argyrios Kyrtzidis2010-12-081-4/+9
| | | | | | | | disambiguation. Fixes rdar://8739801. llvm-svn: 121228
* After parsing a ':' in an enum-specifier within class context,Douglas Gregor2010-12-011-0/+110
| | | | | | | | | | 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
* Teach the C++ simple-type-specifier parser and tentative parses aboutDouglas Gregor2010-10-211-7/+68
| | | | | | 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/+3
| | | | | | skipped and not inserted into the AST for now. llvm-svn: 116203
* enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!Chris Lattner2010-09-281-1/+6
| | | | llvm-svn: 115004
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-161-0/+3
| | | | | | | | | | | | | | | | 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
* Add symantic support for the Pascal calling convention viaDawn Perchik2010-09-031-0/+4
| | | | | | | "__attribute((pascal))" or "__pascal" (and "_pascal" under -fborland-extensions). Support still needs to be added to llvm. llvm-svn: 112939
* ObjClang++: Allow declaration of block variable in a collectionFariborz Jahanian2010-08-291-1/+7
| | | | | | statement header (fixes radar 8295106). llvm-svn: 112443
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-1/+1
| | | | | | | | | - 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
* When we're performing tentative parsing to determine whether theDouglas Gregor2010-07-151-15/+8
| | | | | | | | | | | | | | | | parser is looking at a declaration or an expression, use a '=' to conclude that we are parsing a declaration. This is wrong. However, our previous approach of finding a comma after the '=' is also wrong, because the ',' could be part of a template-argument-list. So, for now we're going to use the same wrong heuristic as GCC and Visual C++, because less real-world code is likely to be broken this way. I've opened PR7655 to keep track of our wrongness; note also the XFAIL'd test. Fixes <rdar://problem/8193163>. llvm-svn: 108459
* Add support for Microsoft's __thiscall, from Steven Watanabe!Douglas Gregor2010-05-181-0/+1
| | | | llvm-svn: 104026
* Fix a tentative-parse error with unqualified template ids in cast expressions.John McCall2010-04-301-0/+13
| | | | | | Also resolve a long-working FIXME in the test case I modified. llvm-svn: 102688
* Fix an assertion-on-error during tentative constructor parsing byJohn McCall2010-02-261-8/+11
| | | | | | | | | | propagating error conditions out of the various annotate-me-a-snowflake routines. Generally (but not universally) removes redundant diagnostics as well as, you know, not crashing on bad code. On the other hand, I have just signed myself up to fix fiddly parser errors for the next week. Again. llvm-svn: 97221
* First stage of adding AltiVec supportJohn Thompson2010-02-051-0/+9
| | | | llvm-svn: 95335
* eliminate a call to NextToken() when parsing ::fooChris Lattner2009-12-191-5/+6
| | | | llvm-svn: 91738
* Teach TryAnnotateTypeOrScopeToken to deal with already-annotatedJohn McCall2009-12-191-4/+10
| | | | | | | scope specifiers. Fix a tentative parsing bug that came up in LLVM. Incidentally fixes some random FIXMEs in an existing testcase. llvm-svn: 91734
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-3/+85
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Parse C++0x constexpr. Test case follows when this does something useful.Sebastian Redl2009-11-051-0/+3
| | | | llvm-svn: 86135
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-7/+7
| | | | llvm-svn: 81346
* Improve support for out-of-line definitions of nested templates andDouglas Gregor2009-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | their members, including member class template, member function templates, and member classes and functions of member templates. To actually parse the nested-name-specifiers that qualify the name of an out-of-line definition of a member template, e.g., template<typename X> template<typename Y> X Outer<X>::Inner1<Y>::foo(Y) { return X(); } we need to look for the template names (e.g., "Inner1") as a member of the current instantiation (Outer<X>), even before we have entered the scope of the current instantiation. Since we can't do this in general (i.e., we should not be looking into all dependent nested-name-specifiers as if they were the current instantiation), we rely on the parser to tell us when it is parsing a declaration specifier sequence, and, therefore, when we should consider the current scope specifier to be a current instantiation. Printing of complicated, dependent nested-name-specifiers may be somewhat broken by this commit; I'll add tests for this issue and fix the problem (if it still exists) in a subsequent commit. llvm-svn: 80044
* Consider nested-names as part of the declarator when resolving an ambiguous ↵Argyrios Kyrtzidis2009-07-211-1/+5
| | | | | | statement. llvm-svn: 76583
* Basic support for C++0x unicode types. Support for literals will follow in ↵Alisdair Meredith2009-07-141-0/+2
| | | | | | an incremental patch llvm-svn: 75622
* Parse the C++0x decltype specifier.Anders Carlsson2009-06-241-1/+6
| | | | llvm-svn: 74086
* Add more parser support for Microsoft extensions.Eli Friedman2009-06-081-1/+4
| | | | llvm-svn: 73101
* Handle correctly a very ugly part of the C++ syntax. We cannot disambiguate ↵Argyrios Kyrtzidis2009-05-221-6/+12
| | | | | | | | | | | | | | between a parenthesized type-id and a paren expression without considering the context past the parentheses. Behold: (T())x; - type-id (T())*x; - type-id (T())/x; - expression (T()); - expression llvm-svn: 72260
* Initial implementation of parsing, semantic analysis, and templateDouglas Gregor2009-03-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | instantiation for C++ typename-specifiers such as typename T::type The parsing of typename-specifiers is relatively easy thanks to annotation tokens. When we see the "typename", we parse the typename-specifier and produce a typename annotation token. There are only a few places where we need to handle this. We currently parse the typename-specifier form that terminates in an identifier, but not the simple-template-id form, e.g., typename T::template apply<U, V> Parsing of nested-name-specifiers has a similar problem, since at this point we don't have any representation of a class template specialization whose template-name is unknown. Semantic analysis is only partially complete, with some support for template instantiation that works for simple examples. llvm-svn: 67875
* Fix rdar://6719156 - clang should emit a better error when blocks are ↵Chris Lattner2009-03-271-3/+2
| | | | | | | | | disabled but are used anyway by changing blocks from being disabled in the parser to being disabled in Sema. llvm-svn: 67816
OpenPOWER on IntegriCloud