| ... | ... | @@ -68,13 +68,13 @@ pub fn BitcodeWriter(comptime types: []const type) type { |
| 68 | 68 | in_bits -= n; |
| 69 | 69 | |
| 70 | 70 | if (self.bit_count != 0) return; |
| 71 | | try self.buffer.append(self.bit_buffer); |
| 71 | try self.buffer.append(std.mem.nativeToLittle(u32, self.bit_buffer)); |
| 72 | 72 | self.bit_buffer = 0; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // Write 32-bit chunks of input bits |
| 76 | 76 | while (in_bits >= 32) { |
| 77 | | try self.buffer.append(@truncate(in_buffer)); |
| 77 | try self.buffer.append(std.mem.nativeToLittle(u32, @truncate(in_buffer))); |
| 78 | 78 | |
| 79 | 79 | in_buffer >>= 31; |
| 80 | 80 | in_buffer >>= 1; |
| ... | ... | @@ -153,7 +153,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { |
| 153 | 153 | pub fn alignTo32(self: *BcWriter) Error!void { |
| 154 | 154 | if (self.bit_count == 0) return; |
| 155 | 155 | |
| 156 | | try self.buffer.append(self.bit_buffer); |
| 156 | try self.buffer.append(std.mem.nativeToLittle(u32, self.bit_buffer)); |
| 157 | 157 | self.bit_buffer = 0; |
| 158 | 158 | self.bit_count = 0; |
| 159 | 159 | } |
| ... | ... | @@ -209,7 +209,7 @@ pub fn BitcodeWriter(comptime types: []const type) type { |
| 209 | 209 | try self.bitcode.alignTo32(); |
| 210 | 210 | |
| 211 | 211 | // Set the number of words in the block at the start of the block |
| 212 | | self.bitcode.buffer.items[self.start] = @truncate(self.bitcode.length() - self.start - 1); |
| 212 | self.bitcode.buffer.items[self.start] = std.mem.nativeToLittle(u32, @truncate(self.bitcode.length() - self.start - 1)); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | pub fn writeUnabbrev(self: *Self, code: u32, values: []const u64) Error!void { |