[llvm-dev] RFC: Constructing StringRefs at compile time

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 29 09:32:29 PST 2016

> On Nov 29, 2016, at 4:32 AM, Malcolm Parsons <malcolm.parsons at gmail.com> wrote:
> On 28 November 2016 at 19:30, Mehdi Amini <mehdi.amini at apple.com> wrote:
>> This thread started with: "There is a desire to be able to create constexpr
>> StringRefs to avoid static initializers for global tables of/containing
>> StringRefs.”
>> I don’t have more information, but maybe Malcolm can elaborate?
> I was restating your motivation from https://reviews.llvm.org/D25639.

The motivation for my work was not static initializers, but avoiding any implicit conversion from const char * to avoid calling useless strlen.
The constexpr part of my work came to avoid having to make the explicit call for literals.
Being able to have global table of StringRef was secondary to me, even though it also saved some scanning when performing lookup.


More information about the llvm-dev mailing list