Malcolm Parsons via llvm-dev
2016-Nov-29 12:32 UTC
[llvm-dev] RFC: Constructing StringRefs at compile time
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. -- Malcolm Parsons
Mehdi Amini via llvm-dev
2016-Nov-29 17:32 UTC
[llvm-dev] RFC: Constructing StringRefs at compile time
> 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. — Mehdi
Malcolm Parsons via llvm-dev
2016-Nov-29 17:54 UTC
[llvm-dev] RFC: Constructing StringRefs at compile time
On 29 November 2016 at 17:32, Mehdi Amini <mehdi.amini at apple.com> wrote:> Being able to have global table of StringRef was secondary to me, even though it also saved some scanning when performing lookup.If I've got the wrong end of the stick, we can just forget this ever happened. -- Malcolm Parsons