[PATCH] D25639: Add ctor for string literal to StringRef, and make explicit the conversion from const char *

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 15 01:08:57 PDT 2016


This patch does the same thing effectively.
On Fri, Oct 14, 2016 at 11:00 PM Noel Grandin <noelgrandin at gmail.com> wrote:

> grandinj added a comment.
>
> You might like to take a look at the ConstCharArrayDetector stuff in the
> LibreOffice codebase here:
>
>
> https://cgit.freedesktop.org/libreoffice/core/tree/include/rtl/ustring.hxx
>
> where Stephan Bergman has implemented optimisations to avoid calling
> strlen() at runtime when dealing with static const char arrays.
>
> As far as I know, clang will compute strlen() at compile time if it knows
> the string being passed is a static constant
>
>
> https://reviews.llvm.org/D25639
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161015/ac3dc071/attachment.html>


More information about the llvm-commits mailing list