From: Benjamin Kramer Date: Fri, 9 Aug 2013 09:39:17 +0000 (+0000) Subject: Put back a microoptimization with a comment to make it more obvious. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=541a28f4eed4b2d8c057d5c51142d176c9c561de;p=clang Put back a microoptimization with a comment to make it more obvious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188063 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index ed4a034675..99a1f77390 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -716,13 +716,16 @@ void Sema::checkCall(NamedDecl *FDecl, // Printf and scanf checking. llvm::SmallBitVector CheckedVarArgs; if (FDecl) { - CheckedVarArgs.resize(Args.size()); for (specific_attr_iterator I = FDecl->specific_attr_begin(), E = FDecl->specific_attr_end(); - 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