[PATCH] D26332: Add a user-defined literal for StringRef

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 06:51:16 PST 2016


Going to have to block this. I tried to add a UDL recently and was blocked
on the grounds that UDLs are not welcome in the codebase, so i guess the
same applies here
On Sun, Nov 6, 2016 at 4:46 AM Paweł Żukowski <p.z.idlecode at gmail.com>
wrote:

> idlecode added inline comments.
>
>
> ================
> Comment at: include/llvm/ADT/StringRef.h:778
> +
> +  namespace operators {
> +  /// User defined literal
> ----------------
> Does this operator need it's own namespace?
>
>
> ================
> Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1221
>      MCSymbol *AddrSymbol =
> -        OutContext.getOrCreateSymbol(StringRef("__morestack_addr"));
> +        OutContext.getOrCreateSymbol("__morestack_addr"_sr);
>      OutStreamer->EmitLabel(AddrSymbol);
> ----------------
> `getOrCreateSymbol` takes Twine as argument so `StringRef` conversion is
> not needed.
> There is few other such use-cases but it would be quite tedious to fix
> them all manually - maybe clang-tidy could take care of it in the future.
>
>
> https://reviews.llvm.org/D26332
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161106/cdf7219d/attachment.html>


More information about the llvm-commits mailing list