]> granicus.if.org Git - clang/commitdiff
[modules] Don't bother creating a global module fragment when building a
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 15 Sep 2018 01:59:39 +0000 (01:59 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 15 Sep 2018 01:59:39 +0000 (01:59 +0000)
header module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342307 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp

index 4b0e69c7f656559a1d8235d947fa473d15bc601b..d777afe981163fc0527fe95e72a546dc9d9a1a72 100644 (file)
@@ -827,7 +827,9 @@ void Sema::emitAndClearUnusedLocalTypedefWarnings() {
 /// is parsed. Note that the ASTContext may have already injected some
 /// declarations.
 void Sema::ActOnStartOfTranslationUnit() {
-  if (getLangOpts().ModulesTS) {
+  if (getLangOpts().ModulesTS &&
+      (getLangOpts().getCompilingModule() == LangOptions::CMK_ModuleInterface ||
+       getLangOpts().getCompilingModule() == LangOptions::CMK_None)) {
     SourceLocation StartOfTU =
         SourceMgr.getLocForStartOfFile(SourceMgr.getMainFileID());