[llvm-commits] [llvm] r101684 - /llvm/trunk/include/llvm/CodeGen/JITCodeEmitter.h

Bill Wendling isanbard at gmail.com
Sat Apr 17 17:51:49 PDT 2010


Author: void
Date: Sat Apr 17 19:51:49 2010
New Revision: 101684

URL: http://llvm.org/viewvc/llvm-project?rev=101684&view=rev
Log:
Add a "PadTo" field to the emitULEB128Bytes method. This will pad out to the
indicated number of bytes.

Modified:
    llvm/trunk/include/llvm/CodeGen/JITCodeEmitter.h

Modified: llvm/trunk/include/llvm/CodeGen/JITCodeEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/JITCodeEmitter.h?rev=101684&r1=101683&r2=101684&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/JITCodeEmitter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/JITCodeEmitter.h Sat Apr 17 19:51:49 2010
@@ -174,13 +174,20 @@
 
   /// 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





More information about the llvm-commits mailing list