[cfe-commits] r69584 - in /cfe/trunk: include/clang/Basic/OnDiskHashTable.h tools/clang-cc/CacheTokens.cpp

Douglas Gregor dgregor at apple.com
Mon Apr 20 00:36:27 PDT 2009


Author: dgregor
Date: Mon Apr 20 02:36:26 2009
New Revision: 69584

URL: http://llvm.org/viewvc/llvm-project?rev=69584&view=rev
Log:
Make the on-disk hash table usable with non-file
raw_ostreams. Requires LLVM r69583.

Modified:
    cfe/trunk/include/clang/Basic/OnDiskHashTable.h
    cfe/trunk/tools/clang-cc/CacheTokens.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Basic/OnDiskHashTable.h (original)
+++ cfe/trunk/include/clang/Basic/OnDiskHashTable.h Mon Apr 20 02:36:26 2009
@@ -73,7 +73,7 @@
   Out << (unsigned char)(V >> 56);
 }
 
-inline void Pad(llvm::raw_fd_ostream& Out, unsigned A) {
+inline void Pad(llvm::raw_ostream& Out, unsigned A) {
   Offset off = (Offset) Out.tell();
   uint32_t n = ((uintptr_t)(off+A-1) & ~(uintptr_t)(A-1)) - off;
   for (; n ; --n)
@@ -184,7 +184,7 @@
     insert(Buckets, NumBuckets, new (BA.Allocate<Item>()) Item(key, data));
   }
   
-  io::Offset Emit(llvm::raw_fd_ostream& out) {
+  io::Offset Emit(llvm::raw_ostream& out) {
     using namespace clang::io;
 
     // Emit the payload of the table.
@@ -193,7 +193,6 @@
       if (!B.head) continue;
       
       // Store the offset for the data of this bucket.
-      // FIXME: need tell() to work on other raw ostreams
       B.off = out.tell();
       
       // Write out the number of items in the bucket.

Modified: cfe/trunk/tools/clang-cc/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/CacheTokens.cpp?rev=69584&r1=69583&r2=69584&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/CacheTokens.cpp (original)
+++ cfe/trunk/tools/clang-cc/CacheTokens.cpp Mon Apr 20 02:36:26 2009
@@ -604,7 +604,7 @@
     return std::make_pair(n, sizeof(uint32_t));
   }
   
-  static void EmitKey(llvm::raw_fd_ostream& Out, PTHIdKey* key, unsigned n) {
+  static void EmitKey(llvm::raw_ostream& Out, PTHIdKey* key, unsigned n) {
     // Record the location of the key data.  This is used when generating
     // the mapping from persistent IDs to strings.
     key->FileOffset = Out.tell();





More information about the cfe-commits mailing list