summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve diagnostic mapping terminologyAlp Toker2014-06-102-4/+4
| | | | | | | | | | | | Diagnostic mappings are used to calculate the final severity of diagnostic instances. Detangle the implementation to reflect the terminology used in documentation and bindings. No change in functionality. llvm-svn: 210518
* [OPENMP] Parsing/Sema for OMPLasprivateClause.Alexander Musman2014-06-042-0/+20
| | | | | | Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks. llvm-svn: 210184
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-311-2/+1
| | | | llvm-svn: 209959
* Invalidate the file system cache entries for files that may rebuildBen Langmuir2014-05-301-5/+21
| | | | | | | | | | | | | | | | | | | | | | This reapplies r209910 with a fix for the assertion failures hit on the buildbots. original commit message: I thought we could get away without this, but it means that the FileEntry objects actually refer to the wrong files, since pcms are not updated inplace, they are atomically renamed into place after compiling a module. So we are close to the original behaviour of invalidating the cache for all modules being removed, but now we should only invalidate the ones that depend on whichever module failed to load. Unfortunately I haven't come up with a new test that didn't require a race between parallel invocations of clang. <rdar://problem/17038180> llvm-svn: 209922
* Revert "Invalidate the file system cache entries for files that may rebuild"Ben Langmuir2014-05-301-18/+5
| | | | | | This reverts commit r209910, which is breaking some of the bots. llvm-svn: 209911
* Invalidate the file system cache entries for files that may rebuildBen Langmuir2014-05-301-5/+18
| | | | | | | | | | | | | | | | | | I thought we could get away without this, but it means that the FileEntry objects actually refer to the wrong files, since pcms are not updated inplace, they are atomically renamed into place after compiling a module. So we are close to the original behaviour of invalidating the cache for all modules being removed, but now we should only invalidate the ones that depend on whichever module failed to load. Unfortunately I haven't come up with a new test that didn't require a race between parallel invocations of clang. <rdar://problem/17038180> llvm-svn: 209910
* Parsing/Sema for OMPAlignedClause.Alexander Musman2014-05-292-0/+24
| | | | llvm-svn: 209816
* When merging functions across modules (and in particular, instantiations ofRichard Smith2014-05-291-2/+37
| | | | | | | member functions), ensure that the redecl chain never transitions from 'inline' to 'not inline', since that violates an AST invariant. llvm-svn: 209794
* Parsing/Sema for OMPCollapseClause.Alexander Musman2014-05-272-0/+13
| | | | | | Actual usage in Sema for collapsing loops will in some future patch. llvm-svn: 209660
* Recompute the injected class name type for a class template specializationRichard Smith2014-05-232-5/+1
| | | | | | rather than saving and restoring it. llvm-svn: 209557
* Implemented support for "pragma clang optimize on/off", based on attribute ↵Dario Domizioli2014-05-232-0/+24
| | | | | | | | | | | | | | | | 'optnone'. This patch implements support for selectively disabling optimizations on a range of function definitions through a pragma. The implementation is that all function definitions in the range are decorated with attribute 'optnone'. #pragma clang optimize off // All function definitions in here are decorated with 'optnone'. #pragma clang optimize on // Compilation resumes as normal. llvm-svn: 209510
* Avoid allocating extra memory to handle the lazy definition data pointer forRichard Smith2014-05-221-2/+2
| | | | | | CXXRecordDecls when modules is enabled. llvm-svn: 209482
* If a class template specialization from one module has its definitionRichard Smith2014-05-222-0/+23
| | | | | | | | | instantiated in another module, and the instantiation uses a partial specialization, include the partial specialization and its template arguments in the update record. We'll need them if someone imports the second module and tries to instantiate a member of the template. llvm-svn: 209472
* Frontend: Propagate ASTReaderListener API in ChainedASTReaderListenerJustin Bogner2014-05-221-2/+8
| | | | | | | | | | | | | | | | | ASTReaderListener's documentation states that visitInputFile will be called based on the return values of needsInputFileVisitation and needsSystemInputFileVisitation, but ChainedASTReaderListener may call these methods on a child listener based on the values returned by the other child. Even worse, the calls to visitInputFile may be short-circuited due to the use of the boolean or, so the calls to visit may not occur at all for the second listener. This updates ChainedASTReaderListener::visitInputFile to propagate the ASTReaderListener behaviour to both children. llvm-svn: 209394
* [C++11] Use 'nullptr'. Serialization edition.Craig Topper2014-05-2212-173/+179
| | | | llvm-svn: 209392
* Speculative fix for Windows buildbot after r209138Ben Langmuir2014-05-201-0/+5
| | | | | | | | | It appears that Windows doesn't like renaming over open files, which we do in clearOutputFiles. The file being compiled should be safe to removed, but this isn't very satisfying - we don't want to manually manage the lifetime of files we cannot prove have no references. llvm-svn: 209195
* If two sibling modules declare the same entity, and we indirectly pull aRichard Smith2014-05-192-1/+41
| | | | | | | | declaration of that entity in from one of those modules, keep track of the fact that we've not completed the redeclaration chain yet so that we can pull the remaining declarations in from the other module if they're needed. llvm-svn: 209161
* Don't refresh stat() info for pcm filesBen Langmuir2014-05-191-13/+1
| | | | | | | | Follow-up fix for 209138. Actually, since we already have this file open, we don't want to refresh the stat() info, since that might be newer than what we have open (bad!). llvm-svn: 209143
* Fix use-after-free and spurious error during module loadBen Langmuir2014-05-191-2/+13
| | | | | | | | | | | | | | FileManager::invalidateCache is not safe to call when there may be existing references to the file. What module load failure needs is to refresh so stale stat() info isn't stored. This may be the last user of invalidateCache; I'll take a look and remove it if possible in a future commit. This caused a use-after-free error as well as a spurious error message that a module was "found in both 'X.pcm' and 'X.pcm'" in some cases. llvm-svn: 209138
* If a declaration is loaded, and then a module import adds a redeclaration, thenRichard Smith2014-05-163-34/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ensure that querying the first declaration for its most recent declaration checks for redeclarations from the imported module. This works as follows: * The 'most recent' pointer on a canonical declaration grows a pointer to the external AST source and a generation number (space- and time-optimized for the case where there is no external source). * Each time the 'most recent' pointer is queried, if it has an external source, we check whether it's up to date, and update it if not. * The ancillary data stored on the canonical declaration is allocated lazily to avoid filling it in for declarations that end up being non-canonical. We'll still perform a redundant (ASTContext) allocation if someone asks for the most recent declaration from a decl before setPreviousDecl is called, but such cases are probably all bugs, and are now easy to find. Some finessing is still in order here -- in particular, we use a very general mechanism for handling the DefinitionData pointer on CXXRecordData, and a more targeted approach would be more compact. Also, the MayHaveOutOfDateDef mechanism should now be expunged, since it was addressing only a corner of the full problem space here. That's not covered by this patch. Early performance benchmarks show that this makes no measurable difference to Clang performance without modules enabled (and fixes a major correctness issue with modules enabled). I'll revert if a full performance comparison shows any problems. llvm-svn: 209046
* Merge a couple of copy-and-pasted functionsAlp Toker2014-05-161-53/+28
| | | | | | No change in functionality. llvm-svn: 209005
* Rename SourceManager::createFileIDForMemBuffer()Alp Toker2014-05-161-2/+2
| | | | | | | | It makes more sense to just overload createFileID(). Gardening only. llvm-svn: 209002
* No longer triggering a checked iterator assert on Windows when using ↵Aaron Ballman2014-05-131-1/+1
| | | | | | std::copy while deserializing attributed statements with more than one attribute. llvm-svn: 208702
* Refactor to avoid explicitly listing all the different flavours of redeclarableRichard Smith2014-05-131-56/+43
| | | | | | declarations, and duplicating code between them. llvm-svn: 208662
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-103-2/+4
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* Let ASTReader optionally delete its ASTDeserializationListener.Nico Weber2014-05-081-30/+30
| | | | | | | | | | | | | | | | | | | | Use this to fix the leak of DeserializedDeclsDumper and DeserializedDeclsChecker in FrontendAction (found by LSan), PR19560. The "delete this" bool is necessary because both PCHGenerator and ASTUnit return the same object from both getDeserializationListener() and getASTMutationListener(), so ASTReader can't just have a unique_ptr. It's also not possible to just let FrontendAction (or CompilerInstance) own these listeners due to lifetime issues (see comments on PR19560). Finally, ASTDeserializationListener can't easily be refcounted, since several of the current listeners are allocated on the stack. Having this bool isn't ideal, but it's a pattern that's used in other places in the codebase too, and it seems better than leaking. llvm-svn: 208277
* Fix latent bug. This can't actually manifest at the moment, but is a time-bombRichard Smith2014-05-081-1/+1
| | | | | | for the next time someone adds something to this function. llvm-svn: 208270
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-062-4/+12
| | | | llvm-svn: 208077
* [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP ↵Alexey Bataev2014-05-062-0/+16
| | | | | | clause 'proc_bind' llvm-svn: 208060
* Fix a use-after-free bug I recently introduced in lookupModuleFileBen Langmuir2014-05-041-4/+3
| | | | llvm-svn: 207932
* Replace one-element SmallVectors inside DenseMaps with TinyPtrVector.Benjamin Kramer2014-05-031-4/+3
| | | | | | That's exactly what TinyPtrVector was designed for. No functionality change. llvm-svn: 207919
* 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
OpenPOWER on IntegriCloud