diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-15 01:59:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-15 01:59:39 +0000 |
commit | ac9f7fb9a1c6508949aa57e88fe3a73ab4c4b645 (patch) | |
tree | 59c1ee5e2a382313c605341935969d1964f75418 /clang/lib/Sema/Sema.cpp | |
parent | 8b464f299fe0358ed4b82ea269a63155081c73ff (diff) | |
download | bcm5719-llvm-ac9f7fb9a1c6508949aa57e88fe3a73ab4c4b645.tar.gz bcm5719-llvm-ac9f7fb9a1c6508949aa57e88fe3a73ab4c4b645.zip |
[modules] Don't bother creating a global module fragment when building a
header module.
llvm-svn: 342307
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 4b0e69c7f65..d777afe9811 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/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()); |