r342307 - [modules] Don't bother creating a global module fragment when building a
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 14 18:59:40 PDT 2018
Author: rsmith
Date: Fri Sep 14 18:59:39 2018
New Revision: 342307
URL: http://llvm.org/viewvc/llvm-project?rev=342307&view=rev
Log:
[modules] Don't bother creating a global module fragment when building a
header module.
Modified:
cfe/trunk/lib/Sema/Sema.cpp
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=342307&r1=342306&r2=342307&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Fri Sep 14 18:59:39 2018
@@ -827,7 +827,9 @@ void Sema::emitAndClearUnusedLocalTypede
/// 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());
More information about the cfe-commits
mailing list