summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Tracking exception specification source locationsMalcolm Parsons2017-01-122-0/+3
| | | | | | | | | | | | | | | | | | | | Summary: We do not currently track the source locations for exception specifications such that their source range can be queried through the AST. This leads to trying to write more complex code to determine the source range for uses like FixItHints (see D18575 for an example). In addition to use within tools like clang-tidy, I think this information may become more important to track as exception specifications become more integrated into the type system. Patch by Don Hinton. Reviewers: rsmith Subscribers: malcolm.parsons, sbarzowski, alexfh, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D20428 llvm-svn: 291771
* Serialize the UsesSEH bit on FunctionDeclReid Kleckner2017-01-102-0/+3
| | | | | | Fixes PR31539 llvm-svn: 291600
* [OpenMP] Sema and parsing for 'target teams distribute simd’ pragmaKelvin Li2017-01-102-0/+19
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute simd’ pragma. Differential Revision: https://reviews.llvm.org/D28252 llvm-svn: 291579
* PCH: fix a regression that reports a module is defined in both pch and pcm.Manman Ren2017-01-091-11/+0
| | | | | | | | | | | | | | | | | In r276159, we started to say that a module X is defined in a pch if we specify -fmodule-name when building the pch. This caused a regression that reports module X is defined in both pch and pcm if we generate the pch with -fmodule-name=X and then in a separate clang invocation, we include the pch and also import X.pcm. This patch adds an option CompilingPCH similar to CompilingModule. When we use -fmodule-name=X while building a pch, modular headers in X will be textually included and the compiler knows that we are not building module X, so we don't put module X in SUBMODULE_DEFINITION of the pch. Differential Revision: http://reviews.llvm.org/D28415 llvm-svn: 291465
* Simplify ASTReader ctor by using in-class initializers for many member variablesDavid Blaikie2017-01-051-19/+1
| | | | llvm-svn: 291155
* Simplify ASTReader ctor by using in-class initializers (NSDMIs to the rest ↵David Blaikie2017-01-051-18/+4
| | | | | | of you) for many member variables llvm-svn: 291154
* Use shared_ptr instead of IntrusiveRefCntPtr for ModuleFileExtensionDavid Blaikie2017-01-053-35/+30
| | | | | | | The intrusiveness wasn't needed here, so this simplifies/clarifies the ownership model. llvm-svn: 291150
* Fix for LLVM Bitcode API change (to use std::shared_ptr)David Blaikie2017-01-043-118/+118
| | | | llvm-svn: 291018
* [OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ ↵Kelvin Li2017-01-032-0/+20
| | | | | | | | | | pragma This patch is to implement sema and parsing for 'target teams distribute parallel for simd’ pragma. Differential Revision: https://reviews.llvm.org/D28202 llvm-svn: 290862
* [OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragmaKelvin Li2016-12-292-0/+19
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma. Differential Revision: https://reviews.llvm.org/D28160 llvm-svn: 290725
* [OpenMP] Sema and parsing for 'target teams distribute' pragmaKelvin Li2016-12-252-2/+21
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D28015 llvm-svn: 290508
* Rename several methods on ASTRecordReader to follow LLVM style (lowerCamelCase).David L. Jones2016-12-212-365/+365
| | | | | | | | | | | | | | Summary: This follows up to r290217, and makes functions on ASTRecordReader consistent and valid style. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28008 llvm-svn: 290236
* Store the "current position" index within the ASTRecordReader.David L. Jones2016-12-213-715/+723
| | | | | | | | | | | | | | | | | | Summary: For ASTDeclReader and ASTStmtReader, every parameter "unsigned &Idx" ultimately comes from a variable that is defined on the stack, next to the RecordData. This change moves that index into the ASTRecordReader. TypeLocReader cannot be transitioned, due to TableGen-generated code which calls ASTReader::GetTypeSourceInfo. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27836 llvm-svn: 290217
* [c++1z] P0195R2: Support pack-expansion of using-declarations.Richard Smith2016-12-203-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. This is a re-commit of r290080 (reverted in r290092) with a fix for a use-after-lifetime bug. llvm-svn: 290203
* [ASTReader] Sort RawComments before mergingBruno Cardoso Lopes2016-12-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | `RawComments` are sorted by comparing underlying `SourceLocation`'s. This is done by comparing `FileID` and `Offset`; when the `FileID` is the same it means the locations are within the same TU and the `Offset` is used. FileID, from the source code: "A mostly-opaque identifier, where 0 is "invalid", >0 is this module, and <-1 is something loaded from another module.". That said, when de-serializing SourceLocations, FileID's from RawComments loaded from other modules get negative IDs where previously they were positive. This makes imported RawComments unsorted, leading to a wrong merge with other comments from the current TU. Fix that by sorting RawComments properly after de-serialization and before merge. This fixes an assertion in `ASTContext::getRawCommentForDeclNoCache`, which fires only in a debug build of clang. Differential Revision: https://reviews.llvm.org/D27546 rdar://problem/29287314 llvm-svn: 290134
* Revert "[c++1z] P0195R2: Support pack-expansion of using-declarations."Daniel Jasper2016-12-193-28/+0
| | | | | | | This reverts commit r290080 as it leads to many Clang crashes, e.g.: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/1814 llvm-svn: 290092
* [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
OpenPOWER on IntegriCloud