Put back a microoptimization with a comment to make it more obvious.

llvm-svn: 188063
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index ed4a034..99a1f77 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -716,13 +716,16 @@
   // Printf and scanf checking.
   llvm::SmallBitVector CheckedVarArgs;
   if (FDecl) {
-    CheckedVarArgs.resize(Args.size());
     for (specific_attr_iterator<FormatAttr>
              I = FDecl->specific_attr_begin<FormatAttr>(),
              E = FDecl->specific_attr_end<FormatAttr>();
-         I != E; ++I)
+         I != E; ++I) {
+      // Only create vector if there are format attributes.
+      CheckedVarArgs.resize(Args.size());
+
       CheckFormatArguments(*I, Args, IsMemberFunction, CallType, Loc, Range,
                            CheckedVarArgs);
+    }
   }
 
   // Refuse POD arguments that weren't caught by the format string