[cfe-commits] r152166 - /cfe/trunk/lib/AST/Decl.cpp

Daniel Dunbar daniel at zuster.org
Tue Mar 6 15:52:46 PST 2012


Author: ddunbar
Date: Tue Mar  6 17:52:46 2012
New Revision: 152166

URL: http://llvm.org/viewvc/llvm-project?rev=152166&view=rev
Log:
[AST] VarDecl::hasDefinition() - Early exit if we find a strong definition.

Modified:
    cfe/trunk/lib/AST/Decl.cpp

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=152166&r1=152165&r2=152166&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Mar  6 17:52:46 2012
@@ -1313,8 +1313,11 @@
   
   const VarDecl *First = getFirstDeclaration();
   for (redecl_iterator I = First->redecls_begin(), E = First->redecls_end();
-       I != E; ++I)
+       I != E; ++I) {
     Kind = std::max(Kind, (*I)->isThisDeclarationADefinition());
+    if (Kind == Definition)
+      break;
+  }
 
   return Kind;
 }





More information about the cfe-commits mailing list