summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* PR21437, final part of DR1330: delay-parsing of exception-specifications. ThisRichard Smith2014-11-135-11/+161
| | | | | | | is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang). llvm-svn: 221918
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-111-2/+1
| | | | | | | | | For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 llvm-svn: 221663
* Fix parsing of fold-expressions within a cast expression. We parse theRichard Smith2014-11-111-5/+11
| | | | | | | parenthesized expression a bit differently in this case, just in case the commas have special meaning. llvm-svn: 221661
* Improve diagnostics if _Noreturn is placed after a function declarator. ↵Richard Smith2014-11-101-1/+22
| | | | | | (This sometimes happens when a macro is used that expands to either the GNU noreturn attribute or _Noreturn.) llvm-svn: 221630
* Updated the wording for a diagnostic to be more grammatically correct, and ↵Aaron Ballman2014-11-082-2/+7
| | | | | | use a %select. Also ensure that nested namespace definitions are diagnosed properly. Both changes are motivated by post-commit feedback from r221580. llvm-svn: 221581
* [c++1z] Support for attributes on namespaces and enumerators.Aaron Ballman2014-11-082-9/+20
| | | | llvm-svn: 221580
* [c++1z] Support for u8 character literals.Richard Smith2014-11-082-0/+2
| | | | llvm-svn: 221576
* [c++1z] Implement nested-namespace-definitions.Richard Smith2014-11-081-19/+18
| | | | | | | | | | | | | This allows 'namespace A::B { ... }' as a shorthand for 'namespace A { namespace B { ... } }'. We already supported this correctly for error recovery; promote that support to a full implementation. This is not the right implementation: we do not maintain source fidelity because we desugar the nested namespace definition in the parser. This is tricky to avoid, since the definition genuinely does inject one named entity per level in the namespace name. llvm-svn: 221574
* [c++1z] N4295: fold-expressions.Richard Smith2014-11-081-2/+81
| | | | | | | | | | | | | | | | This is a new form of expression of the form: (expr op ... op expr) where one of the exprs is a parameter pack. It expands into (expr1 op (expr2onwards op ... op expr)) (and likewise if the pack is on the right). The non-pack operand can be omitted; in that case, an empty pack gives a fallback value or an error, depending on the operator. llvm-svn: 221573
* Patch for small addition to availability attribute.Fariborz Jahanian2014-11-051-0/+13
| | | | | | | | | This is to accept "NA" in place of vesion number for availability attribute. Used on introduced=NA to mean unavailable and deprecated=NA to mean nothing (not deprecated). rdar://18804883 llvm-svn: 221417
* Filter out non-static class members when correcting non-member-references.Kaelyn Takata2014-11-051-7/+23
| | | | llvm-svn: 221319
* Remove a couple typedefs for things in the clang namespace with the same ↵Craig Topper2014-10-312-6/+6
| | | | | | name. Remove a typedef that matches an identical one in the clang namespace. llvm-svn: 220954
* Remove the last couple uses of the ExprArg(just Expr*) typedef in Parser.Craig Topper2014-10-302-2/+2
| | | | llvm-svn: 220897
* PR21367: Don't accept rvalue references as an extension in C++98 mode if ↵Richard Smith2014-10-281-5/+17
| | | | | | we're in a new-type-id or conversion-type-id, since those things can legitimately be followed by a binary && operator. llvm-svn: 220785
* Pass around CorrectionCandidateCallbacks as unique_ptrs soKaelyn Takata2014-10-274-15/+15
| | | | | | TypoCorrectionConsumer can keep the callback around as long as needed. llvm-svn: 220693
* Add frontend support for __vectorcallReid Kleckner2014-10-242-9/+29
| | | | | | | | | | | | | Wire it through everywhere we have support for fastcall, essentially. This allows us to parse the MSVC "14" CTP headers, but we will miscompile them because LLVM doesn't support __vectorcall yet. Reviewed By: Aaron Ballman Differential Revision: http://reviews.llvm.org/D5808 llvm-svn: 220573
* Parse: Ignore "long" and "short" in #pragma sectionDavid Majnemer2014-10-221-1/+15
| | | | | | This fixes PR21337. llvm-svn: 220429
* Reland r219810 "Fix late template parsing leak with incremental processing"Reid Kleckner2014-10-221-1/+11
| | | | | | | | | | | | | | Original message: Add a second late template parser callback meant to cleanup any resources allocated by late template parsing. Call it from the Sema::ActOnEndOfTranslationUnit method after all pending template instantiations have been completed. Teach Parser::ParseTopLevelDecl to install the cleanup callback when incremental processing is enabled so that Parser::TemplateIds can be freed. Patch by Brad King! llvm-svn: 220400
* Remove unused StmtVector& parameters from declaration parsing functions.Rafael Espindola2014-10-223-18/+11
| | | | | | Patch by Eelis van der Weegen! llvm-svn: 220387
* Add RestrictQualifierLoc to DeclaratorChunk::FunctionTypeInfoHal Finkel2014-10-203-0/+6
| | | | | | | | | | | | | | Clang supports __restrict__ as a function qualifier, but DeclaratorChunk::FunctionTypeInfo lacked a field to track the qualifier's source location (as we do with volatile, etc.). This was the subject of a FIXME in GetFullTypeForDeclarator (in SemaType.cpp). This should also prove useful as we add more warnings regarding questionable uses of the restrict qualifier. There is no significant functional change (except for an improved source range associated with the err_invalid_qualified_function_type diagnostic fixit generated by GetFullTypeForDeclarator). llvm-svn: 220215
* MS Compat: mark globals emitted in read-only sections constHans Wennborg2014-10-161-13/+14
| | | | | | | | | | | | | | | | | | | | They cannot be written to, so marking them const makes sense and may improve optimisation. As a side-effect, SectionInfos has to be moved from Sema to ASTContext. It also fixes this problem, that occurs when compiling ATL: warning LNK4254: section 'ATL' (C0000040) merged into '.rdata' (40000040) with different attributes The ATL headers are putting variables in a special section that's marked read-only. However, Clang currently can't model that read-onlyness in the IR. But, by making the variables const, the section does become read-only, and the linker warning is avoided. Differential Revision: http://reviews.llvm.org/D5812 llvm-svn: 219960
* Revert "Fix late template parsing leak with incremental processing"Reid Kleckner2014-10-151-11/+1
| | | | | | | | This reverts commit r219810. The test suite appears broken. llvm-svn: 219813
* Fix late template parsing leak with incremental processingReid Kleckner2014-10-151-1/+11
| | | | | | | | | | | | | Add a second late template parser callback meant to cleanup any resources allocated by late template parsing. Call it from the Sema::ActOnEndOfTranslationUnit method after all pending template instantiations have been completed. Teach Parser::ParseTopLevelDecl to install the cleanup callback when incremental processing is enabled so that Parser::TemplateIds can be freed. Patch by Brad King! llvm-svn: 219810
* Be smarter when parsing variable declarations with unknown types.Kaelyn Takata2014-10-141-1/+4
| | | | | | | | | Specifically, avoid typo-correcting the variable name into a type before typo-correcting the actual type name in the declaration. Doing so results in a very unpleasant cascade of errors, with the typo correction of the actual type name being buried in the middle. llvm-svn: 219732
* Fixed a problem in r19589.Tyler Nowicki2014-10-121-2/+2
| | | | | | Several systems failed to compile the array allocation of the TokenArray. llvm-svn: 219590
* Allow constant expressions in pragma loop hints.Tyler Nowicki2014-10-121-47/+96
| | | | | | | | Previously loop hints such as #pragma loop vectorize_width(#) required a constant. This patch allows a constant expression to be used as well. Such as a non-type template parameter or an expression (2 * c + 1). Reviewed by Richard Smith llvm-svn: 219589
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-091-2/+4
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219385
* Revert "[OPENMP] 'omp teams' directive basic support. Includes parsing and ↵Renato Golin2014-10-081-4/+2
| | | | | | | | | semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive." This reverts commit r219197 because it broke ARM self-hosting buildbots with segmentation fault errors in many tests. llvm-svn: 219289
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-071-2/+4
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219197
* Patch to wrap up '_' as separator in version numbersFariborz Jahanian2014-10-061-2/+2
| | | | | | | | | in availability attribute by preserving this info. in VersionTuple and using it in pretty printing of attributes and yet using '.' as separator when diagnosing unavailable message calls. rdar://18490958 llvm-svn: 219124
* PR20991: ::decltype is not valid.Richard Smith2014-10-041-1/+2
| | | | llvm-svn: 219043
* Initialize MCObjectFileInfo when parsing ms-style asm.Benjamin Kramer2014-10-031-0/+2
| | | | | | | Otherwise we're left with an half-initialized bag of variables that may or may not explode later on. Should bring the MSVC buildbot back to life. llvm-svn: 219023
* Add comment about separators must match inFariborz Jahanian2014-10-031-0/+1
| | | | | | version numbers. llvm-svn: 218993
* Diagnose mixed use of '_' and '.' as versionFariborz Jahanian2014-10-021-2/+7
| | | | | | separators in my previous patch. llvm-svn: 218895
* Patch to accept '_' in addition to '.' as versionFariborz Jahanian2014-10-021-3/+8
| | | | | | | number separator in "availability" attribute. rdar://18490958 llvm-svn: 218884
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-266-8/+30
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. llvm-svn: 218484
* Suggest fix-it for missing '{' after base-clauseIsmail Pazarbasi2014-09-251-6/+36
| | | | llvm-svn: 218468
* Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs.Nico Weber2014-09-242-2/+68
| | | | | | | | | r218292 reverted r197496 because it broke things. In addition to breaking things, r197496 also made all traits starting with __is_ revertible. Reinstantiate that part of r197496 because code out there (e.g. libc++) depends on this behavior. Fixes PR21045. llvm-svn: 218365
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-231-1/+4
| | | | llvm-svn: 218299
* Revert r197496, as it broke REVERTIBLE_TYPE_TRAITs from PCH files.Nico Weber2014-09-233-37/+70
| | | | | | Also add a test to make sure that this doesn't break again. Fixes PR21036. llvm-svn: 218292
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-221-4/+18
| | | | | | | | | | | | | | | | Summary: This fixes PR20023. In order to implement this scoping rule, we piggy back on the existing LabelDecl machinery, by creating LabelDecl's that will carry the "internal" name of the inline assembly label, which we will rewrite the asm label to. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4589 llvm-svn: 218230
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-191-2/+4
| | | | llvm-svn: 218110
* Parsing/Sema of directive omp for simdAlexander Musman2014-09-181-13/+23
| | | | llvm-svn: 218029
* Don't crash on access decls with invalid scope specifier, PR20887.Nico Weber2014-09-101-0/+5
| | | | llvm-svn: 217472
* Add error, recovery and fixit for "~A::A() {...}".Richard Smith2014-09-061-2/+21
| | | | llvm-svn: 217302
* Parse: Replace polymorphic functor objects with lambdas and llvm::function_ref.Benjamin Kramer2014-09-033-125/+63
| | | | | | No change in functionality. llvm-svn: 217025
* Update for LLVM api change.Rafael Espindola2014-08-271-2/+2
| | | | llvm-svn: 216585
* PR20760: Don't assert (and produce better diagnostics) if a default initializerRichard Smith2014-08-272-20/+30
| | | | | | contains an unmatched closing bracket token. llvm-svn: 216518
* Update Clang for LLVM API change to use unique_ptr in ↵David Blaikie2014-08-211-3/+3
| | | | | | SourceManager::AddNewSourceBuffer llvm-svn: 216226
* C++1y is now C++14!Aaron Ballman2014-08-194-5/+5
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
OpenPOWER on IntegriCloud