From: Rafael Espindola Date: Fri, 23 Nov 2012 14:29:54 +0000 (+0000) Subject: Remove redundant check. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=385e1d9fd05cdebf00924489788409f6853579bf;p=clang Remove redundant check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168515 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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()) 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()) || I->Used) + if (I->Used) return true; }