[llvm] [LoopIdiom] Don't introduce `wcslen` calls when `wchar` size is not the default (PR #213629)

Ömer Sinan Ağacan via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 01:00:03 PDT 2026


osa1 wrote:

> I think we should be making changes from the clang side: clang should add an explicit module attribute when it thinks it's in a scenario with mismatched wchar_t

I talked to some clang devs about this and we don't see a way to detect incompatibilities between the `wcslen`'s TU and the current TU, so I don't think this can be done currently.

I haven't read the whole thread myself yet, but I was also told that in #195149 the conclusion so far is that we don't want to (or can't, fesibly) have any kind of guardrails regarding the wcslen ABI imcompatibility on the libc++ side.

I still think it should be an option to just close #190340 as WAI, but this PR only improves things in some cases and can't break code that's already running fine today. So we should also be able to merge this.

https://github.com/llvm/llvm-project/pull/213629


More information about the llvm-commits mailing list