]> granicus.if.org Git - clang/commit
[modules] Don't pass interesting decls to the consumer for a module file that's
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 14 Jul 2016 21:50:09 +0000 (21:50 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 14 Jul 2016 21:50:09 +0000 (21:50 +0000)
commit60c99da8ab1afcbf14b4145d3395ff9e35ea6358
tree3a8c49285229c93f913c506f8d70ba1619e94b0f
parenta874687b9f93f13c01b5fcb732c39c0bc45f55fc
[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
include/clang/Serialization/ASTReader.h
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriterDecl.cpp
test/Modules/unused-global-init.cpp [new file with mode: 0644]