Allow the Info type used in the on-disk hash table generator to have state

llvm-svn: 69616
This commit is contained in:
Douglas Gregor 2009-04-20 19:03:54 +00:00
parent f8b85477ae
commit 35cf42e55e
1 changed files with 9 additions and 4 deletions

View File

@ -184,7 +184,12 @@ public:
insert(Buckets, NumBuckets, new (BA.Allocate<Item>()) Item(key, data));
}
io::Offset Emit(llvm::raw_ostream& out) {
io::Offset Emit(llvm::raw_ostream &out) {
Info InfoObj;
return Emit(out, InfoObj);
}
io::Offset Emit(llvm::raw_ostream &out, Info &InfoObj) {
using namespace clang::io;
// Emit the payload of the table.
@ -202,9 +207,9 @@ public:
for (Item *I = B.head; I ; I = I->next) {
Emit32(out, I->hash);
const std::pair<unsigned, unsigned>& Len =
Info::EmitKeyDataLength(out, I->key, I->data);
Info::EmitKey(out, I->key, Len.first);
Info::EmitData(out, I->key, I->data, Len.second);
InfoObj.EmitKeyDataLength(out, I->key, I->data);
InfoObj.EmitKey(out, I->key, Len.first);
InfoObj.EmitData(out, I->key, I->data, Len.second);
}
}