Usually the frontend communicates the size of wchar_t via metadata and
we can optimize wcslen (and possibly other calls in the future). In
cases without the wchar_size metadata we would previously try to guess
the correct size based on the target triple; however this is fragile to
keep up to date and may miss users manually changing the size via flags.
Better be safe and stop guessing and optimizing if the frontend didn't
communicate the size.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
After thinking about it some more, I decided that we better leave the logic to decide on the wchar_t size to a C frontend.
Related/motivated by the discussion in https://reviews.llvm.org/D37891
Comment Actions
This is pretty awesome. I assume that you will do a corresponding change in clang to remove the single use of that function?