[PATCH] D41590: Improve performance TokenizeWindowsCommandLine

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 23:36:38 PST 2017


On Wed, Dec 27, 2017 at 4:33 PM, Zachary Turner <zturner at google.com> wrote:

>
> On Tue, Dec 26, 2017 at 11:28 PM Rui Ueyama via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> ruiu added inline comments.
>>
>>
>> ================
>> Comment at: llvm/lib/Support/CommandLine.cpp:692
>> +static bool isWhitespace(char C) {
>> +  switch(C) {
>> +    case ' ':
>> ----------------
>> I'd ignore formfeed and vertical tab, and write like this
>>
>>   return C == ' ' || C = '\t' || C = '\r' || C = '\n';
>
> Why not just call std::isspace?
>

I think what he was trying to do is to avoid the cost of function call.
Also, isspace is location-aware and thus not that convenient to use, no?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171227/44d8f346/attachment.html>


More information about the llvm-commits mailing list