aco: Fixes compiling error about char8_t with c++20

The error is:
../mesa/src/amd/compiler/aco_register_allocation.cpp:382:7: error: no matching function for call to 'printf'
      printf(u8"☐");

Fixes: 209a89e51d ("aco: Convert to use u8 literal for Unicode character to fixes msvc warning")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7318

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18796>
This commit is contained in:
Yonggang Luo 2022-09-25 02:47:00 +08:00 committed by Marge Bot
parent 8ace685432
commit 091249dff4

View file

@ -379,11 +379,11 @@ UNUSED void
print_reg(const RegisterFile& reg_file, PhysReg reg, bool has_adjacent_variable)
{
if (reg_file[reg] == 0xFFFFFFFF) {
printf(u8"");
printf((const char*)u8"");
} else if (reg_file[reg]) {
const bool show_subdword_alloc = (reg_file[reg] == 0xF0000000);
if (show_subdword_alloc) {
const char* block_chars[] = {
auto block_chars = {
// clang-format off
u8"?", u8"", u8"", u8"",
u8"", u8"", u8"", u8"",
@ -397,18 +397,18 @@ print_reg(const RegisterFile& reg_file, PhysReg reg, bool has_adjacent_variable)
index |= 1 << i;
}
}
printf("%s", block_chars[index]);
printf("%s", (const char*)(block_chars.begin()[index]));
} else {
/* Indicate filled register slot */
if (!has_adjacent_variable) {
printf(u8"");
printf((const char*)u8"");
} else {
/* Use a slightly shorter box to leave a small gap between adjacent variables */
printf(u8"");
printf((const char*)u8"");
}
}
} else {
printf(u8"·");
printf((const char*)u8"·");
}
}