[cfe-commits] r69616 - /cfe/trunk/include/clang/Basic/OnDiskHashTable.h

Douglas Gregor dgregor at apple.com
Mon Apr 20 12:03:55 PDT 2009


Author: dgregor
Date: Mon Apr 20 14:03:54 2009
New Revision: 69616

URL: http://llvm.org/viewvc/llvm-project?rev=69616&view=rev
Log:
Allow the Info type used in the on-disk hash table generator to have state

Modified:
    cfe/trunk/include/clang/Basic/OnDiskHashTable.h

Modified: cfe/trunk/include/clang/Basic/OnDiskHashTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OnDiskHashTable.h?rev=69616&r1=69615&r2=69616&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/OnDiskHashTable.h (original)
+++ cfe/trunk/include/clang/Basic/OnDiskHashTable.h Mon Apr 20 14:03:54 2009
@@ -184,7 +184,12 @@
     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 @@
       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);
       }
     }
     





More information about the cfe-commits mailing list