[PATCH] Improve #pragma comment(lib) support

Richard Smith richard at metafoo.co.uk
Thu May 23 15:59:50 PDT 2013


On Thu, May 23, 2013 at 3:59 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Thu, May 23, 2013 at 2:02 PM, Rui Ueyama <ruiu at google.com> wrote:
>
>> -    Consumer.HandleDependentLibrary(Arg);
>> +    // If the argument does not end in .lib, automatically add the
>> suffix. This
>> +    // matches the behavior of MSVC.
>> +    std::string ArgStr = Arg;
>> +    StringRef End = Arg.substr( Arg.size() - 4 );
>>
>> Looks like it's not safe if Arg.size() < 4.
>>
>
> Please use StringRef::endswith for this.
>

Oh, wait, you want a case-insensitive comparison. :-(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130523/a497d0ab/attachment.html>


More information about the cfe-commits mailing list