From: Richard Smith Date: Sat, 15 Sep 2018 01:59:39 +0000 (+0000) Subject: [modules] Don't bother creating a global module fragment when building a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef244e5043f64f3a816073f48195685f2651de91;p=clang [modules] Don't bother creating a global module fragment when building a header module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342307 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 4b0e69c7f6..d777afe981 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -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());