[cfe-dev] StringLiteral API clarification?

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 13 12:14:48 PDT 2020


You would probably have to query some unicode API to get answers in code
points. LLVM strings are always assumed to be in UTF-8, so the results of
these functions are probably always bytes.

On Thu, Mar 12, 2020 at 1:46 AM Marcus Johnson via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi guys,
>
> I'm working on extending format string validation, and I was going through
> the FormatStringLiteral -> StringLiteral -> StringRef
>
> and I'm just wondering what the following functions mean?
>
> strLen()
>
> getLengthInBytes()
>
> *getLength()*
>
> size()
>
> What do these functions return?
>
> How do I get the size of a string in CodeUnits or CodePoints?
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200313/01663eb7/attachment.html>


More information about the cfe-dev mailing list