Example #1
0
void PreambleFileStatusCache::update(const vfs::FileSystem &FS, vfs::Status S) {
  SmallString<32> PathStore(S.getName());
  if (FS.makeAbsolute(PathStore))
    return;
  // Do not cache status for the main file.
  if (PathStore == MainFilePath)
    return;
  // Stores the latest status in cache as it can change in a preamble build.
  StatCache.insert({PathStore, std::move(S)});
}
Example #2
0
static void copyStatusToFileData(const vfs::Status &Status,
                                 FileData &Data) {
  Data.Name = Status.getName();
  Data.Size = Status.getSize();
  Data.ModTime = Status.getLastModificationTime().toEpochTime();
  Data.UniqueID = Status.getUniqueID();
  Data.IsDirectory = Status.isDirectory();
  Data.IsNamedPipe = Status.getType() == llvm::sys::fs::file_type::fifo_file;
  Data.InPCH = false;
}