The aim of this patch is to break up the larger patch (https://reviews.llvm.org/D111323) to be more upstream friendly. In particular, this patch adds the char encoding sensitive changes but does not use inline namespaces as before. The use of namespaces to build both versions of the library, and localization of error messages will follow in a subsequent patch.
Details
- Reviewers
ldionne • Quuxplusone SeanP zibi - Group Reviewers
Restricted Project Restricted Project - Commits
- rGa1da73961d29: [SystemZ][z/OS] ASCII/EBCDIC support with no coexistence
Diff Detail
Event Timeline
We need to pass "-fzos-le-char-mode=ebcdic for libcxx same as we do for libcxxabi
libcxx/CMakeLists.txt | ||
---|---|---|
477 | add_target_flags_if_supported("-fzos-le-char-mode=ebcdic") |
A couple of minor comments -- I don't see anything wrong specifically with this patch, but I'm eager to see the follow-up patches.
libcxx/include/regex | ||
---|---|---|
1314–1322 | Those should be inline functions instead of macros. | |
libcxxabi/CMakeLists.txt | ||
272 | What does this flag do? Isn't it necessary only when building using EBCDIC? |
libcxxabi/CMakeLists.txt | ||
---|---|---|
272 | This flag ensures that our default encoding is ebcdic. In a subsequent patch, we build the ascii version as a separate library and override this flag. |
libcxx/include/regex | ||
---|---|---|
1314 | If you look at the surrounding code, we uglify everything with double underscores. The reason is that names starting with double underscores are reserved for the implementation, so users wouldn't be allowed to define a macro like is_07 that would (in the status quo) break our implementation. You'll need to do that here. | |
libcxxabi/CMakeLists.txt | ||
272 | I think this should be enclosed in if (MVS) or whatever the CMake check is, then. Otherwise, if another compiler supports that flag (I assume Clang will support that flag at some point?), we'd start using it everywhere. |
LGTM with my __to_lower suggestion.
libcxx/include/regex | ||
---|---|---|
1357 | Can we change this into: __ch = __to_lower(__ch_); Sorry I didn't spot it before. As it stands, it really looks like a bug until you realize __ch is passed by reference. |
add_target_flags_if_supported("-fzos-le-char-mode=ebcdic")