summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Revert 266186 as it breaks anything that includes type_traits on some platformsNemanja Ivanovic2016-04-152-6/+0
| | | | | | | | | | Since this patch provided support for the __float128 type but disabled it on all platforms by default, some platforms can't compile type_traits with -std=gnu++11 since there is a specialization with __float128. This reverts the patch until D19125 is approved (i.e. we know which platforms need this support enabled). llvm-svn: 266460
* [modules] Store the location of the lexical update record in a decl update asRichard Smith2016-04-142-3/+2
| | | | | | | an offset from the current record rather than as an absolute bit number. This gives a minor .pcm file size reduction. llvm-svn: 266269
* [modules] Remove CXX_BASE_SPECIFIERS_OFFSETS table. Instead of storing an ID ofRichard Smith2016-04-145-105/+18
| | | | | | | | a table entry in the corresponding decl, store an offset from the current record to the relevant CXX_BASE_SPECIFIERS record. This results in fewer indirections and a minor .pcm file size reduction. llvm-svn: 266266
* [modules] Remove CXX_CTOR_INITIALIZERS_OFFSETS table. Instead of storing an IDRichard Smith2016-04-135-113/+43
| | | | | | | | of a table entry in the corresponding decl, store an offset from the current record to the relevant CXX_CTOR_INITIALIZERS record. This results in fewer indirections and a minor .pcm file size reduction. llvm-svn: 266254
* Enable support for __float128 in ClangNemanja Ivanovic2016-04-132-0/+6
| | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D15120 It adds support for the __float128 keyword, literals and a target feature to enable it. This support is disabled by default on all targets and any target that has support for this type is free to add it. Based on feedback that I've received from target maintainers, this appears to be the right thing for most targets. I have not heard from the maintainers of X86 which I believe supports this type. I will subsequently investigate the impact of enabling this on X86. llvm-svn: 266186
* [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader2016-04-132-2/+2
| | | | | | | | | | Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header". This fixes the modules build. Differential revision: http://reviews.llvm.org/D18954 Reviewers: Richard Smith, Vassil Vassilev. llvm-svn: 266180
* ASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. ↵NAKAMURA Takumi2016-04-131-10/+0
| | | | | | [-Wdocumentation] llvm-svn: 266177
* [modules] Add some missing blockinfo records. No functionality change except ↵Richard Smith2016-04-131-0/+12
| | | | | | to llvm-bcanalyzer output. llvm-svn: 266176
* [modules] Refactor handling of cases where we write an offset to a prior ↵Richard Smith2016-04-132-29/+13
| | | | | | record into the bitstream and simplify a little, in preparation for doing this in more cases. llvm-svn: 266160
* Remove unused functions from ASTWriter interface.Richard Smith2016-04-081-8/+8
| | | | llvm-svn: 265857
* PR25501: Delay loading visible updates for a declaration until after we'veRichard Smith2016-04-081-15/+15
| | | | | | | | | | | processed update records. If an update record adds a definition, we need to merge that with any pre-existing definition to determine which the canonical definition is before we apply the visible update, otherwise we wouldn't know where to apply it. Thanks to Vassil Vassilev for help reducing this and tracking down the problem. llvm-svn: 265848
* [OpenCL] Complete image types support.Alexey Bader2016-04-082-70/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I. Current implementation of images is not conformant to spec in the following points: 1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine: void write_image(write_only image2d_t img); kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code which is disallowed according to s6.13.14. 2. It discards access qualifier on generated code, which leads to generated code for the above example: call void @write_image(%opencl.image2d_t* %img); In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images. Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently. 3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names. 4. Default access qualifier read_only is to be added if not provided explicitly. II. This patch corrects the above points as follows: 1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type. 2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers). 3. Improves testing of images in Clang. Author: Anastasia Stulova Reviewers: bader, mgrang. Subscribers: pxli168, pekka.jaaskelainen, yaxunl. Differential Revision: http://reviews.llvm.org/D17821 llvm-svn: 265783
* [modules] Allow differences in flags that only affect preprocessor predefinesRichard Smith2016-04-071-0/+5
| | | | | | | (and __has_feature checks) between explicitly-specified module files and the current compilation. llvm-svn: 265718
* Fix order-of-evaluation bug (causing GCC buildbots to fail).Richard Smith2016-04-061-1/+2
| | | | llvm-svn: 265598
* [modules] Don't try to add lookup results to non-lookup contexts.Vassil Vassilev2016-04-061-0/+3
| | | | | | | | Fixes https://llvm.org/bugs/show_bug.cgi?id=27186 Patch reviewed by Richard Smith. llvm-svn: 265597
* Minor simplifications.Richard Smith2016-04-062-10/+6
| | | | llvm-svn: 265594
* Re-commit r265518 ("[modules] Continue factoring encoding of AST records out ofRichard Smith2016-04-063-959/+930
| | | | | | | ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug (thanks, MSan!). llvm-svn: 265564
* [OPENMP] Parsing and Sema support for 'omp declare target' directiveDmitry Polukhin2016-04-064-2/+23
| | | | | | | | | | | | | | | | | | | | Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0 (4.5 support will be added in separate patch). The declare target directive specifies that variables, functions (C, C++ and Fortran), and subroutines (Fortran) are mapped to a device. The declare target directive is a declarative directive. In Clang declare target is implemented as implicit attribute for the declaration. The syntax of the declare target directive is as follows: #pragma omp declare target declarations-definition-seq #pragma omp end declare target Based on patch from Michael Wong http://reviews.llvm.org/D15321 llvm-svn: 265530
* Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."Dmitry Polukhin2016-04-063-926/+956
| | | | | | This reverts commit r265518. llvm-svn: 265526
* [modules] Continue factoring encoding of AST records out of ASTWriter.Richard Smith2016-04-063-956/+926
| | | | llvm-svn: 265518
* [modules] Start moving the code for encoding AST records out of ASTWriter intoRichard Smith2016-04-013-419/+415
| | | | | | | | a separate class. The goal is for this class to have a separate lifetime from the AST writer so that it can meaningfully track pending statement nodes and context for more compact encoding of various types. llvm-svn: 265195
* [modules] Write out identifiers if the ID is local, too.Vassil Vassilev2016-03-301-1/+4
| | | | | | | | | | | | | | | | | In some cases a slot for an identifier is requested but it gets written to another module, causing an assertion. At the point when we start serializing Rtypes, we have no imported IdentifierID for float_round_style. We start serializing stuff and allocate an ID for it. Then, during the serialization process, we pull in the identifier info for it from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier has not changed since it was deserialized, so doesn't emit it. Fixes https://llvm.org/bugs/show_bug.cgi?id=27041 Discussed on IRC with Richard Smith. Agreed on post commit review if needed. llvm-svn: 264913
* [OPENMP] Remove extra code transformation.Alexey Bataev2016-03-292-0/+2
| | | | | | | | | For better support of some specific GNU extensions some extra transformation of AST nodes were introduced. These transformations are very hard to handle. The code is improved in handling of these extensions by using captured expressions construct. llvm-svn: 264709
* [modules] If both a module file and a module map for the same module areRichard Smith2016-03-281-2/+13
| | | | | | | | | | explicitly provided, and the module map lists a header that does not exist, unmark the module as 'unavailable' when loading its .pcm file. (Use of the module might still fail if the relevant headers aren't embedded, but this behavior is now consistent with how we behave if the module map is not provided, and with the desired behavior for embedding headers in modules.) llvm-svn: 264664
* Fix serialization/deserialization for __uuidofDavid Majnemer2016-03-282-0/+3
| | | | | | | | I broke this back in r264529 because I forgot to serialize the UuidAttr member. Fix this by replacing the UuidAttr with a StringRef which is properly serialized and deserialized. llvm-svn: 264562
* [modules] When encoding SourceLocations in bitcode, rotate the 'is macro' flagRichard Smith2016-03-272-16/+19
| | | | | | | bit from the top bit to the bottom bit, so that we don't need 6 VBR6 hunks for each macro location. Reduces libstdc++ module size by about 1%. llvm-svn: 264540
* Encapsulate a couple of on-disk structures a little more.Richard Smith2016-03-272-17/+17
| | | | llvm-svn: 264534
* Remove unused support for replacing declarations from chained AST files.Richard Smith2016-03-274-63/+16
| | | | llvm-svn: 264533
* Store list of undefined-but-used objects in a deterministic order to fixRichard Smith2016-03-251-1/+1
| | | | | | | | non-deterministic diagnostics (and non-deterministic PCH files). Check these when building a module rather than serializing it; it's not reasonable for a module's use to be satisfied by a definition in the user of the module. llvm-svn: 264466
* [modules] Store a local offset to DeclContext lexical and visible contents. ↵Richard Smith2016-03-252-9/+18
| | | | | | Saves a few bytes for each primary DeclContext. llvm-svn: 264377
* [modules] Store offset to LOCAL_REDECLARATIONS record relative to the currentRichard Smith2016-03-242-6/+13
| | | | | | | | record rather than relative to the start of the bitcode file. Saves a couple of bytes per LOCAL_REDECLARATIONS record (also makes diffs of llvm-bcanalyzer output more useful when tracking down nondeterminism...). llvm-svn: 264359
OpenPOWER on IntegriCloud