StringLiteral API clarification?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

StringLiteral API clarification?

suyash singh via cfe-dev
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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: StringLiteral API clarification?

suyash singh via cfe-dev
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 <[hidden email]> 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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev