MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / format_func_value_pack

Function format_func_value_pack

lib/asmjit/asmjit/core/formatter.cpp:357–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357static 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
411static Error format_func_rets(
412 String& sb,

Callers 2

format_func_retsFunction · 0.85
format_func_argsFunction · 0.85

Calls 6

format_func_valueFunction · 0.85
format_virt_reg_nameFunction · 0.85
countMethod · 0.45
appendMethod · 0.45
is_regMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected