diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-26 00:14:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-26 00:14:38 +0000 |
commit | d6055341405831ba2a0483b72e8baf0c23de6749 (patch) | |
tree | 14bb1398b43ef6839a95f28c1c768a634f3607e8 /lib/Serialization/GeneratePCH.cpp | |
parent | 28dea68863860c36021cb56254b30aa3821f447e (diff) | |
download | clang-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.cpp | 7 |
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. |