mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
This commit is contained in:
parent
6e19ab2bbc
commit
57dc179b1f
597 changed files with 1973 additions and 1972 deletions
|
@ -1290,105 +1290,105 @@ StringView Instruction::reg64_name() const
|
|||
return register_name(static_cast<RegisterIndex64>(register_index()));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_o8(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o8(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg8());
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_o16(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o16(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg16());
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_o32(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o32(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg32());
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_o64(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o64(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg64());
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu_reg() const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_reg() const
|
||||
{
|
||||
VERIFY(is_register());
|
||||
return register_name(reg_fpu());
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu_mem(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_mem(Instruction const& insn) const
|
||||
{
|
||||
VERIFY(!is_register());
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu_ax16() const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_ax16() const
|
||||
{
|
||||
VERIFY(is_register());
|
||||
return register_name(reg16());
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu16(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu16(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg_fpu());
|
||||
return DeprecatedString::formatted("word ptr [{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("word ptr [{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu32(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu32(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg_fpu());
|
||||
return DeprecatedString::formatted("dword ptr [{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("dword ptr [{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu64(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu64(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(reg_fpu());
|
||||
return DeprecatedString::formatted("qword ptr [{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("qword ptr [{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_fpu80(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu80(Instruction const& insn) const
|
||||
{
|
||||
VERIFY(!is_register());
|
||||
return DeprecatedString::formatted("tbyte ptr [{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("tbyte ptr [{}]", to_deprecated_string(insn));
|
||||
}
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_mm(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_mm(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(static_cast<MMXRegisterIndex>(m_register_index));
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_xmm(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_xmm(Instruction const& insn) const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(static_cast<XMMRegisterIndex>(m_register_index));
|
||||
return DeprecatedString::formatted("[{}]", to_string(insn));
|
||||
return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string(Instruction const& insn) const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string(Instruction const& insn) const
|
||||
{
|
||||
switch (insn.address_size()) {
|
||||
case AddressSize::Size64:
|
||||
return to_string_a64();
|
||||
return to_deprecated_string_a64();
|
||||
case AddressSize::Size32:
|
||||
return insn.mode() == ProcessorMode::Long ? to_string_a64() : to_string_a32();
|
||||
return insn.mode() == ProcessorMode::Long ? to_deprecated_string_a64() : to_deprecated_string_a32();
|
||||
case AddressSize::Size16:
|
||||
return to_string_a16();
|
||||
return to_deprecated_string_a16();
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_a16() const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a16() const
|
||||
{
|
||||
DeprecatedString base;
|
||||
bool hasDisplacement = false;
|
||||
|
@ -1435,7 +1435,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a16() const
|
|||
return DeprecatedString::formatted("{}{:+#x}", base, (i16)m_displacement16);
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::sib_to_string(ProcessorMode mode) const
|
||||
DeprecatedString MemoryOrRegisterReference::sib_to_deprecated_string(ProcessorMode mode) const
|
||||
{
|
||||
DeprecatedString scale;
|
||||
DeprecatedString index;
|
||||
|
@ -1476,10 +1476,10 @@ DeprecatedString MemoryOrRegisterReference::sib_to_string(ProcessorMode mode) co
|
|||
builder.append(index);
|
||||
builder.append(scale);
|
||||
}
|
||||
return builder.to_string();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_a64() const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a64() const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(static_cast<RegisterIndex64>(m_register_index));
|
||||
|
@ -1505,7 +1505,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a64() const
|
|||
base = "rbp";
|
||||
break;
|
||||
case 4:
|
||||
base = sib_to_string(ProcessorMode::Long);
|
||||
base = sib_to_deprecated_string(ProcessorMode::Long);
|
||||
break;
|
||||
default:
|
||||
base = register_name(RegisterIndex64(m_rm));
|
||||
|
@ -1517,7 +1517,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a64() const
|
|||
return DeprecatedString::formatted("{}{:+#x}", base, (i32)m_displacement32);
|
||||
}
|
||||
|
||||
DeprecatedString MemoryOrRegisterReference::to_string_a32() const
|
||||
DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a32() const
|
||||
{
|
||||
if (is_register())
|
||||
return register_name(static_cast<RegisterIndex32>(m_register_index));
|
||||
|
@ -1540,7 +1540,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a32() const
|
|||
base = "ebp";
|
||||
break;
|
||||
case 4:
|
||||
base = sib_to_string(ProcessorMode::Protected);
|
||||
base = sib_to_deprecated_string(ProcessorMode::Protected);
|
||||
break;
|
||||
default:
|
||||
base = register_name(RegisterIndex32(m_rm));
|
||||
|
@ -1569,7 +1569,7 @@ static DeprecatedString relative_address(u32 origin, bool x32, i32 imm)
|
|||
return DeprecatedString::formatted("{:x}", w + si);
|
||||
}
|
||||
|
||||
DeprecatedString Instruction::to_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const
|
||||
DeprecatedString Instruction::to_deprecated_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const
|
||||
{
|
||||
StringBuilder builder;
|
||||
if (has_segment_prefix())
|
||||
|
@ -1605,11 +1605,11 @@ DeprecatedString Instruction::to_string(u32 origin, SymbolProvider const* symbol
|
|||
// Note: SSE instructions use these to toggle between packed and single data
|
||||
if (has_rep_prefix() && !(m_descriptor->format > __SSE && m_descriptor->format < __EndFormatsWithRMByte))
|
||||
builder.append(m_rep_prefix == Prefix::REPNZ ? "repnz "sv : "repz "sv);
|
||||
to_string_internal(builder, origin, symbol_provider, x32);
|
||||
return builder.to_string();
|
||||
to_deprecated_string_internal(builder, origin, symbol_provider, x32);
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const
|
||||
void Instruction::to_deprecated_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const
|
||||
{
|
||||
if (!m_descriptor) {
|
||||
builder.appendff("db {:02x}", m_op);
|
||||
|
@ -1635,22 +1635,22 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP
|
|||
}
|
||||
};
|
||||
|
||||
auto append_rm8 = [&] { builder.append(m_modrm.to_string_o8(*this)); };
|
||||
auto append_rm16 = [&] { builder.append(m_modrm.to_string_o16(*this)); };
|
||||
auto append_rm8 = [&] { builder.append(m_modrm.to_deprecated_string_o8(*this)); };
|
||||
auto append_rm16 = [&] { builder.append(m_modrm.to_deprecated_string_o16(*this)); };
|
||||
auto append_rm32 = [&] {
|
||||
if (m_operand_size == OperandSize::Size64)
|
||||
builder.append(m_modrm.to_string_o64(*this));
|
||||
builder.append(m_modrm.to_deprecated_string_o64(*this));
|
||||
else
|
||||
builder.append(m_modrm.to_string_o32(*this));
|
||||
builder.append(m_modrm.to_deprecated_string_o32(*this));
|
||||
};
|
||||
auto append_rm64 = [&] { builder.append(m_modrm.to_string_o64(*this)); };
|
||||
auto append_fpu_reg = [&] { builder.append(m_modrm.to_string_fpu_reg()); };
|
||||
auto append_fpu_mem = [&] { builder.append(m_modrm.to_string_fpu_mem(*this)); };
|
||||
auto append_fpu_ax16 = [&] { builder.append(m_modrm.to_string_fpu_ax16()); };
|
||||
auto append_fpu_rm16 = [&] { builder.append(m_modrm.to_string_fpu16(*this)); };
|
||||
auto append_fpu_rm32 = [&] { builder.append(m_modrm.to_string_fpu32(*this)); };
|
||||
auto append_fpu_rm64 = [&] { builder.append(m_modrm.to_string_fpu64(*this)); };
|
||||
auto append_fpu_rm80 = [&] { builder.append(m_modrm.to_string_fpu80(*this)); };
|
||||
auto append_rm64 = [&] { builder.append(m_modrm.to_deprecated_string_o64(*this)); };
|
||||
auto append_fpu_reg = [&] { builder.append(m_modrm.to_deprecated_string_fpu_reg()); };
|
||||
auto append_fpu_mem = [&] { builder.append(m_modrm.to_deprecated_string_fpu_mem(*this)); };
|
||||
auto append_fpu_ax16 = [&] { builder.append(m_modrm.to_deprecated_string_fpu_ax16()); };
|
||||
auto append_fpu_rm16 = [&] { builder.append(m_modrm.to_deprecated_string_fpu16(*this)); };
|
||||
auto append_fpu_rm32 = [&] { builder.append(m_modrm.to_deprecated_string_fpu32(*this)); };
|
||||
auto append_fpu_rm64 = [&] { builder.append(m_modrm.to_deprecated_string_fpu64(*this)); };
|
||||
auto append_fpu_rm80 = [&] { builder.append(m_modrm.to_deprecated_string_fpu80(*this)); };
|
||||
auto append_imm8 = [&] { builder.appendff("{:#02x}", imm8()); };
|
||||
auto append_imm8_2 = [&] { builder.appendff("{:#02x}", imm8_2()); };
|
||||
auto append_imm16 = [&] { builder.appendff("{:#04x}", imm16()); };
|
||||
|
@ -1693,12 +1693,12 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP
|
|||
auto append_relative_imm32 = [&] { formatted_address(origin + 5, x32, i32(imm32())); };
|
||||
|
||||
auto append_mm = [&] { builder.appendff("mm{}", register_index()); };
|
||||
auto append_mmrm32 = [&] { builder.append(m_modrm.to_string_mm(*this)); };
|
||||
auto append_mmrm64 = [&] { builder.append(m_modrm.to_string_mm(*this)); };
|
||||
auto append_mmrm32 = [&] { builder.append(m_modrm.to_deprecated_string_mm(*this)); };
|
||||
auto append_mmrm64 = [&] { builder.append(m_modrm.to_deprecated_string_mm(*this)); };
|
||||
auto append_xmm = [&] { builder.appendff("xmm{}", register_index()); };
|
||||
auto append_xmmrm32 = [&] { builder.append(m_modrm.to_string_xmm(*this)); };
|
||||
auto append_xmmrm64 = [&] { builder.append(m_modrm.to_string_xmm(*this)); };
|
||||
auto append_xmmrm128 = [&] { builder.append(m_modrm.to_string_xmm(*this)); };
|
||||
auto append_xmmrm32 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); };
|
||||
auto append_xmmrm64 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); };
|
||||
auto append_xmmrm128 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); };
|
||||
|
||||
auto append_mm_or_xmm = [&] {
|
||||
if (has_operand_size_override_prefix())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue