llvm.org GIT mirror llvm / 73f3fd7
Fix a bug in bitstream writer handling abbrevs, add value symtab git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36373 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
2 changed file(s) with 16 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
146146 EmitVBR(CodeLen, bitc::CodeLenWidth);
147147 FlushToWord();
148148 BlockScope.push_back(Block(CurCodeSize, Out.size()/4));
149 BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
150
151 // Emit a placeholder, which will be replaced when the block is popped.
152 Emit(0, bitc::BlockSizeWidth);
153
154 CurCodeSize = CodeLen;
155 }
156
157 void ExitBlock() {
158 assert(!BlockScope.empty() && "Block scope imbalance!");
149159
150160 // Delete all abbrevs.
151161 for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
152162 delete CurAbbrevs[i];
153163
154 BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);
155 // Emit a placeholder, which will be replaced when the block is popped.
156 Emit(0, bitc::BlockSizeWidth);
157
158 CurCodeSize = CodeLen;
159 }
160
161 void ExitBlock() {
162 assert(!BlockScope.empty() && "Block scope imbalance!");
163164 const Block &B = BlockScope.back();
164165
165166 // Block tail:
3232 GLOBALCONSTANTS_BLOCK_ID = 3,
3333 FUNCTION_BLOCK_ID = 4,
3434 TYPE_SYMTAB_BLOCK_ID = 5,
35 GLOBAL_SYMTAB_BLOCK_ID = 6
35 VALUE_SYMTAB_BLOCK_ID = 6
3636 };
3737
3838
8080 TST_ENTRY_CODE = 1 // TST_ENTRY: [typeid, namelen, namechar x N]
8181 };
8282
83 // The value symbol table only has one code (VST_ENTRY_CODE).
84 enum ValueSymtabCodes {
85 VST_ENTRY_CODE = 1 // VST_ENTRY: [valid, namelen, namechar x N]
86 };
87
8388 } // End bitc namespace
8489 } // End llvm namespace
8590