summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace double negation of !FileID.isInvalid() with FileID.isValid().Yaron Keren2015-10-031-2/+2
| | | | | | +couple more of double-negated !SourceLocation.isInvalid() unfixed in r249228. llvm-svn: 249235
* Refactor ASTReader::getSourceDescriptor(const Module &) into a constructorAdrian Prantl2015-09-191-19/+3
| | | | | | | | of ASTSourceDescriptor. It was effectively a static function. NFC. llvm-svn: 248069
* Support __builtin_ms_va_list.Charles Davis2015-09-171-0/+3
| | | | | | | | | | | | | | | | | | Summary: This change adds support for `__builtin_ms_va_list`, a GCC extension for variadic `ms_abi` functions. The existing `__builtin_va_list` support is inadequate for this because `va_list` is defined differently in the Win64 ABI vs. the System V/AMD64 ABI. Depends on D1622. Reviewers: rsmith, rnk, rjmccall CC: cfe-commits Differential Revision: http://reviews.llvm.org/D1623 llvm-svn: 247941
* Run clang-format to unify the switch statement style as suggest here: ↵Alexey Bader2015-09-151-43/+122
| | | | | | | | http://reviews.llvm.org/D12855#246073. NFC. llvm-svn: 247678
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-151-0/+30
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* [modules] Write the options records to a separate subblock rather than writingRichard Smith2015-09-081-130/+150
| | | | | | | | them directly to the control block. These are fairly large, and in a build with lots of modules / chained PCH, we don't need to read most of them. No functionality change intended. llvm-svn: 247055
* [modules] Don't waste time reading in the names the module file writer gave ↵Richard Smith2015-09-021-7/+1
| | | | | | to blocks. We don't need these names, and decoding the corresponding bitcode has a significant cost. llvm-svn: 246680
* Re-commit r246497 (and dependent changes r246524 and r246521), reverted inRichard Smith2015-09-011-181/+76
| | | | | | | | | | | | | | | | | | | r246546, with a workaround for an MSVC 2013 miscompile and an MSVC 2015 rejects-valid. Original commit message: [modules] Rework serialized DeclContext lookup table management. Instead of walking the loaded ModuleFiles looking for lookup tables for the context, store them all in one place, and merge them together if we find we have too many (currently, more than 4). If we do merge, include the merged form in our serialized lookup table, so that downstream readers never need to look at our imports' tables. This gives a huge performance improvement to builds with very large numbers of modules (in some cases, more than a 2x speedup was observed). llvm-svn: 246582
* Reverting r246497 (which requires also reverting r246524 and r246521 to ↵Aaron Ballman2015-09-011-76/+181
| | | | | | | | | | | avoid merge conflicts). It broke the build on MSVC 2015. It also broke an MSVC 2013 bot with testing issues. llvm\tools\clang\lib\serialization\MultiOnDiskHashTable.h(117): error C2065: 'Files': undeclared identifier http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/2917 llvm-svn: 246546
* [modules] When emitting line tables, only emit filenames that are actually ↵Richard Smith2015-09-011-2/+3
| | | | | | referenced by the entries that we emit. llvm-svn: 246534
* Use a more appropriate way of writing 1.Richard Smith2015-09-011-2/+1
| | | | llvm-svn: 246524
* [modules] Preserve DeclID order when merging lookup tables to give a moreRichard Smith2015-09-011-1/+1
| | | | | | | | predictable diagnostic experience. The hash-of-DeclID order we were using before gave different results on Win32 due to a different predefined declaration of __builtin_va_list. llvm-svn: 246521
* [modules] Rework serialized DeclContext lookup table management. Instead ofRichard Smith2015-08-311-181/+77
| | | | | | | | | | | | | walking the loaded ModuleFiles looking for lookup tables for the context, store them all in one place, and merge them together if we find we have too many (currently, more than 4). If we do merge, include the merged form in our serialized lookup table, so that downstream readers never need to look at our imports' tables. This gives a huge performance improvement to builds with very large numbers of modules (in some cases, more than a 2x speedup was observed). llvm-svn: 246497
* [modules] The key to a DeclContext name lookup table is not actually aRichard Smith2015-08-261-51/+39
| | | | | | | | DeclarationName (because all ctor names are considered the same, and so on). Reflect this in the type used as the lookup table key. As a side-effect, remove one copy of the duplicated code used to compute the hash of the key. llvm-svn: 246124
* [OPENMP 4.0] Initial support for array sections.Alexey Bataev2015-08-251-0/+4
| | | | | | | | Adds parsing/sema analysis/serialization/deserialization for array sections in OpenMP constructs (introduced in OpenMP 4.0). Currently it is allowed to use array sections only in OpenMP clauses that accepts list of expressions. Differential Revision: http://reviews.llvm.org/D10732 llvm-svn: 245937
* [modules] Remove unnecessary deserialization of fully-external ↵Richard Smith2015-08-241-2/+4
| | | | | | HeaderFileInfos for all files we've seen in this compilation. llvm-svn: 245881
* [modules] Stop updating all identifiers when writing a module. This isRichard Smith2015-08-241-1/+20
| | | | | | | unnecessary in C++ modules (where we don't need the identifiers for their Decls) and expensive. llvm-svn: 245821
* [modules] Further simplification and speedup of redeclaration chain loading.Richard Smith2015-08-221-17/+1
| | | | | | | | Instead of eagerly deserializing a list of DeclIDs when we load a module file and doing a binary search to find the redeclarations of a decl, store a list of redeclarations of each chain before the first declaration and load it directly. llvm-svn: 245789
* [modules] Remove some dead code after r245779.Richard Smith2015-08-221-2/+0
| | | | llvm-svn: 245780
* [modules] Rearrange how redeclaration chains are loaded, to remove a walk overRichard Smith2015-08-221-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | all modules and reduce the number of declarations we load when loading a redeclaration chain. The new approach is: * when loading the first declaration of an entity within a module file, we first load all declarations of the entity that were imported into that module file, and then load all the other declarations of that entity from that module file and build a suitable decl chain from them * when loading any other declaration of an entity, we first load the first declaration from the same module file As before, we complete redecl chains through name lookup where necessary. To make this work, I also had to change the way that template specializations are stored -- it no longer suffices to track only canonical specializations; we now emit all "first local" declarations when emitting a list of specializations for a template. On one testcase with several thousand imported module files, this reduces the total runtime by 72%. llvm-svn: 245779
* [modules] When we see a definition of a function for which we already have aRichard Smith2015-08-211-3/+2
| | | | | | | non-visible definition, skip the new definition to avoid ending up with a function with multiple definitions. llvm-svn: 245664
* [modules] Don't needlessly bounce through Sema when updating exception ↵Richard Smith2015-08-191-2/+3
| | | | | | specifications. llvm-svn: 245501
* [modules] Fix HeaderFileInfo serialization to store all the known owning ↵Richard Smith2015-08-181-32/+33
| | | | | | modules for a header, not just the current favourite. llvm-svn: 245390
* [modules] When explicitly building a module file, don't include timestamps inRichard Smith2015-08-171-12/+10
| | | | | | | the produced pcm file for stable file creation across distributed build systems. llvm-svn: 245199
* [modules] Add an experimental -cc1 feature to embed the contents of an inputRichard Smith2015-08-141-1/+2
| | | | | | | | | | | file in the .pcm files. This allows a smaller set of files to be sent to a remote build worker when building with explicit modules (for instance, module map files need not be sent along with the corresponding precompiled modules). This doesn't actually make the embedded files visible to header search, so it's not useful as a packaging format for public header files. llvm-svn: 245028
* [modules] Change the way we deal with .d output for explicitly-specified moduleRichard Smith2015-08-131-10/+15
| | | | | | | | | | | | | files: include the .pcm file itself in the .d output, rather than including its own input files. Other forms of module file continue to be transparent for .d output. Arguably, the input files for the .pcm file are still inputs to the compilation, but that's unnecessary for make-like build systems (where the mtime of the .pcm file is sufficient) and harmful for smarter build systems that know about module files and want to track only the local dependencies. llvm-svn: 244923
* [modules] If loading a .pcm file would cause us to run out of source ↵Richard Smith2015-08-121-0/+4
| | | | | | locations, attempt to fail more gracefully. (No test; this requires >= 4GB of preprocessed input...) llvm-svn: 244822
* [modules] When instantiating the contents of an imported CXXRecordDecl, we canRichard Smith2015-08-111-6/+13
| | | | | | | | emit lexical contents for a declaration for another module. Track which module those contents came from, and ensure that we only grab the lexical contents from a single such instantiation. llvm-svn: 244682
* Add an assert to catch lexical decl deserialization bugs.Richard Smith2015-08-111-0/+1
| | | | llvm-svn: 244671
* Remove some dead code.Richard Smith2015-08-101-12/+0
| | | | llvm-svn: 244530
* [modules] Remove now-dead code for lazy loading of files specified by ↵Richard Smith2015-08-091-17/+0
| | | | | | -fmodule-file=. llvm-svn: 244417
* [modules] PR22534: Load files specified by -fmodule-file= eagerly. In ↵Richard Smith2015-08-091-23/+80
| | | | | | particular, this avoids the need to re-parse module map files when using such a module. llvm-svn: 244416
* [modules] When loading a template specialization, re-canonicalize its templateRichard Smith2015-08-091-5/+15
| | | | | | | | arguments because the reloaded form might have become non-canonical across the serialization/deserialization step (this particularly happens when the canonical form of the type involves an expression). llvm-svn: 244409
* [modules] Fix use-after-iterator-invalidation bug.Richard Smith2015-08-061-1/+1
| | | | llvm-svn: 244288
* [modules] Stop walking all modules when looking for lexical decls for aRichard Smith2015-08-061-60/+41
| | | | | | DeclContext. These only ever come from the owning module file for the Decl. llvm-svn: 244285
* [modules] Remove redundant lookups into non-primary DeclContexts. These were ↵Richard Smith2015-08-061-64/+13
| | | | | | made unnecessary by r244192. llvm-svn: 244271
* [modules] Defer setting up the lookup table for a DeclContext until we canRichard Smith2015-08-061-74/+69
| | | | | | | | | | | | | | | | determine the primary context, rather than sometimes registering the lookup table on the wrong context. This exposed a couple of bugs: * the odr violation check didn't deal properly with mergeable declarations if the declaration retained by name lookup wasn't in the canonical definition of the class * the (broken) RewriteDecl mechanism would emit two name lookup tables for the same DeclContext into the same module file (one as part of the rewritten declaration and one as a visible update for the old declaration) These are both fixed too. llvm-svn: 244192
* function_ref-ize ExternalASTSource::FindExternalLexicalDecl and remove itsRichard Smith2015-08-051-24/+30
| | | | | | | | useless return value. Switch to using it directly when completing the redeclaration chain for an anonymous declaration, and reduce the set of declarations that we load in the process to just those of the right kind. llvm-svn: 244161
* [AST] ArrayRefize template argument packs. No functionality change intended.Benjamin Kramer2015-08-051-1/+1
| | | | llvm-svn: 244026
* Use llvm::reverse to make a bunch of loops use foreach. NFC.Pete Cooper2015-07-301-5/+4
| | | | | | | | | | | | | | | | In llvm commit r243581, a reverse range adapter was added which allows us to change code such as for (auto I = Fields.rbegin(), E = Fields.rend(); I != E; ++I) { in to for (const FieldDecl *I : llvm::reverse(Fields)) This commit changes a few of the places in clang which are eligible to use this new adapter. llvm-svn: 243663
* Remove some noise "this->"s left behind by r243213.Richard Smith2015-07-301-38/+37
| | | | llvm-svn: 243614
* [modules] Remove redundant information written into DeclContext name lookup ↵Richard Smith2015-07-301-4/+4
| | | | | | tables. We don't need to store the data length twice. llvm-svn: 243612
* [modules] Add an assert for redeclarations that we never added to their redeclRichard Smith2015-07-271-4/+5
| | | | | | | | | | | | | | | chain and fix the cases where it fires. * Handle the __va_list_tag as a predefined decl. Previously we failed to merge sometimes it because it's not visible to name lookup. (In passing, remove redundant __va_list_tag typedefs that we were creating for some ABIs. These didn't affect the mangling or representation of the type.) * For Decls derived from Redeclarable that are not in fact redeclarable (implicit params, function params, ObjC type parameters), remove them from the list of expected redeclarable decls. llvm-svn: 243259
* [Modules] Wrap the main ModuleManager visitor in a function_ref.Benjamin Kramer2015-07-251-72/+55
| | | | | | | Avoids the awkward passing of an opaque void *UserData argument. No functional change intended. llvm-svn: 243213
* ArrayRef-ize a pointer/length pair.Richard Smith2015-07-231-14/+13
| | | | llvm-svn: 242977
* [modules] Stop performing PCM lookups for all identifiers when building with ↵Richard Smith2015-07-221-17/+53
| | | | | | C++ modules. Instead, serialize a list of interesting identifiers and mark those ones out of date on module import. Avoiding the identifier lookups here gives a 20-30% speedup in builds with large numbers of modules. No functionality change intended. llvm-svn: 242868
* [modules] In C++, stop serializing and deserializing a list of declarations inRichard Smith2015-07-211-7/+12
| | | | | | | | | the identifier table. This is redundant, since the TU-scope lookups are also serialized as part of the TU DeclContext, and wasteful in a number of ways. We still emit the decls for PCH / preamble builds, since for those we want identical results, not merely semantically equivalent ones. llvm-svn: 242855
* [modules] Don't save uninteresting identifiers, and don't consider identifiersRichard Smith2015-07-191-5/+13
| | | | | | | to be interesting just because they are the name of a builtin. Reduces the size of an empty module by over 80% (~100KB). llvm-svn: 242650
* Stop treating extension keywords as 'interesting'; we don't allow the extensionRichard Smith2015-07-171-3/+2
| | | | | | | flag to change between serialization and deserialization, so it does not require the identifier to be serialized. llvm-svn: 242567
* Refactor to remove repetition, no functionality change.Richard Smith2015-07-171-40/+27
| | | | llvm-svn: 242564
OpenPOWER on IntegriCloud