| 355 | } |
| 356 | |
| 357 | static Error format_func_value_pack( |
| 358 | String& sb, |
| 359 | FormatFlags format_flags, |
| 360 | const BaseCompiler* cc, |
| 361 | const FuncValuePack& pack, |
| 362 | const RegOnly* virt_regs) noexcept { |
| 363 | |
| 364 | size_t count = pack.count(); |
| 365 | if (!count) { |
| 366 | return sb.append("void"); |
| 367 | } |
| 368 | |
| 369 | if (count > 1) { |
| 370 | ASMJIT_PROPAGATE(sb.append('[')); |
| 371 | } |
| 372 | |
| 373 | for (uint32_t value_index = 0; value_index < count; value_index++) { |
| 374 | const FuncValue& value = pack[value_index]; |
| 375 | if (!value) { |
| 376 | break; |
| 377 | } |
| 378 | |
| 379 | if (value_index) { |
| 380 | ASMJIT_PROPAGATE(sb.append(", ")); |
| 381 | } |
| 382 | |
| 383 | ASMJIT_PROPAGATE(format_func_value(sb, format_flags, cc, value)); |
| 384 | |
| 385 | if (virt_regs) { |
| 386 | const VirtReg* virt_reg = nullptr; |
| 387 | static const char null_reg[] = "<none>"; |
| 388 | |
| 389 | if (virt_regs[value_index].is_reg() && cc->is_virt_id_valid(virt_regs[value_index].id())) { |
| 390 | virt_reg = cc->virt_reg_by_id(virt_regs[value_index].id()); |
| 391 | } |
| 392 | |
| 393 | ASMJIT_PROPAGATE(sb.append(' ')); |
| 394 | |
| 395 | if (virt_reg) { |
| 396 | ASMJIT_PROPAGATE(Formatter::format_virt_reg_name(sb, virt_reg)); |
| 397 | } |
| 398 | else { |
| 399 | ASMJIT_PROPAGATE(sb.append(null_reg, sizeof(null_reg) - 1)); |
| 400 | } |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | if (count > 1) { |
| 405 | ASMJIT_PROPAGATE(sb.append(']')); |
| 406 | } |
| 407 | |
| 408 | return Error::kOk; |
| 409 | } |
| 410 | |
| 411 | static Error format_func_rets( |
| 412 | String& sb, |
no test coverage detected