diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-11-23 14:29:54 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-11-23 14:29:54 +0000 |
commit | 385e1d9fd05cdebf00924489788409f6853579bf (patch) | |
tree | daeff055c038b672a8e52621ff64d7e9f3d39fcb /lib/AST/DeclBase.cpp | |
parent | 4875bf2dc8e4ac99863c4756857e553e02090b48 (diff) |
Remove redundant check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168515 91177308-0d34-0410-b5e6-96231b3b80d8
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; } |