diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-04-27 17:26:08 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-04-27 17:26:08 +0000 |
commit | 3a947631019015b5d149a5afbba6914d56ca05e7 (patch) | |
tree | 65bb8b65c3333b5c60667be60f42714835054473 /clang/lib/AST/DeclBase.cpp | |
parent | 7efdca5622cfd472ccca6fd2b0b830e526abbd48 (diff) | |
download | bcm5719-llvm-3a947631019015b5d149a5afbba6914d56ca05e7.tar.gz bcm5719-llvm-3a947631019015b5d149a5afbba6914d56ca05e7.zip |
Revert r267691, it caused PR27535.
llvm-svn: 267744
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 338b059e53c..aec3b7cd3bd 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -340,29 +340,25 @@ unsigned Decl::getMaxAlignment() const { return Align; } -bool Decl::isUsed(bool CheckUsedAttr) const { - const Decl *CanonD = getCanonicalDecl(); - if (CanonD->Used) +bool Decl::isUsed(bool CheckUsedAttr) const { + if (Used) return true; - + // Check for used attribute. - // Ask the most recent decl, since attributes accumulate in the redecl chain. - if (CheckUsedAttr && getMostRecentDecl()->hasAttr<UsedAttr>()) + if (CheckUsedAttr && hasAttr<UsedAttr>()) return true; - // The information may have not been deserialized yet. Force deserialization - // to complete the needed information. - return getMostRecentDecl()->getCanonicalDecl()->Used; + return false; } void Decl::markUsed(ASTContext &C) { - if (isUsed()) + if (Used) return; if (C.getASTMutationListener()) C.getASTMutationListener()->DeclarationMarkedUsed(this); - setIsUsed(); + Used = true; } bool Decl::isReferenced() const { |