[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Benoit Jacob via cfe-commits
bjacob wrote: @s-barannikov > > * the `strlen` is NOT constant-evaluated on MSVC, even the latest version. > > The godbolt link shows otherwise? This is what I see in godbolt - to me this loop looks like strlen: ![{FBB342A5-7B03-4AD6-AB88-01686E1D9B69}](https://github.com/user-attachments/as

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Benoit Jacob via cfe-commits
bjacob wrote: @jrtc27 > const char[] allocates storage for the string contents though, so takes up > space in memory if the string can be merged with others at compile or link > time. There are multiple things being traded off here, and PDE vs PIC/PIE > complicates the story further. So it's

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Benoit Jacob via cfe-commits
bjacob wrote: > I didn't really understand the last paragraph of the PR description. How does > using StringRef instead of StringLiteral reduce relocations? It does not - sorry if that was confusingly worded. What I was trying to say is that using a plain `const char[]` instead of a StringLite

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Benoit Jacob via cfe-commits
@@ -57,7 +57,7 @@ class DeclarationFragments { Keyword, Attribute, NumberLiteral, -StringLiteral, +StringRef, bjacob wrote: Thanks for the heads up -- will fix one by one. Also, note to self: let's leep `StringLiteral` around as deprecate

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Benoit Jacob via cfe-commits
https://github.com/bjacob edited https://github.com/llvm/llvm-project/pull/122366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Remove `StringLiteral` in favor of `StringRef` (PR #122366)

2025-01-09 Thread Benoit Jacob via cfe-commits
@@ -57,7 +57,7 @@ class DeclarationFragments { Keyword, Attribute, NumberLiteral, -StringLiteral, +StringRef, bjacob wrote: good catch! i'll pore over the actual diff line by line to catch more things like this, but I wanted to first see i