summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-17 23:14:26 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-17 23:14:26 +0000
commitebada077d93b0fe4134b347a90efec665b629b25 (patch)
treefc8a35501d61d350fe217f80b702858eb4d6eb28 /clang/lib/AST/DeclBase.cpp
parent6b98f7129f535bba826bb7dfa3a7fd6297330448 (diff)
downloadbcm5719-llvm-ebada077d93b0fe4134b347a90efec665b629b25.tar.gz
bcm5719-llvm-ebada077d93b0fe4134b347a90efec665b629b25.zip
Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and a few other places, want only to consider the "used" bit to determine, e.g, whether to perform template instantiation. Fixes a linkage issue with Boost.Serialization. llvm-svn: 106252
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index f1b78e40fc8..104df7ae84f 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -212,17 +212,17 @@ ASTContext &Decl::getASTContext() const {
return getTranslationUnitDecl()->getASTContext();
}
-bool Decl::isUsed() const {
+bool Decl::isUsed(bool CheckUsedAttr) const {
if (Used)
return true;
// Check for used attribute.
- if (hasAttr<UsedAttr>())
+ if (CheckUsedAttr && hasAttr<UsedAttr>())
return true;
// Check redeclarations for used attribute.
for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
- if (I->hasAttr<UsedAttr>() || I->Used)
+ if ((CheckUsedAttr && I->hasAttr<UsedAttr>()) || I->Used)
return true;
}
OpenPOWER on IntegriCloud