Remove redundant check.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 23 Nov 2012 14:29:54 +0000 (14:29 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 23 Nov 2012 14:29:54 +0000 (14:29 +0000)
llvm-svn: 168515

clang/lib/AST/DeclBase.cpp

index 4400d50..870b8f1 100644 (file)
@@ -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;
   }