diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:17:04 +0000 |
| commit | b915e9e0fc85ba6f398b3fab0db6a81a8913af94 (patch) | |
| tree | 98b8f811c7aff2547cab8642daf372d6c59502fb /include/llvm/Bitcode/BitstreamWriter.h | |
| parent | 6421cca32f69ac849537a3cff78c352195e99f1b (diff) | |
Notes
Diffstat (limited to 'include/llvm/Bitcode/BitstreamWriter.h')
| -rw-r--r-- | include/llvm/Bitcode/BitstreamWriter.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index d613f5e18954..8eb6e8aef7a2 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -112,6 +112,11 @@ public: &Out[ByteNo], NewWord, BitNo & 7); } + void BackpatchWord64(uint64_t BitNo, uint64_t Val) { + BackpatchWord(BitNo, (uint32_t)Val); + BackpatchWord(BitNo + 32, (uint32_t)(Val >> 32)); + } + void Emit(uint32_t Val, unsigned NumBits) { assert(NumBits && NumBits <= 32 && "Invalid value size!"); assert((Val & ~(~0U >> (32-NumBits))) == 0 && "High bits set!"); @@ -131,15 +136,6 @@ public: CurBit = (CurBit+NumBits) & 31; } - void Emit64(uint64_t Val, unsigned NumBits) { - if (NumBits <= 32) - Emit((uint32_t)Val, NumBits); - else { - Emit((uint32_t)Val, 32); - Emit((uint32_t)(Val >> 32), NumBits-32); - } - } - void FlushToWord() { if (CurBit) { WriteWord(CurValue); @@ -506,9 +502,10 @@ public: //===--------------------------------------------------------------------===// /// EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK. - void EnterBlockInfoBlock(unsigned CodeWidth) { - EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, CodeWidth); + void EnterBlockInfoBlock() { + EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, 2); BlockInfoCurBID = ~0U; + BlockInfoRecords.clear(); } private: /// SwitchToBlockID - If we aren't already talking about the specified block |
