summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] When we merge two definitions of a function, mark the retainedRichard Smith2016-09-122-24/+31
| | | | | | | definition as visible in the discarded definition's module, as we do for other kinds of definition. llvm-svn: 281258
* Modules: for ObjectiveC try to keep the definition invariant.Manman Ren2016-09-091-36/+59
| | | | | | | | | | | | When deserializing ObjCInterfaceDecl with definition data, if we already have a definition, try to keep the definition invariant; also pull in the categories even if it is not what getDefinition returns (this effectively combines categories). rdar://27926200 rdar://26708823 llvm-svn: 281119
* C++ Modules TS: Add parsing and some semantic analysis support forRichard Smith2016-09-083-0/+18
| | | | | | | export-declarations. These don't yet have an effect on name visibility; we still export everything by default. llvm-svn: 280999
* Fix some Clang-tidy modernize-use-using and Include What You Use warnings; ↵Eugene Zelenko2016-09-072-36/+213
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D24115 llvm-svn: 280870
* Do not validate pch when -fno-validate-pch is setYaxun Liu2016-09-071-5/+25
| | | | | | | | | | | | | | | | There is a bug causing pch to be validated even though -fno-validate-pch is set. This patch fixes it. ASTReader relies on ASTReaderListener to initialize SuggestedPredefines, which is required for compilations using PCH. Before this change, PCHValidator is the default ASTReaderListener. After this change, when -fno-validate-pch is set, PCHValidator is disabled, but we need a replacement ASTReaderListener to initialize SuggestedPredefines. Class SimpleASTReaderListener is implemented for this purpose. This change only affects -fno-validate-pch. There is no functional change if -fno-validate-pch is not set. If -fno-validate-pch is not set, conflicts in predefined macros between pch and current compiler instance causes error. If -fno-validate-pch is set, predefine macros in current compiler override those in pch so that compilation can continue. Differential Revision: https://reviews.llvm.org/D24054 llvm-svn: 280842
* Clean up handling of reading module files from stdin. Don't bother trying toRichard Smith2016-09-021-3/+6
| | | | | | | | | look for a corresponding file, since we're not going to read it anyway. No observable behavior change (though we now avoid pointlessly trying to stat or open a file named "-"). llvm-svn: 280436
* Refactor to avoid holding a reference to a container element that could go awayRichard Smith2016-09-021-40/+36
| | | | | | | | during this function, and to avoid rolling back changes to the module manager's data structures. Instead, we defer registering the module file until after we have successfully finished loading it. llvm-svn: 280434
* PR29166: when merging declarations with typedef names for linkage purposes,Richard Smith2016-08-301-1/+1
| | | | | | | don't assume that the anonymous struct will be part of the most recent declaration of the typedef. llvm-svn: 280136
* Fix a bug preventing the cause for a module file-not-found from being displayedAdrian Prantl2016-08-291-1/+1
| | | | llvm-svn: 280010
* Fix a bug preventing the cause of a module-out-of-date error from being printedAdrian Prantl2016-08-291-1/+1
| | | | llvm-svn: 280009
* C++ Modules TS: add frontend support for building pcm files from moduleRichard Smith2016-08-261-2/+5
| | | | | | | interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. llvm-svn: 279794
* Refactor to remove the assumption that we know the name of the module we're ↵Richard Smith2016-08-251-6/+13
| | | | | | emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input). llvm-svn: 279766
* Lazily load the ContextDecl for a lambda's DefinitionData, to fix aRichard Smith2016-08-252-2/+2
| | | | | | | deserialization cycle caused by the ContextDecl recursively importing members of the lambda's closure type. llvm-svn: 279694
* PR29097: add an update record when we instantiate the default memberRichard Smith2016-08-243-0/+32
| | | | | | initializer of an imported field. llvm-svn: 279667
* [GraphTraits] Replace all NodeType usage with NodeRefTim Shen2016-08-221-4/+3
| | | | | | | | This should finish the GraphTraits migration. Differential Revision: http://reviews.llvm.org/D23730 llvm-svn: 279475
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-183-20/+21
| | | | | | | | | | | | | In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax to load the module directly from a prebuilt module path. When loading from prebuilt module path, we don't support rebuilding of the module files and we ignore compatible configuration mismatches. rdar://27290316 Differential Revision: http://reviews.llvm.org/D23125 llvm-svn: 279096
* Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"Diana Picus2016-08-182-19/+0
| | | | | | | | | | | | | | | | | This reverts commit r279003 as it breaks some of our buildbots (e.g. clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules). The error is in OpenMP/teams_distribute_simd_ast_print.cpp: clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>; KeyT = clang::Stmt*; ValueT = long unsigned int; KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>; BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed. llvm-svn: 279045
* [OpenMP] Sema and parsing for 'teams distribute simd’ pragmaKelvin Li2016-08-172-0/+19
| | | | | | | | | | This patch is to implement sema and parsing for 'teams distribute simd’ pragma. This patch is originated by Carlo Bertolli. Differential Revision: https://reviews.llvm.org/D23528 llvm-svn: 279003
* [GraphWriter] Change GraphWriter to use NodeRef in GraphTraitsTim Shen2016-08-171-0/+1
| | | | | | | | | | | | Summary: Corresponding LLVM patch: D23580 Reviewers: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23581 llvm-svn: 278963
* P0217R3: serialization/deserialization support for c++17 decomposition ↵Richard Smith2016-08-122-2/+39
| | | | | | declarations. llvm-svn: 278460
* [ASTReader] Use real move semantics instead of emulating them in the copy ctor.Benjamin Kramer2016-08-061-3/+3
| | | | | | No functionality change intended. llvm-svn: 277923
* Move helpers into anonymous namespaces. NFC.Benjamin Kramer2016-08-061-2/+3
| | | | llvm-svn: 277918
* [OpenMP] Sema and parsing for 'teams distribute' pragmaKelvin Li2016-08-052-0/+19
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D23189 llvm-svn: 277818
* Reapply r276069 with workaround for MSVC 2013Hubert Tong2016-07-302-1/+3
| | | | llvm-svn: 277286
* [OpenMP] Code generation for the is_device_ptr clauseSamuel Antao2016-07-282-5/+57
| | | | | | | | | | | | Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22788 llvm-svn: 276978
* [OpenMP] Codegen for use_device_ptr clause.Samuel Antao2016-07-282-4/+67
| | | | | | | | | | | | Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22691 llvm-svn: 276977
* Modules: add command line option fmodules-disable-diagnostic-validationManman Ren2016-07-261-6/+12
| | | | | | | | | | | | | | | | | | | | | | With PCH+Module, sometimes compiler gives a hard error: Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt This happens when we have a pch importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match) but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch). This commit introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm. rdar://26675801 Differential Revision: http://reviews.llvm.org/D22773 llvm-svn: 276769
* P0217R3: Parsing support and framework for AST representation of C++1zRichard Smith2016-07-221-0/+2
| | | | | | | | | | | decomposition declarations. There are a couple of things in the wording that seem strange here: decomposition declarations are permitted at namespace scope (which we partially support here) and they are permitted as the declaration in a template (which we reject). llvm-svn: 276492
* [modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.Vassil Vassilev2016-07-223-10/+23
| | | | | | | | | | | | | | | Processing update records (and loading a module, in general) might trigger unexpected calls to the ASTWriter (being a mutation listener). Now we have a mechanism to suppress those calls to the ASTWriter but notify other possible mutation listeners. Fixes https://llvm.org/bugs/show_bug.cgi?id=28332 Patch by Cristina Cristescu and me. Reviewed by Richard Smith (D21800). llvm-svn: 276473
* [OpenMP] Sema and parsing for 'target simd' pragmaKelvin Li2016-07-202-0/+17
| | | | | | | | This patch is to implement sema and parsing for 'target simd' pragma. Differential Revision: https://reviews.llvm.org/D22479 llvm-svn: 276203
* [modules] Don't emit initializers for VarDecls within a module eagerly wheneverRichard Smith2016-07-204-10/+44
| | | | | | | | | | | | we first touch any part of that module. Instead, defer them until the first time that module is (transitively) imported. The initializer step for a module then recursively initializes modules that its own headers imported. For example, this avoids running the <iostream> global initializer in programs that don't actually use iostreams, but do use other parts of the standard library. llvm-svn: 276159
* Revert r276069: MSVC bots not happyHubert Tong2016-07-202-3/+1
| | | | llvm-svn: 276074
* Concepts: Create space for requires-clause in TemplateParameterList; NFCHubert Tong2016-07-202-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Space for storing the //constraint-expression// of the //requires-clause// associated with a `TemplateParameterList` is arranged by taking a bit out of the `NumParams` field for the purpose of determining whether there is a //requires-clause// or not, and by adding to the trailing objects tied to the `TemplateParameterList`. An accessor is provided. An appropriate argument is supplied to `TemplateParameterList::Create` at the various call sites. Serialization changes will addressed as the Concepts implementation becomes more solid. Drive-by fix: This change also replaces the custom `FixedSizeTemplateParameterListStorage` implementation with one that follows the interface provided by `llvm::TrailingObjects`. Reviewers: aaron.ballman, faisalv, rsmith Subscribers: cfe-commits, nwilson Differential Revision: https://reviews.llvm.org/D19322 llvm-svn: 276069
* [NFC] Header cleanupMehdi Amini2016-07-189-17/+10
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [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
OpenPOWER on IntegriCloud