From d6055341405831ba2a0483b72e8baf0c23de6749 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 26 Aug 2016 00:14:38 +0000 Subject: 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 --- lib/Serialization/GeneratePCH.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Serialization/GeneratePCH.cpp') 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. -- cgit v1.2.1