| 197 | //===----------------------------------------------------------------------===// |
| 198 | |
| 199 | static void writeSectionHeader(raw_ostream &stream, uint8_t sectionID, |
| 200 | uint64_t length, uint64_t alignment) { |
| 201 | EncodingWriter writer(stream); |
| 202 | uint8_t idAndIsAligned = sectionID & 0x7F; |
| 203 | if (alignment > 1) |
| 204 | idAndIsAligned |= 0x80; |
| 205 | writer.writeByte(idAndIsAligned); |
| 206 | writer.writeVarInt(length); |
| 207 | if (alignment > 1) { |
| 208 | writer.writeVarInt(alignment); |
| 209 | writer.alignTo(alignment); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /// Helper function to serialize an APInt. |
| 214 | static void writeAPInt(const APInt &apInt, EncodingWriter &writer) { |
no test coverage detected