summaryrefslogtreecommitdiff
path: root/lib/Serialization/GeneratePCH.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-08-26 00:14:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-08-26 00:14:38 +0000
commitd6055341405831ba2a0483b72e8baf0c23de6749 (patch)
tree14bb1398b43ef6839a95f28c1c768a634f3607e8 /lib/Serialization/GeneratePCH.cpp
parent28dea68863860c36021cb56254b30aa3821f447e (diff)
downloadclang-d6055341405831ba2a0483b72e8baf0c23de6749.tar.gz
C++ Modules TS: add frontend support for building pcm files from module
interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/GeneratePCH.cpp')
-rw-r--r--lib/Serialization/GeneratePCH.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Serialization/GeneratePCH.cpp b/lib/Serialization/GeneratePCH.cpp
index b2d79a2087..e1765dafd9 100644
--- a/lib/Serialization/GeneratePCH.cpp
+++ b/lib/Serialization/GeneratePCH.cpp
@@ -46,10 +46,13 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) {
return;
Module *Module = nullptr;
- if (PP.getLangOpts().CompilingModule) {
+ if (PP.getLangOpts().isCompilingModule()) {
Module = PP.getHeaderSearchInfo().lookupModule(
PP.getLangOpts().CurrentModule, /*AllowSearch*/ false);
- assert(Module && "emitting module but current module doesn't exist");
+ if (!Module) {
+ assert(hasErrors && "emitting module but current module doesn't exist");
+ return;
+ }
}
// Emit the PCH file to the Buffer.