summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* [ObjC] Implement @available in the Parser and ASTErik Pilkington2016-07-162-0/+18
| | | | | | | | | | | | | | | | This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the Parser and Sema to generate it. This node represents an availability check of the form: @available(macos 10.10, *); Which will eventually compile to a runtime check of the host's OS version. This is the first patch of the feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential Revision: https://reviews.llvm.org/D22171 llvm-svn: 275654
* Revert r275481, r275490. This broke modules bootstrap.Richard Smith2016-07-153-100/+9
| | | | llvm-svn: 275624
* [AST] Keep track of the left brace source location of a tag decl.Argyrios Kyrtzidis2016-07-153-4/+6
| | | | | | This is useful for source modification tools. There will be a follow-up commit using it. llvm-svn: 275590
* [modules] Don't pass interesting decls to the consumer for a module file that'sRichard Smith2016-07-143-9/+100
| | | | | | | | | | | passed on the command line but never actually used. We consider a (top-level) module to be used if any part of it is imported, either by the current translation unit, or by any part of a top-level module that is itself used. (Put another way, a module is used if an implicit modules build would have loaded its .pcm file.) llvm-svn: 275481
* [OpenMP] Sema and parsing for 'target parallel for simd' pragmaKelvin Li2016-07-142-0/+19
| | | | | | | | This patch is to implement sema and parsing for 'target parallel for simd' pragma. Differential Revision: http://reviews.llvm.org/D22096 llvm-svn: 275365
* P0305R0: Semantic analysis and code generation for C++17 init-statement for ↵Richard Smith2016-07-142-0/+4
| | | | | | | | | | 'if' and 'switch': if (stmt; condition) { ... } Patch by Anton Bikineev! Some minor formatting and comment tweets by me. llvm-svn: 275350
* [PCH/preamble] Make sure that if the preamble/PCH was serialized with errors ↵Argyrios Kyrtzidis2016-07-132-1/+9
| | | | | | | | | | that we set diagnostic engine state appropriately. Otherwise there can be a crash with CFG analysis warnings doing work on invalid AST. Fixes crash of rdar://26224134 llvm-svn: 275313
* [OpenMP] Initial implementation of parse+sema for OpenMP clause ↵Carlo Bertolli2016-07-132-0/+22
| | | | | | | | 'is_device_ptr' of target http://reviews.llvm.org/D22070 llvm-svn: 275282
* [OpenMP] Initial implementation of parse+sema for clause use_device_ptr of ↵Carlo Bertolli2016-07-132-0/+22
| | | | | | | | | | | | | | 'target data' http://reviews.llvm.org/D21904 This patch is similar to the implementation of 'private' clause: it adds a list of private pointers to be used within the target data region to store the device pointers returned by the runtime. Please refer to the following document for a full description of what the runtime witll return in this case (page 10 and 11): https://github.com/clang-omp/OffloadingDesign I am happy to answer any question related to the runtime interface to help reviewing this patch. llvm-svn: 275271
* [PCH] Fix timestamp check on windows hosts.Pierre Gousseau2016-07-131-9/+0
| | | | | | | | | | | | | | | On Linux, if the timestamp of a header file, included in the pch, is modified, then including the pch without regenerating it causes a fatal error, which is reasonable. On Windows the check is ifdefed out, allowing the compilation to continue in a broken state. The root of the broken state is that, if timestamps dont match, the preprocessor will reparse a header without discarding the pch data. This leads to "#pragma once" header to be included twice. The reason behind the ifdefing of the check lacks documentation, and was done 6 years ago. This change tentatively removes the ifdefing. First part of patch proposed at: Differential Revision: http://reviews.llvm.org/D20867 llvm-svn: 275261
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-071-5/+3
| | | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. llvm-svn: 274732
* [OpenMP] Sema and parsing for 'distribute simd' pragmaKelvin Li2016-07-062-0/+19
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute simd'. Differential Revision: http://reviews.llvm.org/D22007 llvm-svn: 274604
* [OpenMP] Sema and parse for 'distribute parallel for simd'Kelvin Li2016-07-052-0/+20
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute parallel for simd'. Differential Revision: http://reviews.llvm.org/D21977 llvm-svn: 274530
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-031-9/+6
| | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. llvm-svn: 274475
* [Feature] Add a builtin for indexing into parameter packs. Patch by Louis ↵Eric Fiselier2016-07-012-0/+5
| | | | | | | | | | | | | Dionne. This patch adds a __nth_element builtin that allows fetching the n-th type of a parameter pack with very little compile-time overhead. The patch was inspired by r252036 and r252115 by David Majnemer, which add a similar __make_integer_seq builtin for efficiently creating a std::integer_sequence. Reviewed as D15421. http://reviews.llvm.org/D15421 llvm-svn: 274316
* P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:Richard Smith2016-06-286-6/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace inheriting constructors implementation with new approach, voted into C++ last year as a DR against C++11. Instead of synthesizing a set of derived class constructors for each inherited base class constructor, we make the constructors of the base class visible to constructor lookup in the derived class, using the normal rules for using-declarations. For constructors, UsingShadowDecl now has a ConstructorUsingShadowDecl derived class that tracks the requisite additional information. We create shadow constructors (not found by name lookup) in the derived class to model the actual initialization, and have a new expression node, CXXInheritedCtorInitExpr, to model the initialization of a base class from such a constructor. (This initialization is special because it performs real perfect forwarding of arguments.) In cases where argument forwarding is not possible (for inalloca calls, variadic calls, and calls with callee parameter cleanup), the shadow inheriting constructor is not emitted and instead we directly emit the initialization code into the caller of the inherited constructor. Note that this new model is not perfectly compatible with the old model in some corner cases. In particular: * if B inherits a private constructor from A, and C uses that constructor to construct a B, then we previously required that A befriends B and B befriends C, but the new rules require A to befriend C directly, and * if a derived class has its own constructors (and so its implicit default constructor is suppressed), it may still inherit a default constructor from a base class llvm-svn: 274049
* Resubmission of http://reviews.llvm.org/D21564 after fixes.Carlo Bertolli2016-06-272-0/+26
| | | | | | | | | | | | | [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' This patch is an initial implementation for #distribute parallel for. The main differences that affect other pragmas are: The implementation of 'distribute parallel for' requires blocking of the associated loop, where blocks are "distributed" to different teams and iterations within each block are scheduled to parallel threads within each team. To implement blocking, sema creates two additional worksharing directive fields that are used to pass the team assigned block lower and upper bounds through the outlined function resulting from 'parallel'. In this way, scheduling for 'for' to threads can use those bounds. As a consequence of blocking, the stride of 'distribute' is not 1 but it is equal to the blocking size. This is returned by the runtime and sema prepares a DistIncrExpr variable to hold that value. As a consequence of blocking, the global upper bound (EnsureUpperBound) expression of the 'for' is not the original loop upper bound (e.g. in for(i = 0 ; i < N; i++) this is 'N') but it is the team-assigned block upper bound. Sema creates a new expression holding the calculation of the actual upper bound for 'for' as UB = min(UB, PrevUB), where UB is the loop upper bound, and PrevUB is the team-assigned block upper bound. llvm-svn: 273884
* Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives aRichard Smith2016-06-252-0/+7
| | | | | | | variable weak discardable linkage and partially-ordered initialization, and is implied for constexpr static data members.) llvm-svn: 273754
* Revert r273705Carlo Bertolli2016-06-242-26/+0
| | | | | | [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' llvm-svn: 273709
* [OpenMP] Initial implementation of parse and sema for composite pragma ↵Carlo Bertolli2016-06-242-0/+26
| | | | | | | | | | | | | | | 'distribute parallel for' http://reviews.llvm.org/D21564 This patch is an initial implementation for #distribute parallel for. The main differences that affect other pragmas are: The implementation of 'distribute parallel for' requires blocking of the associated loop, where blocks are "distributed" to different teams and iterations within each block are scheduled to parallel threads within each team. To implement blocking, sema creates two additional worksharing directive fields that are used to pass the team assigned block lower and upper bounds through the outlined function resulting from 'parallel'. In this way, scheduling for 'for' to threads can use those bounds. As a consequence of blocking, the stride of 'distribute' is not 1 but it is equal to the blocking size. This is returned by the runtime and sema prepares a DistIncrExpr variable to hold that value. As a consequence of blocking, the global upper bound (EnsureUpperBound) expression of the 'for' is not the original loop upper bound (e.g. in for(i = 0 ; i < N; i++) this is 'N') but it is the team-assigned block upper bound. Sema creates a new expression holding the calculation of the actual upper bound for 'for' as UB = min(UB, PrevUB), where UB is the loop upper bound, and PrevUB is the team-assigned block upper bound. llvm-svn: 273705
* Use even more ArrayRefsDavid Majnemer2016-06-241-3/+2
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273650
* Use more ArrayRefsDavid Majnemer2016-06-241-2/+2
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273647
* Implement p0292r2 (constexpr if), a likely C++1z feature.Richard Smith2016-06-232-0/+2
| | | | llvm-svn: 273602
* Use ranges to concisely express iterationDavid Majnemer2016-06-232-21/+19
| | | | | | | No functional change is intended, this should just clean things up a little. llvm-svn: 273522
* Re-commit "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-212-1/+3
| | | | | | | | | | MaterializeTemporaryExpr." Since D21243 fixes relative clang-tidy tests. This reverts commit a71d9fbd41e99def9159af2b01ef6509394eaeed. llvm-svn: 273312
* [modules] Allow emission of update records for predefined __va_list_tag.Vassil Vassilev2016-06-201-4/+0
| | | | | | | | | | | Handles the cases where old __va_list_tag is coming from a module and the new is not, needing an update record. Fixes https://llvm.org/bugs/show_bug.cgi?id=27890 Patch by Cristina Cristescu, Richard Smith and me. llvm-svn: 273159
* Revert accidential "[MSVC] Late parsing of in-class defined member functions ↵Alexey Bataev2016-06-152-32/+0
| | | | | | | | in template" This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a. llvm-svn: 272776
* [MSVC] Late parsing of in-class defined member functions in templateAlexey Bataev2016-06-152-0/+32
| | | | | | | | | | | | | | | | | | | classes. MSVC actively uses unqualified lookup in dependent bases, lookup at the instantiation point (non-dependent names may be resolved on things declared later) etc. and all this stuff is the main cause of incompatibility between clang and MSVC. Clang tries to emulate MSVC behavior but it may fail in many cases. clang could store lexed tokens for member functions definitions within ClassTemplateDecl for later parsing during template instantiation. It will allow resolving many possible issues with lookup in dependent base classes and removing many already existing MSVC-specific hacks/workarounds from the clang code. llvm-svn: 272774
* Revert "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-092-3/+1
| | | | | | | | | MaterializeTemporaryExpr." This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
* [Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr.Tim Shen2016-06-092-1/+3
| | | | | | | | | | | These ExprWithCleanups are added for holding a RunCleanupsScope not for destructor calls; rather, they are for lifetime marks. This requires ExprWithCleanups to keep a bit to indicate whether it have cleanups with side effects (e.g. dtor calls). Differential Revision: http://reviews.llvm.org/D20498 llvm-svn: 272296
* PCH + module: make sure we write out macros associated with builtin identifiers.Manman Ren2016-05-311-24/+23
| | | | | | | | | | | | | | | | | | | | | | When we import a module that defines a builtin identifier from prefix header and precompile the prefix header, the macro information related to the identifier is lost. If we don't precompile the prefix header, the source file can still see the macro information. The reason is that we write out the identifier in the pch but not the macro information since the macro is not defined locally. This is related to r251565. In that commit, if we read a builtin identifier from a module that wasn't "interesting" to that module, we will still write it out to a PCH that imports that module. The fix is to write exported module macros for PCH as well. rdar://24666630 Differential Revision: http://reviews.llvm.org/D20383 llvm-svn: 271310
* [OpenMP] Parsing and sema support for the from clauseSamuel Antao2016-05-262-0/+73
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `from` clause. Patch based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18488 llvm-svn: 270882
* [OpenMP] Parsing and sema support for the to clauseSamuel Antao2016-05-262-0/+73
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `to` clause. Patch based on the original post by Kelvin Li. Reviewers: carlo.bertolli, hfinkel, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18597 llvm-svn: 270880
* [OpenMP] Parsing and sema support for target update directiveSamuel Antao2016-05-262-0/+18
| | | | | | | | | | | | | | | Summary: This patch is to add parsing and sema support for `target update` directive. Support for the `to` and `from` clauses will be added by a different patch. This patch also adds support for other clauses that are already implemented upstream and apply to `target update`, e.g. `device` and `if`. This patch is based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D15944 llvm-svn: 270878
* [OPENMP 4.5] Codegen for dacross loop synchronization constructs.Alexey Bataev2016-05-252-0/+4
| | | | | | | OpenMP 4.5 adds support for doacross loop synchronization. Patch implements codegen for this construct. llvm-svn: 270690
* PR27754: CXXRecordDecl::data() needs to perform an update even if it's calledRichard Smith2016-05-171-10/+10
| | | | | | on a declaration that already knows the location of the DefinitionData object. llvm-svn: 269858
* Update identifiers as needed when loading macros from serialized ASTs.Sean Callanan2016-05-141-2/+5
| | | | | | | | | | | This is essential for iterating across macros properly, which LLDB does when loading macros from modules. A naiver version of this patch (without the conditional) caused assertion failures in the testsuite, but this version should be safe. Thanks to Ben Langmuir for the refinement that made this work. llvm-svn: 269554
* Add support for derived class special members hiding functions brought in fromRichard Smith2016-05-132-0/+6
| | | | | | | | | a base class via a using-declaration. If a class has a using-declaration declaring either a constructor or an assignment operator, eagerly declare its special members in case they need to displace a shadow declaration from a using-declaration. llvm-svn: 269398
* [OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5Dmitry Polukhin2016-05-092-7/+5
| | | | | | | | | | | | | | | | | Support OpenMP version 4.5 syntax for #pragma omp declare target. Syntax: #pragma omp declare target (extended-list) new-line or #pragma omp declare target clause[ [,] clause ... ] new-line Where clause is one of the following: to(extended-list) link(list) Differential Revision: http://reviews.llvm.org/D20011 llvm-svn: 268925
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-092-0/+6
| | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. llvm-svn: 268898
* [modules] Attempt to improve performance for declaration merging without a SemaRichard Smith2016-05-062-5/+9
| | | | | | | | | | object in C. Rather than using the DeclContext (which is very slow because it triggers us to build a lookup table for the DeclContext), use a separate map from identifiers to decls for this case, containing only the ones we've actually deserialized. For convenience, this map is implemented as an IdentifierResolver. llvm-svn: 268817
* Fix CodeCompletion & TypoCorrection when combining a PCH with ModulesBen Langmuir2016-05-041-12/+49
| | | | | | | | | | | | | | This commit fixes the IdentifierIterator to actually include identifiers from a PCH or precompiled preamble when there is also a global module index. This was causing code-completion (outside of C++) and typo-correction to be missing global identifiers defined in the PCH/preamble. Typo-correction has been broken since we first started using the module index, whereas code-completion only started relying on identifier iterator in r232793. rdar://problem/25642879 llvm-svn: 268471
* Method Pool in modules: we make sure that if a module contains an entry forManman Ren2016-04-292-0/+22
| | | | | | | | | | | | | | | a selector, the entry should be complete, containing everything introduced by that module and all modules it imports. Before writing out the method pool of a module, we sync up the out of date selectors by pulling in methods for the selectors, from all modules it imports. In ReadMethodPool, after pulling in the method pool entry for module A, this lets us skip the modules that module A imports. rdar://problem/25900131 llvm-svn: 268091
* Reland r267691 fixing PR27535.Vassil Vassilev2016-04-283-20/+24
| | | | llvm-svn: 267882
* Revert r267691, it caused PR27535.Nico Weber2016-04-273-24/+20
| | | | llvm-svn: 267744
* Module debugging: Fix the DWO filename for PCH in a relative path.Adrian Prantl2016-04-271-2/+3
| | | | | | | | | | | PCH in a relative location had a redundant relative path on the DWO filename and the DW_AT_compilation_dir. This patch fixes this and adds testcases for PCH in the same directory, in a relative, and an absolute location. rdar://problem/25537947 llvm-svn: 267740
* [modules] Fix Decl's Used invariant.Vassil Vassilev2016-04-273-20/+24
| | | | | | | | | | | | | | | | | | | | The Decl::isUsed has a value for every decl. In non-module builds it is very difficult (but possible) to break this invariant but when we walk up the redecl chain we find the neccessary information. When deserializing the decls from a module it is much more difficult to update correctly this invariant. The patch centralizes the information whether a decl is used in the canonical decl marking the entire entity as being used. Fixes https://llvm.org/bugs/show_bug.cgi?id=27401 Patch by Cristina Cristescu and me. Thanks to Richard Smith who helped to debug and understand the issue! Reviewed by Richard Smith. llvm-svn: 267691
* PR27513: When determining which declaration to put into an exported lookupRichard Smith2016-04-261-2/+11
| | | | | | | | | | | table for a module / PCH, never map from a normal declaration of a class to an injected-class-name declaration (or vice versa). Those declarations live in distinct lookup tables and should not be confused. We really shouldn't be using a CXXRecordDecl to represent an injected-class-name in the first place; I've filed PR27532 so we don't forget. llvm-svn: 267632
* [OpenMP] Improve mappable expressions Sema.Samuel Antao2016-04-262-6/+58
| | | | | | | | | | | | | | | Summary: This patch adds logic to save the components of mappable expressions in the clause that uses it, so that they don't have to be recomputed during codegen. Given that the mappable components are (will be) used in several clauses a new geneneric implementation `OMPMappableExprListClause` is used that extends the existing `OMPVarListClause`. This patch does not add new tests. The goal is to preserve the existing functionality while storing more info in the clauses. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D19382 llvm-svn: 267560
* [modules] Remove some more unnecessary forwarding functions.Richard Smith2016-04-181-37/+35
| | | | llvm-svn: 266687
OpenPOWER on IntegriCloud