diff options
author | David Blaikie <dblaikie@gmail.com> | 2018-11-08 20:47:30 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2018-11-08 20:47:30 +0000 |
commit | 436f7b6d8a38be0d6f69754117fecf8f52c2cab7 (patch) | |
tree | 1737fd0599417a1c484a7894ad528c7a69ee394f /clang/lib/Frontend/CompilerInstance.cpp | |
parent | a684a99441367b8e0dda222178156e827e93e3c2 (diff) | |
download | bcm5719-llvm-436f7b6d8a38be0d6f69754117fecf8f52c2cab7.tar.gz bcm5719-llvm-436f7b6d8a38be0d6f69754117fecf8f52c2cab7.zip |
[Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too
The current version only emits the below error for a module (attempted to be loaded) from the `prebuilt-module-path`:
```
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```
With this change, if the prebuilt module is used, we allow the proper diagnostic behind the configuration mismatch to be shown.
```
error: POSIX thread support was disabled in PCH file but is currently enabled
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```
(A few lines later an error is emitted anyways, so there is no reason not to complain for configuration mismatches if a config mismatch is found and kills the build.)
Reviewed By: dblaikie
Tags: #clang
Differential Revision: https://reviews.llvm.org/D53334
llvm-svn: 346439
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 719474dc765..be38c69235f 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1727,7 +1727,9 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, // module cache, we don't know how to rebuild modules. unsigned ARRFlags = Source == ModuleCache ? ASTReader::ARR_OutOfDate | ASTReader::ARR_Missing : - ASTReader::ARR_ConfigurationMismatch; + Source == PrebuiltModulePath ? + 0 : + ASTReader::ARR_ConfigurationMismatch; switch (ModuleManager->ReadAST(ModuleFileName, Source == PrebuiltModulePath ? serialization::MK_PrebuiltModule |