From: Bill Wendling Date: Sun, 18 Apr 2010 00:51:49 +0000 (+0000) Subject: Add a "PadTo" field to the emitULEB128Bytes method. This will pad out to the X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=21739c1c72c3eadd5635309a8c68b7677f2a32f6;p=oota-llvm.git 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 --- diff --git a/include/llvm/CodeGen/JITCodeEmitter.h b/include/llvm/CodeGen/JITCodeEmitter.h index 5ebfc31e7bb..eb373fb145e 100644 --- a/include/llvm/CodeGen/JITCodeEmitter.h +++ b/include/llvm/CodeGen/JITCodeEmitter.h @@ -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