llvm-project
393f5e5a - [clang] Fix encoding handling of asm strings (#169803)

Commit
5 days ago
[clang] Fix encoding handling of asm strings (#169803) This patch builds upon https://github.com/llvm/llvm-project/pull/138895 and introduces a new ConversionAction parameter to ParseStringLiteralExpression to allow asm strings to be, for z/OS, initially evaluated in IBM-1047 (so that numeric escape sequences denote IBM-1047 code points) before being converted to UTF-8 for further processing (e.g., parsing for operand references). For example, on z/OS we want \174 to map to the '@' character in IBM-1047 regardless of fexec-charset. `__asm__("\174asm_sym")` This is required because there are variant characters in the ebcdic family and it is common on the z/OS platform to compile with an fexec-charset set to an ebcdic (non-IBM-1047) codepage. This would result in different values for ("@asm_sym") If there is a constexpr in place of the asm string, the sequence of char values produced will be converted (for all targets, not only for z/OS) from the literal encoding to UTF-8 for further processing, except when the literal encoding is UTF-8.
Author
Parents
Loading