1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-04-08 09:43:20 +00:00

Add a "PadTo" field to the emitULEB128Bytes method. This will pad out to the

indicated number of bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101684 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2010-04-18 00:51:49 +00:00
parent a370a44a76
commit 21739c1c72

@ -174,13 +174,20 @@ public:
/// emitULEB128Bytes - This callback is invoked when a ULEB128 needs to be
/// written to the output stream.
void emitULEB128Bytes(uint64_t Value) {
void emitULEB128Bytes(uint64_t Value, unsigned PadTo = 0) {
do {
uint8_t Byte = Value & 0x7f;
Value >>= 7;
if (Value) Byte |= 0x80;
if (Value || PadTo != 0) Byte |= 0x80;
emitByte(Byte);
} while (Value);
if (PadTo) {
do {
uint8_t Byte = (PadTo > 1) ? 0x80 : 0x0;
emitByte(Byte);
} while (--PadTo);
}
}
/// emitSLEB128Bytes - This callback is invoked when a SLEB128 needs to be