]> granicus.if.org Git - clang/commitdiff
Remove dead code related to the now defunct PCH stat cache.
authorTed Kremenek <kremenek@apple.com>
Tue, 5 Feb 2013 06:21:59 +0000 (06:21 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 5 Feb 2013 06:21:59 +0000 (06:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174342 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReader.cpp
lib/Serialization/ASTReaderInternals.h
lib/Serialization/ASTWriter.cpp

index 92dcc7d70327db2c062910d1966fea5a0b458ecd..dd2d5d12bcc2d78a6f5c21cb52a225aeef738a7c 100644 (file)
@@ -23,8 +23,6 @@
 #include "clang/AST/Type.h"
 #include "clang/AST/TypeLocVisitor.h"
 #include "clang/Basic/FileManager.h"
-#include "clang/Basic/FileSystemStatCache.h"
-#include "clang/Basic/OnDiskHashTable.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/SourceManagerInternals.h"
 #include "clang/Basic/TargetInfo.h"
index dc6ccb72d29e7ab22afe98041f53077ca2820582..5bbb7299d12ee2572bf1e8c753eebee92b4c33d6 100644 (file)
@@ -198,20 +198,7 @@ class HeaderFileInfoTrait {
   const char *FrameworkStrings;
   const char *SearchPath;
   struct stat SearchPathStatBuf;
-  llvm::Optional<int> SearchPathStatResult;
-  
-  int StatSimpleCache(const char *Path, struct stat *StatBuf) {
-    if (Path == SearchPath) {
-      if (!SearchPathStatResult)
-        SearchPathStatResult = stat(Path, &SearchPathStatBuf);
-      
-      *StatBuf = SearchPathStatBuf;
-      return *SearchPathStatResult;
-    }
-    
-    return stat(Path, StatBuf);
-  }
-  
+
 public:
   typedef const char *external_key_type;
   typedef const char *internal_key_type;
index 2d975466b5018cf2e397737d16febb4e12ff705e..4a8cc08d1b1c2930446da8930f3ccae5d51a9464 100644 (file)
@@ -1289,54 +1289,6 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr, StringRef isysroot) {
   Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, data(InputFileOffsets));
 }
 
-//===----------------------------------------------------------------------===//
-// stat cache Serialization
-//===----------------------------------------------------------------------===//
-
-namespace {
-// Trait used for the on-disk hash table of stat cache results.
-class ASTStatCacheTrait {
-public:
-  typedef const char * key_type;
-  typedef key_type key_type_ref;
-
-  typedef struct stat data_type;
-  typedef const data_type &data_type_ref;
-
-  static unsigned ComputeHash(const char *path) {
-    return llvm::HashString(path);
-  }
-
-  std::pair<unsigned,unsigned>
-    EmitKeyDataLength(raw_ostream& Out, const char *path,
-                      data_type_ref Data) {
-    unsigned StrLen = strlen(path);
-    clang::io::Emit16(Out, StrLen);
-    unsigned DataLen = 4 + 4 + 2 + 8 + 8;
-    clang::io::Emit8(Out, DataLen);
-    return std::make_pair(StrLen + 1, DataLen);
-  }
-
-  void EmitKey(raw_ostream& Out, const char *path, unsigned KeyLen) {
-    Out.write(path, KeyLen);
-  }
-
-  void EmitData(raw_ostream &Out, key_type_ref,
-                data_type_ref Data, unsigned DataLen) {
-    using namespace clang::io;
-    uint64_t Start = Out.tell(); (void)Start;
-
-    Emit32(Out, (uint32_t) Data.st_ino);
-    Emit32(Out, (uint32_t) Data.st_dev);
-    Emit16(Out, (uint16_t) Data.st_mode);
-    Emit64(Out, (uint64_t) Data.st_mtime);
-    Emit64(Out, (uint64_t) Data.st_size);
-
-    assert(Out.tell() - Start == DataLen && "Wrong data length");
-  }
-};
-} // end anonymous namespace
-
 //===----------------------------------------------------------------------===//
 // Source Manager Serialization
 //===----------------------------------------------------------------------===//