diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-04-18 00:51:49 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-04-18 00:51:49 +0000 |
commit | 21739c1c72c3eadd5635309a8c68b7677f2a32f6 (patch) | |
tree | b904bdd40685c5ccd00ff6d9a8afd92c1e7fd900 /include/llvm/CodeGen/JITCodeEmitter.h | |
parent | a370a44a7648f409ed26d3300f249f625780e24e (diff) | |
download | llvm-21739c1c72c3eadd5635309a8c68b7677f2a32f6.tar.gz llvm-21739c1c72c3eadd5635309a8c68b7677f2a32f6.tar.bz2 llvm-21739c1c72c3eadd5635309a8c68b7677f2a32f6.tar.xz |
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
Diffstat (limited to 'include/llvm/CodeGen/JITCodeEmitter.h')
-rw-r--r-- | include/llvm/CodeGen/JITCodeEmitter.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/JITCodeEmitter.h b/include/llvm/CodeGen/JITCodeEmitter.h index 5ebfc31e7b..eb373fb145 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 |