Note when a decl is used in AST files.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 5 Sep 2013 00:02:25 +0000 (00:02 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 5 Sep 2013 00:02:25 +0000 (00:02 +0000)
commit276dd188c428d4fb1b3e887fe70a929a71892bf9
treeeb49076c4c96fbb6f2efe12c9410cfe119af18e0
parent5c30024fd42868e0850cec1e822671187315c8df
Note when a decl is used in AST files.

When an AST file is built based on another AST file, it can use a decl from
the fist file, and therefore mark the "isUsed" bit.  We need to note this in
the AST file so that the bit is set correctly when the second AST file is
loaded.

This patch introduces the distinction between setIsUsed() and markUsed() so
that we don't call into the ASTMutationListener callback when it wouldn't
be appropriate.

Fixes PR16635.

llvm-svn: 190016
17 files changed:
clang/include/clang/AST/ASTMutationListener.h
clang/include/clang/AST/DeclBase.h
clang/include/clang/Serialization/ASTWriter.h
clang/lib/AST/DeclBase.cpp
clang/lib/Frontend/MultiplexConsumer.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaLambda.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Serialization/ASTCommon.h
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/Inputs/System/usr/include/stdio.h
clang/test/Modules/Inputs/pch-used.h [new file with mode: 0644]
clang/test/Modules/pch-used.m [new file with mode: 0644]