diff options
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 4400d503f2..870b8f11d7 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -261,9 +261,10 @@ bool Decl::isUsed(bool CheckUsedAttr) const { if (CheckUsedAttr && hasAttr<UsedAttr>()) return true; - // Check redeclarations for used attribute. + // Check redeclarations. We merge attributes, so we don't need to check + // attributes in all redeclarations. for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) { - if ((CheckUsedAttr && I->hasAttr<UsedAttr>()) || I->Used) + if (I->Used) return true; } |