]> granicus.if.org Git - clang/commitdiff
Allow the Info type used in the on-disk hash table generator to have state
authorDouglas Gregor <dgregor@apple.com>
Mon, 20 Apr 2009 19:03:54 +0000 (19:03 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 20 Apr 2009 19:03:54 +0000 (19:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69616 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/OnDiskHashTable.h

index f84b7f24a9afa898c946187b2d7ef01605cc7f32..631d497f1aba554b1d357611ea497cfbb93b8044 100644 (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);
       }
     }