'return' before 'else' is bad style
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 7 Sep 2013 07:11:04 +0000 (07:11 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 7 Sep 2013 07:11:04 +0000 (07:11 +0000)
llvm-svn: 190241

clang/lib/AST/ExprCXX.cpp

index d87c60a..78c7240 100644 (file)
@@ -67,6 +67,7 @@ UuidAttr *CXXUuidofExpr::GetUuidAttrOfType(QualType QT,
   if (!RD)
     return 0;
 
+  // __uuidof can grab UUIDs from template arguments.
   if (ClassTemplateSpecializationDecl *CTSD =
           dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
     const TemplateArgumentList &TAL = CTSD->getTemplateArgs();
@@ -103,12 +104,13 @@ UuidAttr *CXXUuidofExpr::GetUuidAttrOfType(QualType QT,
     }
 
     return UuidForRD;
-  } else
-    for (CXXRecordDecl::redecl_iterator I = RD->redecls_begin(),
-                                        E = RD->redecls_end();
-         I != E; ++I)
-      if (UuidAttr *Uuid = I->getAttr<UuidAttr>())
-        return Uuid;
+  }
+
+  for (CXXRecordDecl::redecl_iterator I = RD->redecls_begin(),
+                                      E = RD->redecls_end();
+       I != E; ++I)
+    if (UuidAttr *Uuid = I->getAttr<UuidAttr>())
+      return Uuid;
 
   return 0;
 }