summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* [c++1z] P0195R2: Support pack-expansion of using-declarations.Richard Smith2016-12-193-0/+28
| | | | | | | | | | | This change introduces UsingPackDecl as a marker for the set of UsingDecls produced by pack expansion of a single (unresolved) using declaration. This is not strictly necessary (we just need to be able to map from the original using declaration to its expansions somehow), but it's useful to maintain the invariant that each declaration reference instantiates to refer to one declaration. llvm-svn: 290080
* Attempt to fix build failure and regressions due to r290056Yaxun Liu2016-12-182-4/+4
| | | | | | | Add llvm:: namespace to StringRef. Make conversion between bool and uint64_t explicit. llvm-svn: 290058
* Recommit r289979 [OpenCL] Allow disabling types and declarations associated ↵Yaxun Liu2016-12-182-12/+76
| | | | | | | | with extensions Fixed undefined behavior due to cast integer to bool in initializer list. llvm-svn: 290056
* [OpenMP] Sema and parsing for 'target teams' pragmaKelvin Li2016-12-172-0/+20
| | | | | | | | This patch is to implement sema and parsing for 'target teams' pragma. Differential Revision: https://reviews.llvm.org/D27818 llvm-svn: 290038
* Revert r289979 due to regressionsYaxun Liu2016-12-162-76/+12
| | | | llvm-svn: 289991
* [OpenCL] Allow disabling types and declarations associated with extensionsYaxun Liu2016-12-162-12/+76
| | | | | | | | | | | | | | | | | | Added a map to associate types and declarations with extensions. Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation. Fixed some bugs for types associated with extensions. Allow users to use pragma to declare types and functions for supported extensions, e.g. #pragma OPENCL EXTENSION the_new_extension_name : begin // declare types and functions associated with the extension here #pragma OPENCL EXTENSION the_new_extension_name : end Differential Revision: https://reviews.llvm.org/D21698 llvm-svn: 289979
* Add a class ASTRecordReader which wraps an ASTReader, a RecordData, and ↵David L. Jones2016-12-153-1447/+1378
| | | | | | | | | | | | | | | | | | | | | ModuleFile. Summary: When reading an ASTRecord, each RecordData is logically contained within a single ModuleFile, and global(er) state is contained by a single ASTReader. This means that any operations that read from a RecordData and reference an ASTReader or a ModuleFile, will always reference the same ASTReader or ModuleFile. ASTRecordReader groups these together so that parameters don't need to be duplicated ad infinitum. Most uses of the Idx variable seem to be redunant aliases as well, but I'll leave that for now. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27784 llvm-svn: 289870
* Remove unused variable found by GCC warning.Richard Smith2016-12-141-1/+1
| | | | llvm-svn: 289698
* Remove custom handling of array copies in lambda by-value array capture andRichard Smith2016-12-144-68/+16
| | | | | | | | | | | copy constructors of classes with array members, instead using ArrayInitLoopExpr to represent the initialization loop. This exposed a bug in the static analyzer where it was unable to differentiate between zero-initialized and unknown array values, which has also been fixed here. llvm-svn: 289618
* Add two new AST nodes to represent initialization of an array in terms ofRichard Smith2016-12-122-0/+30
| | | | | | | | | | | | | | | | | | | | initialization of each array element: * ArrayInitLoopExpr is a prvalue of array type with two subexpressions: a common expression (an OpaqueValueExpr) that represents the up-front computation of the source of the initialization, and a subexpression representing a per-element initializer * ArrayInitIndexExpr is a prvalue of type size_t representing the current position in the loop This will be used to replace the creation of explicit index variables in lambda capture of arrays and copy/move construction of classes with array elements, and also C++17 structured bindings of arrays by value (which inexplicably allow copying an array by value, unlike all of C++'s other array declarations). No uses of these nodes are introduced by this change, however. llvm-svn: 289413
* [modules] Add optional out-param to ASTReader::ReadAST for imported submodules.Graydon Hoare2016-12-091-1/+6
| | | | | | | | | | | | | | | | | | | | Summary: The Swift frontend is acquiring the ability to load non-module PCH files containing bridging definitions from C/ObjC. As part of this work, it needs to know which submodules were imported by a PCH in order to wrap them in local Swift modules. This information is collected by ASTReader::ReadAST in a local vector, but is currently kept private. The change here is just to make the type of the vector elements public, and provide an optional out-parameter to the ReadAST method to provide the vector's contents to a caller after a successful read. Reviewers: manmanren, rsmith, doug.gregor Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27580 llvm-svn: 289276
* Don't assert when redefining a built-in macro in a PCH, PR29119Nico Weber2016-12-091-1/+1
| | | | | | | | | | | | | | | | PCH files store the macro history for a given macro, and the whole history list for one identifier is given to the Preprocessor at once via Preprocessor::setLoadedMacroDirective(). This contained an assert that no macro history exists yet for that identifier. That's usually true, but it's not true for builtin macros, which are created in Preprocessor() before flags and pchs are processed. Luckily, ASTWriter stops writing macro history lists at builtins (see shouldIgnoreMacro() in ASTWriter.cpp), so the head of the history list was missing for builtin macros. So make the assert weaker, and splice the history list to the existing single define for builtins. https://reviews.llvm.org/D27545 llvm-svn: 289228
* [OpenMP] Sema and parsing for 'teams distribute parallel for' pragmaKelvin Li2016-12-092-0/+19
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for' pragma. Differential Revision: https://reviews.llvm.org/D27345 llvm-svn: 289179
* [OpenCL] Refactor read_only/write_only pipes.Joey Gouly2016-12-012-17/+6
| | | | | | | | | | | This adds the access qualifier to the Pipe Type, rather than using a class hierarchy. It also fixes mergeTypes for Pipes, by disallowing merges. Only identical pipe types can be merged. The test case in invalid-pipes-cl2.0.cl is added to check that. llvm-svn: 288332
* [OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragmaKelvin Li2016-11-302-0/+19
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for simd' pragma. Differential Revision: https://reviews.llvm.org/D27084 llvm-svn: 288294
* [OpenCL] Introduce ReadPipeType and WritePipeType.Joey Gouly2016-11-182-3/+17
| | | | | | | This allows Sema to diagnose passing a read_only pipe to a write_only pipe argument. llvm-svn: 287343
* Remove duplicate condition (PR30648). NFCI.Simon Pilgrim2016-11-161-2/+1
| | | | | | We only need to check that the bitstream entry is a Record. llvm-svn: 287114
* [VFS] Replace TimeValue usage with std::chronoPavel Labath2016-11-091-1/+1
| | | | | | | | | | | | Summary: NFCI Reviewers: benlangmuir, zturner Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25948 llvm-svn: 286356
* Bitcode: Decouple block info block state from reader.Peter Collingbourne2016-11-083-24/+13
| | | | | | | | | | | | | | | | | As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html Move block info block state to a new class, BitstreamBlockInfo. Clients may set the block info for a particular cursor with the BitstreamCursor::setBlockInfo() method. At this point BitstreamReader is not much more than a container for an ArrayRef<uint8_t>, so remove it and replace all uses with direct uses of memory buffers. Differential Revision: https://reviews.llvm.org/D26259 llvm-svn: 286207
* Bitcode: Change reader interface to take memory buffers.Peter Collingbourne2016-11-022-3/+3
| | | | | | | | | | | | | | | | | | | As proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html This change also fixes an API oddity where BitstreamCursor::Read() would return zero for the first read past the end of the bitstream, but would report_fatal_error for subsequent reads. Now we always report_fatal_error for all reads past the end. Updated clients to check for the end of the bitstream before reading from it. I also needed to add padding to the invalid bitcode tests in test/Bitcode/. This is because the streaming interface was not checking that the file size is a multiple of 4. Differential Revision: https://reviews.llvm.org/D26219 llvm-svn: 285773
* Bitcode: Simplify BitstreamWriter::EnterBlockInfoBlock() interface.Peter Collingbourne2016-11-012-2/+2
| | | | | | | | | | | No block info block should need to define local abbreviations, so we can always use a code width of 2. Also change all block info block writers to use EnterBlockInfoBlock. Differential Revision: https://reviews.llvm.org/D26168 llvm-svn: 285660
* [modules] Fix assert if multiple update records provide a definition for aRichard Smith2016-10-261-1/+4
| | | | | | class template specialization and that specialization has attributes. llvm-svn: 285160
* Re-apply patch r279045.Kelvin Li2016-10-252-0/+19
| | | | llvm-svn: 285066
* Module: correctly set the module file kind when emitting file_modified.Manman Ren2016-10-211-1/+8
| | | | | | | | rdar://28503343 Differential Revision: http://reviews.llvm.org/D25806 llvm-svn: 284899
* Remove move constructors that are identical to the generated default move ctor.Benjamin Kramer2016-10-211-11/+0
| | | | llvm-svn: 284856
* Revert "Reinstate r281429, reverted in r281452, with a fix for its ↵Benjamin Kramer2016-10-171-3/+16
| | | | | | | | | mishandling of" This reverts commit r284176. It still marks some modules as invisible that should be visible. Will follow up with the author with a test case. llvm-svn: 284382
* Reinstate r284008 reverted in r284081, with two fixes:Richard Smith2016-10-142-0/+28
| | | | | | | | | | | | | | | | | | | 1) Merge and demote variable definitions when we find a redefinition in MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach the second case if it's the addition of the initializer itself that converts an existing declaration into a definition). 2) When rebuilding a redeclaration chain for a variable, if we merge two definitions together, mark the definitions as merged so the retained definition is made visible whenever the demoted definition would have been. Original commit message (from r283882): [modules] PR28752: Do not instantiate variable declarations which are not visible. Original patch by Vassil Vassilev! Changes listed above are mine. llvm-svn: 284284
* Reinstate r281429, reverted in r281452, with a fix for its mishandling ofRichard Smith2016-10-131-16/+3
| | | | | | | | | compiles without -fmodules-local-submodule-visibility. Original commit message: [modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition. llvm-svn: 284176
* Revert r284008. This is us to fail to instantiate static data members in someRichard Smith2016-10-122-28/+0
| | | | | | cases. I'm working on reducing a testcase. llvm-svn: 284081
* Reinstate r283887 and r283882.Vassil Vassilev2016-10-122-0/+28
| | | | | | | | | | | Original message: "[modules] PR28752: Do not instantiate variable declarations which are not visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith!" llvm-svn: 284008
* Revert r283887 and r283882, until the issue is understood and fixed.Vassil Vassilev2016-10-112-33/+0
| | | | llvm-svn: 283890
* [modules] PR28752: Do not instantiate variable declarations which are not ↵Vassil Vassilev2016-10-112-0/+33
| | | | | | | | | | visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith! llvm-svn: 283882
* Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)Mehdi Amini2016-10-103-9/+8
| | | | llvm-svn: 283815
* Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use ofRichard Smith2016-10-102-0/+2
| | | | | | | | | | | past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code generation for C++17 overaligned allocation. llvm-svn: 283789
* [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.Justin Lebar2016-10-102-8/+9
| | | | | | | | | | | | | | | Summary: This is possible now that MapVector supports move-only values. Depends on D25404. Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25405 llvm-svn: 283766
* Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned ↵Daniel Jasper2016-10-102-2/+0
| | | | | | | | | | | | allocation." This reverts commit r283722. Breaks: Clang.SemaCUDA.device-var-init.cu Clang.CodeGenCUDA.device-var-init.cu http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/ llvm-svn: 283750
* P0035R4: Semantic analysis and code generation for C++17 overalignedRichard Smith2016-10-102-0/+2
| | | | | | allocation. llvm-svn: 283722
* [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.Justin Lebar2016-10-082-0/+18
| | | | | | | | | | | | | | | | | Summary: These cause us to consider all functions in-between to be __host__ __device__. You can nest these pragmas; you just can't have more 'end's than 'begin's. Reviewers: rsmith Subscribers: tra, jhen, cfe-commits Differential Revision: https://reviews.llvm.org/D24975 llvm-svn: 283677
* [modules] Be sure to emit local specializations of imported templates, even ifRichard Smith2016-10-061-4/+41
| | | | | | | | | | | the resulting specialization is not referenced by the rest of the AST. This both avoids performing unnecessary reinstantiations in downstream users of the AST file and fixes a bug (breaking modules self-host right now) where we would sometimes fail to emit a definition of a class template specialization if we imported just a declaration of it from elsewhere (see new testcase for reduced example). llvm-svn: 283489
* Allocate after the early exit checks. NFC.Vassil Vassilev2016-10-061-2/+2
| | | | llvm-svn: 283448
* [modules] Allow VarDecls with initializers to use special var abbrev.Vassil Vassilev2016-10-062-11/+9
| | | | | | | | | Update storage sizes to fit the (past) changes in the VarDecl's data model. Update some comments. Patch partially reviewed by Richard Smith as part of https://reviews.llvm.org/D24508 llvm-svn: 283444
* Use StringRef for MemoryBuffer identifier API (NFC)Mehdi Amini2016-10-011-4/+3
| | | | llvm-svn: 283043
* P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.Richard Smith2016-09-292-4/+7
| | | | llvm-svn: 282800
* [ASTImporter] Implement some expression-related AST node import (part 2)Aleksei Sidorin2016-09-282-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Some code cleanup * Add tests not present in http://reviews.llvm.org/D14286 * Integrate a test suite from Serge Pavlov (http://reviews.llvm.org/D14224) * ArrayTypeTraitExpr: serialize sub-expression to avoid keeping it undefined * Implement import of some nodes: - ArrayTypeTraitExpr - ExpressionTraitExpr - OpaqueValueExpr - ArraySubscriptExpr - ExplicitCastExpr - ImplicitValueInitExpr - OffsetOfExpr - CXXThisExpr - CXXThrowExpr - CXXNoexceptExpr - CXXDefaultArgExpr - CXXScalarValueInitExpr - CXXBindTemporaryExpr - CXXTemporaryObjectExpr - MaterializeTemporaryExpr - ExprWithCleanups - StaticAssertDecl - FriendDecl - DecayedType Differential Revision: https://reviews.llvm.org/D14326 llvm-svn: 282572
* Remove excessive padding from RedeclarableResultAlexander Shaposhnikov2016-09-241-7/+8
| | | | | | | | | | | This diff reorders the fields of the class RedeclarableResult to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24754 llvm-svn: 282322
* Remove excessive padding from ObjCCategoriesVisitorAlexander Shaposhnikov2016-09-241-8/+8
| | | | | | | | | | | This diff reorders the fields of ObjCCategoriesVisitor to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24753 llvm-svn: 282318
* Revert "[modules] When merging one definition into another, propagate the ↵Eric Liu2016-09-141-3/+16
| | | | | | | | list of re-exporting modules from the discarded definition to the retained definition." This reverts commit r281429. llvm-svn: 281452
* [modules] When merging one definition into another, propagate the list ofRichard Smith2016-09-141-16/+3
| | | | | | re-exporting modules from the discarded definition to the retained definition. llvm-svn: 281429
* ObjectiveC generics: Add ObjCTypeParamType in the type system.Manman Ren2016-09-132-0/+36
| | | | | | | | | | | | | | | | | We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the representation of "T <protocol>" where T is a type parameter. Before this, we use TypedefType to represent the type parameter for ObjC. ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized to the underlying type with the protocol qualifiers. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23079 llvm-svn: 281355
* Fix interaction between serialization and c++1z feature.Richard Trieu2016-09-131-1/+1
| | | | | | | | In c++1z, static_assert is not required to have a StringLiteral message, where previously it was required. Update the AST Reader to be able to handle a null StringLiteral. llvm-svn: 281286
OpenPOWER on IntegriCloud