summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticSerializationKinds.td
Commit message (Collapse)AuthorAgeFilesLines
* [ODRHash] Revert r307743 which reverted r307720Richard Trieu2017-07-151-24/+46
| | | | | | | | Reapply r307720 to allow processing of constructors and destructors. Reuse the diagnostics for CXXMethodDecl for them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308077 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Revert r307720 to fix buildbot.Richard Trieu2017-07-121-46/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307743 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Support more method types.Richard Trieu2017-07-111-24/+46
| | | | | | | | Hash CXXConstructorDecl and CXXDestructorDecl. Extend the diagnostics from CXXMethodDecl to include constructors and destructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307720 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Support FriendDeclRichard Trieu2017-07-081-4/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307458 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Supply more information when generic error message is emitted.Richard Trieu2017-06-211-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305872 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Hash VarDecl members.Richard Trieu2017-06-161-6/+24
| | | | | | | | These VarDecl's are static data members of classes. Since the initializers are also hashed, this also provides checking for default arguments to methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305543 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add diagnostic messages for typedef and type alias.Richard Trieu2017-06-121-5/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305238 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Make diagnostic message more readable.Richard Trieu2017-06-081-4/+6
| | | | | | | | Change the diagnostic message from r304956 to be less confusing by reordering the flow of information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304962 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Change the fall-back diagnostic error.Richard Trieu2017-06-081-0/+7
| | | | | | | | Provide a little more information when a ODR violation is detected, but the specific error could not be diagnosed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304956 91177308-0d34-0410-b5e6-96231b3b80d8
* Support lazy stat'ing of files referenced by module maps.Richard Smith2017-06-021-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for a `header` declaration in a module map to specify certain `stat` information (currently, size and mtime) about that header file. This has two purposes: - It removes the need to eagerly `stat` every file referenced by a module map. Instead, we track a list of unresolved header files with each size / mtime (actually, for simplicity, we track submodules with such headers), and when attempting to look up a header file based on a `FileEntry`, we check if there are any unresolved header directives with that `FileEntry`'s size / mtime and perform deferred `stat`s if so. - It permits a preprocessed module to be compiled without the original files being present on disk. The only reason we used to need those files was to get the `stat` information in order to do header -> module lookups when using the module. If we're provided with the `stat` information in the preprocessed module, we can avoid requiring the files to exist. Unlike most `header` directives, if a `header` directive with `stat` information has no corresponding on-disk file the enclosing module is *not* marked unavailable (so that behavior is consistent regardless of whether we've resolved a header directive, and so that preprocessed modules don't get marked unavailable). We could actually do this for all `header` directives: the only reason we mark the module unavailable if headers are missing is to give a diagnostic slightly earlier (rather than waiting until we actually try to build the module / load and validate its .pcm file). Differential Revision: https://reviews.llvm.org/D33703 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304515 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add support for array and decayed types, and parameter names and ↵Richard Trieu2017-05-021-2/+8
| | | | | | types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301989 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r300001 "Revert r298824 & r298816, recommit r298742 & r298754"Hans Wennborg2017-04-121-12/+2
| | | | | | It caused PR32640. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300074 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r298824 & r298816, recommit r298742 & r298754Richard Trieu2017-04-111-2/+12
| | | | | | | | | | | | | | r299989 fixes the underlying issue by waiting long enough to late parsed arguments to be processed before doing an calculating the hash. r298742 [ODRHash] Add error messages for mismatched parameters in methods. r298754 [ODRHash] Add support for array and decayed types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300001 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r298742 "[ODRHash] Add error messages for mismatched parameters in ↵Vassil Vassilev2017-03-261-12/+2
| | | | | | | | | methods." I failed to revert this in r298816. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298824 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 298754 and 298742.Vassil Vassilev2017-03-261-2/+2
| | | | | | | They broke llvm modules builds and our internal modules infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298816 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add support for array and decayed types.Richard Trieu2017-03-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298754 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add error messages for mismatched parameters in methods.Richard Trieu2017-03-241-2/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298742 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "Modules: Cache PCMs in memory and avoid a use-after-free"Duncan P. N. Exon Smith2017-03-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r298185, effectively reapplying r298165, after fixing the new unit tests (PR32338). The memory buffer generator doesn't null-terminate the MemoryBuffer it creates; this version of the commit informs getMemBuffer about that to avoid the assert. Original commit message follows: ---- Clang's internal build system for implicit modules uses lock files to ensure that after a process writes a PCM it will read the same one back in (without contention from other -cc1 commands). Since PCMs are read from disk repeatedly while invalidating, building, and importing, the lock is not released quickly. Furthermore, the LockFileManager is not robust in every environment. Other -cc1 commands can stall until timeout (after about eight minutes). This commit changes the lock file from being necessary for correctness to a (possibly dubious) performance hack. The remaining benefit is to reduce duplicate work in competing -cc1 commands which depend on the same module. Follow-up commits will change the internal build system to continue after a timeout, and reduce the timeout. Perhaps we should reconsider blocking at all. This also fixes a use-after-free, when one part of a compilation validates a PCM and starts using it, and another tries to swap out the PCM for something new. The PCMCache is a new type called MemoryBufferCache, which saves memory buffers based on their filename. Its ownership is shared by the CompilerInstance and ModuleManager. - The ModuleManager stores PCMs there that it loads from disk, never touching the disk if the cache is hot. - When modules fail to validate, they're removed from the cache. - When a CompilerInstance is spawned to build a new module, each already-loaded PCM is assumed to be valid, and is frozen to avoid the use-after-free. - Any newly-built module is written directly to the cache to avoid the round-trip to the filesystem, making lock files unnecessary for correctness. Original patch by Manman Ren; most testcases by Adrian Prantl! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298278 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Modules: Cache PCMs in memory and avoid a use-after-free"Renato Golin2017-03-181-5/+0
| | | | | | This reverts commit r298165, as it broke the ARM builds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298185 91177308-0d34-0410-b5e6-96231b3b80d8
* Modules: Cache PCMs in memory and avoid a use-after-freeDuncan P. N. Exon Smith2017-03-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang's internal build system for implicit modules uses lock files to ensure that after a process writes a PCM it will read the same one back in (without contention from other -cc1 commands). Since PCMs are read from disk repeatedly while invalidating, building, and importing, the lock is not released quickly. Furthermore, the LockFileManager is not robust in every environment. Other -cc1 commands can stall until timeout (after about eight minutes). This commit changes the lock file from being necessary for correctness to a (possibly dubious) performance hack. The remaining benefit is to reduce duplicate work in competing -cc1 commands which depend on the same module. Follow-up commits will change the internal build system to continue after a timeout, and reduce the timeout. Perhaps we should reconsider blocking at all. This also fixes a use-after-free, when one part of a compilation validates a PCM and starts using it, and another tries to swap out the PCM for something new. The PCMCache is a new type called MemoryBufferCache, which saves memory buffers based on their filename. Its ownership is shared by the CompilerInstance and ModuleManager. - The ModuleManager stores PCMs there that it loads from disk, never touching the disk if the cache is hot. - When modules fail to validate, they're removed from the cache. - When a CompilerInstance is spawned to build a new module, each already-loaded PCM is assumed to be valid, and is frozen to avoid the use-after-free. - Any newly-built module is written directly to the cache to avoid the round-trip to the filesystem, making lock files unnecessary for correctness. Original patch by Manman Ren; most testcases by Adrian Prantl! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298165 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add support for detecting different method properties.Richard Trieu2017-03-041-2/+14
| | | | | | | | | Now print diagnostics for static, virtual, inline, volatile, and const differences in methods. Also use DeclarationName instead of IdentifierInfo for additional robustness in diagnostic printing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296932 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add basic support for CXXRecordDeclRichard Trieu2017-02-281-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296521 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Finish FieldDecl support by handling mutable and initializers.Richard Trieu2017-02-241-2/+8
| | | | | | | https://reviews.llvm.org/rL296170 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296198 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add handling of bitfieldsRichard Trieu2017-02-241-2/+8
| | | | | | | Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296170 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add handling of TypedefType and DeclarationNameRichard Trieu2017-02-241-2/+2
| | | | | | | Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296078 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Add IdentiferInfo and FieldDecl support.Richard Trieu2017-02-231-4/+6
| | | | | | | | | | IdentifierInfo is hashed based on the stored string. FieldDecl versus other Decl is now detected, as well as differently named fields. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295911 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] static_cast and Stmt hashing.Richard Trieu2017-02-221-2/+16
| | | | | | | | | | | Add support for static_cast in classes. Add pointer-independent profiling for Stmt's, sharing most of the logic with Stmt::Profile. This is the first of the deep sub-Decl diffing for error messages. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295890 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more ODR checking.Richard Trieu2017-02-221-0/+9
| | | | | | | | | | | Add the basics for the ODRHash class, which will only process Decl's from a whitelist, which currently only has AccessSpecDecl. Different access specifiers in merged classes can now be detected. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295800 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r295421, new ODR checker for modules, to fix build bot.Richard Trieu2017-02-171-64/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295427 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better ODR checking for modules.Richard Trieu2017-02-171-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A slightly weaker form of ODR checking than previous attempts, but hopefully won't break the modules build bot. Future work will be needed to catch all cases. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295421 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r295284: Add better ODR checking for modules.Richard Trieu2017-02-161-64/+0
| | | | | | | Fix modules build bot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295293 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better ODR checking for modules.Richard Trieu2017-02-161-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit r293585 that was reverted in r293611 with new fixes. The previous issue was determined to be an overly aggressive AST visitor from forward declared objects. The visitor will now only deeply visit certain Decl's and only do a shallow information extraction from all other Decl's. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295284 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r293585 "Add better ODR checking for modules."Sam McCall2017-01-311-64/+0
| | | | | | | | | | | We're seeing what we believe are false positives. (It's hard to tell with the available diagnostics, and I'm not sure how to reduce them yet). I'll send Richard reproduction details offline. djasper/chandlerc suggested this should be a warning for now, to make rolling it out feasible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293611 91177308-0d34-0410-b5e6-96231b3b80d8
* Add better ODR checking for modules.Richard Trieu2017-01-311-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taked from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293585 91177308-0d34-0410-b5e6-96231b3b80d8
* Module: correctly set the module file kind when emitting file_modified.Manman Ren2016-10-211-0/+6
| | | | | | | | | rdar://28503343 Differential Revision: http://reviews.llvm.org/D25806 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284899 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-031-0/+4
| | | | | | | | | | | | | | | | | | | | | Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251955 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use fprintf to emit this diagnostic!Richard Smith2015-09-011-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246526 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] PR22534: Load files specified by -fmodule-file= eagerly. In ↵Richard Smith2015-08-091-3/+14
| | | | | | particular, this avoids the need to re-parse module map files when using such a module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244416 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Start moving the module visibility information off the Module itself.Richard Smith2015-05-011-3/+0
| | | | | | | | It has no place there; it's not a property of the Module, and it makes restoring the visibility set when we leave a submodule more difficult. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236300 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Mangle the IsSystem bit into the .pcm file name"Ben Langmuir2015-02-191-3/+0
| | | | | | | | While I investigate some possible problems with this patch. This reverts commit r228966 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229910 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH/Modules] Check that the specific module cache path the PCH was built ↵Argyrios Kyrtzidis2015-02-191-0/+2
| | | | | | | | | | | | with, is the same as the one in the current compiler invocation. If they differ reject the PCH. This protects against the badness occurring from getting modules loaded from different module caches (see crashes). rdar://19889860 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229909 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle the IsSystem bit into the .pcm file nameBen Langmuir2015-02-121-0/+3
| | | | | | | | | When mangling the module map path into a .pcm file name, also mangle the IsSystem bit, which can also depend on the header search paths. For example, the user may change from -I to -isystem. This can affect diagnostics in the importing TU. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228966 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] If we import a module, and we've seen a module map that describes theRichard Smith2014-12-061-0/+3
| | | | | | | | | | module, use the path from the module map file in preference to the path from the .pcm file when resolving relative paths in the .pcm file. This allows diagnostics (and .d output) to give relative paths if the module was found via a relative path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223577 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-221-1/+3
| | | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220359 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify all the module map files for a pcm are the same on loadBen Langmuir2014-08-121-0/+3
| | | | | | | | | | We already verified the primary module map file (either the one that defines the top-level module, or the one that allows inferring it if it is an inferred framework module). Now we also verify any other module map files that define submodules, such as when there is a module.private.modulemap file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215455 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r207477 and r207479 without cyclic dependencyBen Langmuir2014-04-291-0/+2
| | | | | | | | Fixed by moving ProcessWarningOptions from Frontend into Basic. All of the dependencies for ProcessWarningOptions were already in Basic, so this was a small change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207549 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r207477 (and r207479), "Check -Werror options during module validation"NAKAMURA Takumi2014-04-291-2/+0
| | | | | | It tried to introduce cyclic dependencies. Serialization shouldn't depend on Frontend, since Frontend depends on Serialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207497 91177308-0d34-0410-b5e6-96231b3b80d8
* Check -Werror options during module validationBen Langmuir2014-04-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207477 91177308-0d34-0410-b5e6-96231b3b80d8
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-191-0/+7
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206680 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206201 91177308-0d34-0410-b5e6-96231b3b80d8