summaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-07-14 21:50:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-07-14 21:50:09 +0000
commit60c99da8ab1afcbf14b4145d3395ff9e35ea6358 (patch)
tree3a8c49285229c93f913c506f8d70ba1619e94b0f /lib/Serialization/ASTWriterDecl.cpp
parenta874687b9f93f13c01b5fcb732c39c0bc45f55fc (diff)
downloadclang-60c99da8ab1afcbf14b4145d3395ff9e35ea6358.tar.gz
[modules] Don't pass interesting decls to the consumer for a module file that's
passed on the command line but never actually used. We consider a (top-level) module to be used if any part of it is imported, either by the current translation unit, or by any part of a top-level module that is itself used. (Put another way, a module is used if an implicit modules build would have loaded its .pcm file.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index 0940dd27d4..6bc7d72c04 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/lib/Serialization/ASTWriterDecl.cpp
@@ -2124,7 +2124,7 @@ static bool isRequiredDecl(const Decl *D, ASTContext &Context,
// ImportDecl is used by codegen to determine the set of imported modules to
// search for inputs for automatic linking; include it if it has a semantic
// effect.
- if (isa<ImportDecl>(D) && !WritingModule)
+ if (isa<ImportDecl>(D))
return true;
return Context.DeclMustBeEmitted(D);