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 | bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4 (patch) | |
tree | 707cccea7fa2a04369d734745e2af81e860a1fde /clang/lib/Serialization/GeneratePCH.cpp | |
parent | 7c5ae7cbc60f1196bd4cde77c68f4b6995596215 (diff) | |
download | llvm-bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4.zip llvm-bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4.tar.gz llvm-bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4.tar.bz2 |
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.
llvm-svn: 279794
Diffstat (limited to 'clang/lib/Serialization/GeneratePCH.cpp')
-rw-r--r-- | clang/lib/Serialization/GeneratePCH.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp index b2d79a2..e1765da 100644 --- a/clang/lib/Serialization/GeneratePCH.cpp +++ b/clang/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. |