Repository: dotnet/runtime
File: src/coreclr/jit/emitwasm.cpp (C++)

Code before:
size_t emitter::emitOutputPaddedReloc(uint8_t* destination)
{
    if (destination)
    {
        static_assert(PADDED_RELOC_SIZE > 1);
        // Write zeroes with the bit set that indicates another byte is coming
        for (unsigned i = 1; i < PADDED_RELOC_SIZE; i++)
            *(destination++ + writeableOffset) = 0x80;

        // Write a final zero
        *(destination + writeableOffset) = 0x0;
    }
    return PADDED_RELOC_SIZE;
}

size_t emitter::emitOutputConstant(uint8_t* destination, const instrDesc* id, bool isSigned, CorInfoReloc relocType)
{
    if (id->idIsCnsReloc())
    {
        emitRecordRelocation(destination, (void*)emitGetInsSC(id), relocType);
        return emitOutputPaddedReloc(destination);
    }
    else if (isSigned)
        return emitOutputSLEB128(destination, (int64_t)emitGetInsSC(id));
    else
        return emitOutputULEB128(destination, (uint64_t)emitGetInsSC(id));
}

size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
{
    const bool SIGNED = true;
    const bool UNSIGNED = false;

    BYTE*       dst    = *dp;
    size_t      sz     = emitSizeOfInsDsc(id);
    instruction ins    = id->idIns();
    insFormat   insFmt = id->idInsFmt();
    unsigned    opcode = GetInsOpcode(ins);

    switch (insFmt)
    {
        case IF_OPCODE:
        {
            dst += emitOutputOpcode(dst, ins);
            break;
        }
        case IF_BLOCK:
            dst += emitOutputOpcode(dst, ins);
            dst += emitOutputByte(dst, 0x40 /* block type of void */);
            break;
        case IF_ULEB128:

Review comment (suggestion):
```suggestion

    if (isSigned)
        return emitOutputSLEB128(destination, (int64_t)emitGetInsSC(id));
    else
        return emitOutputULEB128(destination, (uint64_t)emitGetInsSC(id));
```
The Jit style is to not have `else`s after a `return` in the preceding `if`.

Code after:

size_t emitter::emitOutputPaddedReloc(uint8_t* destination)
{
    static_assert(PADDED_RELOC_SIZE > 1);
    // Write zeroes with the bit set that indicates another byte is coming
    for (unsigned i = 0; i < PADDED_RELOC_SIZE - 1; i++)
    {
        destination += emitOutputByte(destination, 0x80);
    }

    emitOutputByte(destination, 0x0);
    return PADDED_RELOC_SIZE;
}

size_t emitter::emitOutputConstant(uint8_t* destination, const instrDesc* id, bool isSigned, CorInfoReloc relocType)
{
    if (id->idIsCnsReloc())
    {
        emitRecordRelocation(destination, (void*)emitGetInsSC(id), relocType);
        return emitOutputPaddedReloc(destination);
    }

    if (isSigned)
    {
        return emitOutputSLEB128(destination, (int64_t)emitGetInsSC(id));
    }
    else
    {
        return emitOutputULEB128(destination, (uint64_t)emitGetInsSC(id));
    }
}

size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
{
    const bool SIGNED   = true;
    const bool UNSIGNED = false;

    BYTE*       dst    = *dp;
    size_t      sz     = emitSizeOfInsDsc(id);
    instruction ins    = id->idIns();
    insFormat   insFmt = id->idInsFmt();
    unsigned    opcode = GetInsOpcode(ins);

    switch (insFmt)
    {
        case IF_OPCODE:
        {
            dst += emitOutputOpcode(dst, ins);
            break;
        }
        case IF_BLOCK: