summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
* AST: Mangle reference temporaries reliablyDavid Majnemer2014-05-012-4/+7
| | | | | | | | | | | | | | | Summary: Previously, we would generate a single name for all reference temporaries and allow LLVM to rename them for us. Instead, number the reference temporaries as we build them in Sema. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3554 llvm-svn: 207776
* Avoid a potential race between stat() and open() of ASTFileBen Langmuir2014-05-011-1/+5
| | | | | | | | We need to open an ASTFile while checking its expected size and modification time, or another clang instance can modify the file between the stat() and the open(). llvm-svn: 207735
* Defer loading any pending update records until we've finished deserializing.Richard Smith2014-04-302-19/+11
| | | | | | | This fixes a bug where an update record causes us to load an entity that refers to an entity we've not finished loading yet, resulting in badness. llvm-svn: 207603
* [PCH/Modules] Don't tie TargetOptions::LinkerVersion to a module/PCH, it's a ↵Argyrios Kyrtzidis2014-04-292-3/+0
| | | | | | | | driver only thing and doesn't affect any language/preprocessor/etc. semantics. rdar://16714526 llvm-svn: 207570
* Reapply r207477 and r207479 without cyclic dependencyBen Langmuir2014-04-291-8/+123
| | | | | | | | Fixed by moving ProcessWarningOptions from Frontend into Basic. All of the dependencies for ProcessWarningOptions were already in Basic, so this was a small change. llvm-svn: 207549
* Revert r207477 (and r207479), "Check -Werror options during module validation"NAKAMURA Takumi2014-04-291-123/+8
| | | | | | It tried to introduce cyclic dependencies. Serialization shouldn't depend on Frontend, since Frontend depends on Serialization. llvm-svn: 207497
* Check -Werror options during module validationBen Langmuir2014-04-291-8/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch checks whether the diagnostic options that could lead to errors (principally -Werror) are consistent between when a module was built and when it is loaded. If there are new -Werror flags, then the module is rebuilt. In order to canonicalize the options we do this check at the level of the constructed DiagnosticsEngine, which contains the final set of diag to diagnostic level mappings. Currently we only rebuild with the new diagnostic options, but we intend to refine this in the future to include the union of the new and old flags, since we know the old ones did not cause errors. System modules are only rebuilt when -Wsystem-headers is enabled. One oddity is that unlike checking language options, we don’t perform this diagnostic option checking when loading from a precompiled header. The reason for this is that the compiler cannot rebuild the PCH, so anything that requires it to be rebuilt effectively leaks into the build system. And in this case, that would mean the build system understanding the complex relationship between diagnostic options and the underlying diagnostic mappings, which is unreasonable. Skipping the check is safe, because these options do not affect the generated AST. You simply won’t get new build errors due to changed -Werror options automatically, which is also true for non-module cases. llvm-svn: 207477
* Fix leak of GlobalModuleIndex::IdentifierIndex, found by LSan.Nico Weber2014-04-251-1/+3
| | | | llvm-svn: 207262
* When two templates get merged together, also merge their pattern declarationsRichard Smith2014-04-242-28/+99
| | | | | | | | | | | | | | together. This is extremely hairy, because in general we need to have loaded both the template and the pattern before we can determine whether either should be merged, so we temporarily violate the rule that all merging happens before reading a decl ends, but *only* in the case where a template's pattern is being loaded while loading the template itself. In order to accomodate this for class templates, delay loading the injected class name type for the pattern of the template until after we've loaded the template itself, if we happen to load the template first. llvm-svn: 207063
* Make TypeDecl much less friendly.Richard Smith2014-04-231-1/+1
| | | | llvm-svn: 207007
* [OPENMP] parsing 'linear' clause (for directive 'omp simd')Alexander Musman2014-04-222-0/+24
| | | | | | Differential Revision: http://reviews.llvm.org/D3272 llvm-svn: 206891
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-195-130/+464
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* Teach users of OnDiskHashTable to define hash_value and offset typesJustin Bogner2014-04-183-12/+36
| | | | | | | | This paves the way to making OnDiskHashTable work with hashes that are not 32 bits wide and to making OnDiskHashTable work very large hash tables. The LLVM change to use these types is upcoming. llvm-svn: 206640
* Remove OnDiskHashTable.h, since it's been moved to llvmJustin Bogner2014-04-183-16/+16
| | | | llvm-svn: 206637
* Add missing serialization code for one of the CXXRecordDecl definition flags.Richard Smith2014-04-172-0/+2
| | | | llvm-svn: 206493
* Revised per Dmitri's comments. My first exposure to range-based for loops, ↵John Thompson2014-04-171-1/+1
| | | | | | thanks! llvm-svn: 206483
* Revised per Dmitri's comments. My first exposure to range-based for loops, ↵John Thompson2014-04-171-10/+8
| | | | | | thanks! llvm-svn: 206474
* Added dump method for global module index.John Thompson2014-04-161-0/+15
| | | | llvm-svn: 206418
* Add module name and module map file to -module-file-infoBen Langmuir2014-04-141-0/+19
| | | | llvm-svn: 206217
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-144-20/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To differentiate between two modules with the same name, we will consider the path the module map file that they are defined by* part of the ‘key’ for looking up the precompiled module (pcm file). Specifically, this patch renames the precompiled module (pcm) files from cache-path/<module hash>/Foo.pcm to cache-path/<module hash>/Foo-<hash of module map path>.pcm In addition, I’ve taught the ASTReader to re-resolve the names of imported modules during module loading so that if the header search context changes between when a module was originally built and when it is loaded we can rebuild it if necessary. For example, if module A imports module B first time: clang -I /path/to/A -I /path/to/B ... second time: clang -I /path/to/A -I /different/path/to/B ... will now rebuild A as expected. * in the case of inferred modules, we use the module map file that allowed the inference, not the __inferred_module.map file, since the inferred file path is the same for every inferred module. llvm-svn: 206201
* OnDiskHashTable: Make the iterable version separate.Justin Bogner2014-04-143-21/+25
| | | | | | | | | | | | | | | Currently the on disk hash table's key_iterator and data_iterator make the assumption that the table data starts exactly four bytes after the base of the table. This happens to be true for all of the tables we currently iterate over, but not for all of the OnDiskHashTables we currently use. For example, key_ and data_iterator would iterate over meaningless data if they were used on the hash tables in PTHLexer. We make the API safer by breaking this into two types. One doesn't have the iterators, and the other must be told where the payload starts. llvm-svn: 206189
* When module umbrellas change, rebuild themBen Langmuir2014-04-101-59/+63
| | | | | | | With the VFS, it is easy to hit modified umbrellas by overriding the umbrella header, and what we want is to rebuild, not to fail. llvm-svn: 205975
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-092-0/+2
| | | | | | code-completion results. llvm-svn: 205917
* Have validate-system-headers override validate-once-per-build-sessionBen Langmuir2014-04-081-1/+1
| | | | llvm-svn: 205773
* [OPENMP][C++11] Renamed loop vars properly.Alexey Bataev2014-04-041-8/+8
| | | | llvm-svn: 205620
* [OPENMP] Small update for C++11Alexey Bataev2014-04-031-4/+2
| | | | llvm-svn: 205506
* [OPENMP] Implemented 'copyin' clauseAlexey Bataev2014-03-312-0/+22
| | | | llvm-svn: 205164
* Reapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner2014-03-282-62/+84
| | | | | | | | | | | | | Committed this by accident before it was done last time. Original message: Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. llvm-svn: 205062
* Reapply "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner2014-03-282-65/+101
| | | | | | | | | | | | | Committed this by accident before it was done last time. Original message: Rather than rolling our own functions to write little endian data to an ostream, we can use the support in llvm's EndianStream.h. No functional change. llvm-svn: 205061
* Revert "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner2014-03-282-84/+62
| | | | | | This reverts commit r205045. llvm-svn: 205048
* Revert "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner2014-03-282-101/+65
| | | | | | This reverts commit r205044. llvm-svn: 205047
* OnDiskHashTable: Use Endian.h to read little endian ostreamsJustin Bogner2014-03-282-62/+84
| | | | | | | | | Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. llvm-svn: 205045
* OnDiskHashTable: Use EndianStream.h to write little endian ostreamsJustin Bogner2014-03-282-65/+101
| | | | | | | | | Rather than rolling our own functions to write little endian data to an ostream, we can use the support in llvm's EndianStream.h. No functional change. llvm-svn: 205044
* Fix a FIXME, use std::move.Richard Smith2014-03-281-3/+3
| | | | llvm-svn: 205021
* Fix PR18307: Properly (de)serialize inherited constructors and their using ↵Stephan Tolksdorf2014-03-273-8/+29
| | | | | | | | declarations Reviewed in http://llvm-reviews.chandlerc.com/D3102 llvm-svn: 204951
* Comment parsing: when comment ranges are deserialized from multiple modules,Dmitri Gribenko2014-03-271-3/+4
| | | | | | | | | correctly order comments in SourceManager::isBeforeInTranslationUnit() order Unfortunately, this is not as simple as it was implemented previously, and actually requires doing a merge sort. llvm-svn: 204936
* Remove redundant and misleading check. This could also lead to painful cyclicRichard Smith2014-03-251-1/+1
| | | | | | deserialization. llvm-svn: 204695
* Save out a correct lookup table if a lookup table entry is stale (it containsRichard Smith2014-03-251-64/+76
| | | | | | | | | an out-of-date external decls list). This happens if we declare some names, force the lookup table for the decl context to be built, import a module that adds more decls for the name, then write out our module without looking up the name. llvm-svn: 204694
* If a name is injected into an imported inline namespace without reopening thatRichard Smith2014-03-231-3/+8
| | | | | | | namespace, we need to update both the visible names of that namespace and of its enclosing namespace set. llvm-svn: 204570
* When we inject a declaration into a namespace, add the primary DeclContext toRichard Smith2014-03-231-1/+2
| | | | | | | the update set rather than the current DeclContext. Add test for the local extern case too. llvm-svn: 204568
* If a template instantation introduces a name into a namespace, we need to writeRichard Smith2014-03-231-0/+12
| | | | | | | out a visible update record for that namespace even if it was never declared in this module. llvm-svn: 204554
* If an update record makes a declaration interesting, pass it to the consumer.Richard Smith2014-03-232-15/+25
| | | | llvm-svn: 204550
* Emit an update record if we instantiate the definition of a function templateRichard Smith2014-03-224-0/+62
| | | | | | | | specialization from a module. (This can also happen for function template specializations in PCHs if they're instantiated eagerly, because they're constexpr or have a deduced return type.) llvm-svn: 204547
* Fixing code that doesn't compile in MSVC 2012 (but does in MSVC 2013) from ↵Aaron Ballman2014-03-213-17/+25
| | | | | | r204417 and related commits. llvm-svn: 204471
* [OPENMP] parsing of clause 'safelen' (for directive 'omp simd')Alexey Bataev2014-03-212-0/+13
| | | | llvm-svn: 204428
* Serialize and deserialize mangling numbers.Richard Smith2014-03-213-4/+29
| | | | llvm-svn: 204423
* PR19215: When writing/reading a PCH that imported a module, store the locationRichard Smith2014-03-212-18/+36
| | | | | | | at which that PCH imported each visible submodule of the module. Such locations are needed when synthesizing macro directives resulting from the import. llvm-svn: 204417
* When the exception specification for a function in an imported PCH or module isRichard Smith2014-03-204-26/+67
| | | | | | resolved, emit an update record. llvm-svn: 204403
* Refactor and simplify DeclUpdates serialization.Richard Smith2014-03-202-72/+40
| | | | llvm-svn: 204397
* Refactor to move decl update emission into the decl emission loop.Richard Smith2014-03-201-15/+19
| | | | llvm-svn: 204392
OpenPOWER on IntegriCloud