Fix encoding/decoding of string literals for big-endian systems
authorMarius Hillenbrand <mhillen@linux.ibm.com>
Tue, 19 Oct 2021 16:09:52 +0000 (18:09 +0200)
committerMarius Hillenbrand <mhillen@linux.ibm.com>
Mon, 8 Nov 2021 13:12:01 +0000 (14:12 +0100)
commit78ce7e567fce86d611353c5a9194833a54a6fbe0
treebd684765321d489471851b8393dd96a5b783f267
parenteb92526d5e04572fdf1d15d2f3ae10a967c2f46f
Fix encoding/decoding of string literals for big-endian systems

Per SPIR-V spec, a string literal's UTF-8 octets are encoded packed into
words with little-endian convention. Explicitly perform that encoding
instead of assuming that the host system is little-endian.

Note that this change requires corresponding fixes in SPIRV-Tools.

Fixes #202
SPIRV/SPVRemapper.cpp
SPIRV/disassemble.cpp
SPIRV/spvIR.h