FileManager.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. //===--- FileManager.cpp - File System Probing and Caching ----------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file implements the FileManager interface.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // TODO: This should index all interesting directories with dirent calls.
  15. // getdirentries ?
  16. // opendir/readdir_r/closedir ?
  17. //
  18. //===----------------------------------------------------------------------===//
  19. #include "clang/Basic/FileManager.h"
  20. #include "clang/Basic/FileSystemStatCache.h"
  21. #include "llvm/ADT/SmallString.h"
  22. #include "llvm/Support/FileSystem.h"
  23. #include "llvm/Support/MemoryBuffer.h"
  24. #include "llvm/Support/raw_ostream.h"
  25. #include "llvm/Support/Path.h"
  26. #include "llvm/Support/system_error.h"
  27. #include "llvm/Config/llvm-config.h"
  28. #include <map>
  29. #include <set>
  30. #include <string>
  31. // FIXME: This is terrible, we need this for ::close.
  32. #if !defined(_MSC_VER) && !defined(__MINGW32__)
  33. #include <unistd.h>
  34. #include <sys/uio.h>
  35. #else
  36. #include <io.h>
  37. #endif
  38. using namespace clang;
  39. // FIXME: Enhance libsystem to support inode and other fields.
  40. #include <sys/stat.h>
  41. /// NON_EXISTENT_DIR - A special value distinct from null that is used to
  42. /// represent a dir name that doesn't exist on the disk.
  43. #define NON_EXISTENT_DIR reinterpret_cast<DirectoryEntry*>((intptr_t)-1)
  44. /// NON_EXISTENT_FILE - A special value distinct from null that is used to
  45. /// represent a filename that doesn't exist on the disk.
  46. #define NON_EXISTENT_FILE reinterpret_cast<FileEntry*>((intptr_t)-1)
  47. FileEntry::~FileEntry() {
  48. // If this FileEntry owns an open file descriptor that never got used, close
  49. // it.
  50. if (FD != -1) ::close(FD);
  51. }
  52. //===----------------------------------------------------------------------===//
  53. // Windows.
  54. //===----------------------------------------------------------------------===//
  55. #ifdef LLVM_ON_WIN32
  56. namespace {
  57. static std::string GetFullPath(const char *relPath) {
  58. char *absPathStrPtr = _fullpath(NULL, relPath, 0);
  59. assert(absPathStrPtr && "_fullpath() returned NULL!");
  60. std::string absPath(absPathStrPtr);
  61. free(absPathStrPtr);
  62. return absPath;
  63. }
  64. }
  65. class FileManager::UniqueDirContainer {
  66. /// UniqueDirs - Cache from full path to existing directories/files.
  67. ///
  68. llvm::StringMap<DirectoryEntry> UniqueDirs;
  69. public:
  70. /// getDirectory - Return an existing DirectoryEntry with the given
  71. /// name if there is already one; otherwise create and return a
  72. /// default-constructed DirectoryEntry.
  73. DirectoryEntry &getDirectory(const char *Name,
  74. const struct stat & /*StatBuf*/) {
  75. std::string FullPath(GetFullPath(Name));
  76. return UniqueDirs.GetOrCreateValue(FullPath).getValue();
  77. }
  78. size_t size() const { return UniqueDirs.size(); }
  79. };
  80. class FileManager::UniqueFileContainer {
  81. /// UniqueFiles - Cache from full path to existing directories/files.
  82. ///
  83. llvm::StringMap<FileEntry, llvm::BumpPtrAllocator> UniqueFiles;
  84. public:
  85. /// getFile - Return an existing FileEntry with the given name if
  86. /// there is already one; otherwise create and return a
  87. /// default-constructed FileEntry.
  88. FileEntry &getFile(const char *Name, const struct stat & /*StatBuf*/) {
  89. std::string FullPath(GetFullPath(Name));
  90. // Lowercase string because Windows filesystem is case insensitive.
  91. FullPath = StringRef(FullPath).lower();
  92. return UniqueFiles.GetOrCreateValue(FullPath).getValue();
  93. }
  94. size_t size() const { return UniqueFiles.size(); }
  95. };
  96. //===----------------------------------------------------------------------===//
  97. // Unix-like Systems.
  98. //===----------------------------------------------------------------------===//
  99. #else
  100. class FileManager::UniqueDirContainer {
  101. /// UniqueDirs - Cache from ID's to existing directories/files.
  102. std::map<std::pair<dev_t, ino_t>, DirectoryEntry> UniqueDirs;
  103. public:
  104. /// getDirectory - Return an existing DirectoryEntry with the given
  105. /// ID's if there is already one; otherwise create and return a
  106. /// default-constructed DirectoryEntry.
  107. DirectoryEntry &getDirectory(const char * /*Name*/,
  108. const struct stat &StatBuf) {
  109. return UniqueDirs[std::make_pair(StatBuf.st_dev, StatBuf.st_ino)];
  110. }
  111. size_t size() const { return UniqueDirs.size(); }
  112. };
  113. class FileManager::UniqueFileContainer {
  114. /// UniqueFiles - Cache from ID's to existing directories/files.
  115. std::set<FileEntry> UniqueFiles;
  116. public:
  117. /// getFile - Return an existing FileEntry with the given ID's if
  118. /// there is already one; otherwise create and return a
  119. /// default-constructed FileEntry.
  120. FileEntry &getFile(const char * /*Name*/, const struct stat &StatBuf) {
  121. return
  122. const_cast<FileEntry&>(
  123. *UniqueFiles.insert(FileEntry(StatBuf.st_dev,
  124. StatBuf.st_ino,
  125. StatBuf.st_mode)).first);
  126. }
  127. size_t size() const { return UniqueFiles.size(); }
  128. };
  129. #endif
  130. //===----------------------------------------------------------------------===//
  131. // Common logic.
  132. //===----------------------------------------------------------------------===//
  133. FileManager::FileManager(const FileSystemOptions &FSO)
  134. : FileSystemOpts(FSO),
  135. UniqueRealDirs(*new UniqueDirContainer()),
  136. UniqueRealFiles(*new UniqueFileContainer()),
  137. SeenDirEntries(64), SeenFileEntries(64), NextFileUID(0) {
  138. NumDirLookups = NumFileLookups = 0;
  139. NumDirCacheMisses = NumFileCacheMisses = 0;
  140. }
  141. FileManager::~FileManager() {
  142. delete &UniqueRealDirs;
  143. delete &UniqueRealFiles;
  144. for (unsigned i = 0, e = VirtualFileEntries.size(); i != e; ++i)
  145. delete VirtualFileEntries[i];
  146. for (unsigned i = 0, e = VirtualDirectoryEntries.size(); i != e; ++i)
  147. delete VirtualDirectoryEntries[i];
  148. }
  149. void FileManager::addStatCache(FileSystemStatCache *statCache,
  150. bool AtBeginning) {
  151. assert(statCache && "No stat cache provided?");
  152. if (AtBeginning || StatCache.get() == 0) {
  153. statCache->setNextStatCache(StatCache.take());
  154. StatCache.reset(statCache);
  155. return;
  156. }
  157. FileSystemStatCache *LastCache = StatCache.get();
  158. while (LastCache->getNextStatCache())
  159. LastCache = LastCache->getNextStatCache();
  160. LastCache->setNextStatCache(statCache);
  161. }
  162. void FileManager::removeStatCache(FileSystemStatCache *statCache) {
  163. if (!statCache)
  164. return;
  165. if (StatCache.get() == statCache) {
  166. // This is the first stat cache.
  167. StatCache.reset(StatCache->takeNextStatCache());
  168. return;
  169. }
  170. // Find the stat cache in the list.
  171. FileSystemStatCache *PrevCache = StatCache.get();
  172. while (PrevCache && PrevCache->getNextStatCache() != statCache)
  173. PrevCache = PrevCache->getNextStatCache();
  174. assert(PrevCache && "Stat cache not found for removal");
  175. PrevCache->setNextStatCache(statCache->getNextStatCache());
  176. }
  177. /// \brief Retrieve the directory that the given file name resides in.
  178. /// Filename can point to either a real file or a virtual file.
  179. static const DirectoryEntry *getDirectoryFromFile(FileManager &FileMgr,
  180. StringRef Filename,
  181. bool CacheFailure) {
  182. if (Filename.empty())
  183. return NULL;
  184. if (llvm::sys::path::is_separator(Filename[Filename.size() - 1]))
  185. return NULL; // If Filename is a directory.
  186. StringRef DirName = llvm::sys::path::parent_path(Filename);
  187. // Use the current directory if file has no path component.
  188. if (DirName.empty())
  189. DirName = ".";
  190. return FileMgr.getDirectory(DirName, CacheFailure);
  191. }
  192. /// Add all ancestors of the given path (pointing to either a file or
  193. /// a directory) as virtual directories.
  194. void FileManager::addAncestorsAsVirtualDirs(StringRef Path) {
  195. StringRef DirName = llvm::sys::path::parent_path(Path);
  196. if (DirName.empty())
  197. return;
  198. llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
  199. SeenDirEntries.GetOrCreateValue(DirName);
  200. // When caching a virtual directory, we always cache its ancestors
  201. // at the same time. Therefore, if DirName is already in the cache,
  202. // we don't need to recurse as its ancestors must also already be in
  203. // the cache.
  204. if (NamedDirEnt.getValue())
  205. return;
  206. // Add the virtual directory to the cache.
  207. DirectoryEntry *UDE = new DirectoryEntry;
  208. UDE->Name = NamedDirEnt.getKeyData();
  209. NamedDirEnt.setValue(UDE);
  210. VirtualDirectoryEntries.push_back(UDE);
  211. // Recursively add the other ancestors.
  212. addAncestorsAsVirtualDirs(DirName);
  213. }
  214. /// getDirectory - Lookup, cache, and verify the specified directory
  215. /// (real or virtual). This returns NULL if the directory doesn't
  216. /// exist.
  217. ///
  218. const DirectoryEntry *FileManager::getDirectory(StringRef DirName,
  219. bool CacheFailure) {
  220. // stat doesn't like trailing separators.
  221. // At least, on Win32 MSVCRT, stat() cannot strip trailing '/'.
  222. // (though it can strip '\\')
  223. if (DirName.size() > 1 && llvm::sys::path::is_separator(DirName.back()))
  224. DirName = DirName.substr(0, DirName.size()-1);
  225. ++NumDirLookups;
  226. llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
  227. SeenDirEntries.GetOrCreateValue(DirName);
  228. // See if there was already an entry in the map. Note that the map
  229. // contains both virtual and real directories.
  230. if (NamedDirEnt.getValue())
  231. return NamedDirEnt.getValue() == NON_EXISTENT_DIR
  232. ? 0 : NamedDirEnt.getValue();
  233. ++NumDirCacheMisses;
  234. // By default, initialize it to invalid.
  235. NamedDirEnt.setValue(NON_EXISTENT_DIR);
  236. // Get the null-terminated directory name as stored as the key of the
  237. // SeenDirEntries map.
  238. const char *InterndDirName = NamedDirEnt.getKeyData();
  239. // Check to see if the directory exists.
  240. struct stat StatBuf;
  241. if (getStatValue(InterndDirName, StatBuf, 0/*directory lookup*/)) {
  242. // There's no real directory at the given path.
  243. if (!CacheFailure)
  244. SeenDirEntries.erase(DirName);
  245. return 0;
  246. }
  247. // It exists. See if we have already opened a directory with the
  248. // same inode (this occurs on Unix-like systems when one dir is
  249. // symlinked to another, for example) or the same path (on
  250. // Windows).
  251. DirectoryEntry &UDE = UniqueRealDirs.getDirectory(InterndDirName, StatBuf);
  252. NamedDirEnt.setValue(&UDE);
  253. if (!UDE.getName()) {
  254. // We don't have this directory yet, add it. We use the string
  255. // key from the SeenDirEntries map as the string.
  256. UDE.Name = InterndDirName;
  257. }
  258. return &UDE;
  259. }
  260. /// getFile - Lookup, cache, and verify the specified file (real or
  261. /// virtual). This returns NULL if the file doesn't exist.
  262. ///
  263. const FileEntry *FileManager::getFile(StringRef Filename, bool openFile,
  264. bool CacheFailure) {
  265. ++NumFileLookups;
  266. // See if there is already an entry in the map.
  267. llvm::StringMapEntry<FileEntry *> &NamedFileEnt =
  268. SeenFileEntries.GetOrCreateValue(Filename);
  269. // See if there is already an entry in the map.
  270. if (NamedFileEnt.getValue())
  271. return NamedFileEnt.getValue() == NON_EXISTENT_FILE
  272. ? 0 : NamedFileEnt.getValue();
  273. ++NumFileCacheMisses;
  274. // By default, initialize it to invalid.
  275. NamedFileEnt.setValue(NON_EXISTENT_FILE);
  276. // Get the null-terminated file name as stored as the key of the
  277. // SeenFileEntries map.
  278. const char *InterndFileName = NamedFileEnt.getKeyData();
  279. // Look up the directory for the file. When looking up something like
  280. // sys/foo.h we'll discover all of the search directories that have a 'sys'
  281. // subdirectory. This will let us avoid having to waste time on known-to-fail
  282. // searches when we go to find sys/bar.h, because all the search directories
  283. // without a 'sys' subdir will get a cached failure result.
  284. const DirectoryEntry *DirInfo = getDirectoryFromFile(*this, Filename,
  285. CacheFailure);
  286. if (DirInfo == 0) { // Directory doesn't exist, file can't exist.
  287. if (!CacheFailure)
  288. SeenFileEntries.erase(Filename);
  289. return 0;
  290. }
  291. // FIXME: Use the directory info to prune this, before doing the stat syscall.
  292. // FIXME: This will reduce the # syscalls.
  293. // Nope, there isn't. Check to see if the file exists.
  294. int FileDescriptor = -1;
  295. struct stat StatBuf;
  296. if (getStatValue(InterndFileName, StatBuf, &FileDescriptor)) {
  297. // There's no real file at the given path.
  298. if (!CacheFailure)
  299. SeenFileEntries.erase(Filename);
  300. return 0;
  301. }
  302. if (FileDescriptor != -1 && !openFile) {
  303. close(FileDescriptor);
  304. FileDescriptor = -1;
  305. }
  306. // It exists. See if we have already opened a file with the same inode.
  307. // This occurs when one dir is symlinked to another, for example.
  308. FileEntry &UFE = UniqueRealFiles.getFile(InterndFileName, StatBuf);
  309. NamedFileEnt.setValue(&UFE);
  310. if (UFE.getName()) { // Already have an entry with this inode, return it.
  311. // If the stat process opened the file, close it to avoid a FD leak.
  312. if (FileDescriptor != -1)
  313. close(FileDescriptor);
  314. return &UFE;
  315. }
  316. // Otherwise, we don't have this directory yet, add it.
  317. // FIXME: Change the name to be a char* that points back to the
  318. // 'SeenFileEntries' key.
  319. UFE.Name = InterndFileName;
  320. UFE.Size = StatBuf.st_size;
  321. UFE.ModTime = StatBuf.st_mtime;
  322. UFE.Dir = DirInfo;
  323. UFE.UID = NextFileUID++;
  324. UFE.FD = FileDescriptor;
  325. return &UFE;
  326. }
  327. const FileEntry *
  328. FileManager::getVirtualFile(StringRef Filename, off_t Size,
  329. time_t ModificationTime) {
  330. ++NumFileLookups;
  331. // See if there is already an entry in the map.
  332. llvm::StringMapEntry<FileEntry *> &NamedFileEnt =
  333. SeenFileEntries.GetOrCreateValue(Filename);
  334. // See if there is already an entry in the map.
  335. if (NamedFileEnt.getValue() && NamedFileEnt.getValue() != NON_EXISTENT_FILE)
  336. return NamedFileEnt.getValue();
  337. ++NumFileCacheMisses;
  338. // By default, initialize it to invalid.
  339. NamedFileEnt.setValue(NON_EXISTENT_FILE);
  340. addAncestorsAsVirtualDirs(Filename);
  341. FileEntry *UFE = 0;
  342. // Now that all ancestors of Filename are in the cache, the
  343. // following call is guaranteed to find the DirectoryEntry from the
  344. // cache.
  345. const DirectoryEntry *DirInfo = getDirectoryFromFile(*this, Filename,
  346. /*CacheFailure=*/true);
  347. assert(DirInfo &&
  348. "The directory of a virtual file should already be in the cache.");
  349. // Check to see if the file exists. If so, drop the virtual file
  350. int FileDescriptor = -1;
  351. struct stat StatBuf;
  352. const char *InterndFileName = NamedFileEnt.getKeyData();
  353. if (getStatValue(InterndFileName, StatBuf, &FileDescriptor) == 0) {
  354. // If the stat process opened the file, close it to avoid a FD leak.
  355. if (FileDescriptor != -1)
  356. close(FileDescriptor);
  357. StatBuf.st_size = Size;
  358. StatBuf.st_mtime = ModificationTime;
  359. UFE = &UniqueRealFiles.getFile(InterndFileName, StatBuf);
  360. NamedFileEnt.setValue(UFE);
  361. // If we had already opened this file, close it now so we don't
  362. // leak the descriptor. We're not going to use the file
  363. // descriptor anyway, since this is a virtual file.
  364. if (UFE->FD != -1) {
  365. close(UFE->FD);
  366. UFE->FD = -1;
  367. }
  368. // If we already have an entry with this inode, return it.
  369. if (UFE->getName())
  370. return UFE;
  371. }
  372. if (!UFE) {
  373. UFE = new FileEntry();
  374. VirtualFileEntries.push_back(UFE);
  375. NamedFileEnt.setValue(UFE);
  376. }
  377. UFE->Name = InterndFileName;
  378. UFE->Size = Size;
  379. UFE->ModTime = ModificationTime;
  380. UFE->Dir = DirInfo;
  381. UFE->UID = NextFileUID++;
  382. UFE->FD = -1;
  383. return UFE;
  384. }
  385. void FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const {
  386. StringRef pathRef(path.data(), path.size());
  387. if (FileSystemOpts.WorkingDir.empty()
  388. || llvm::sys::path::is_absolute(pathRef))
  389. return;
  390. llvm::SmallString<128> NewPath(FileSystemOpts.WorkingDir);
  391. llvm::sys::path::append(NewPath, pathRef);
  392. path = NewPath;
  393. }
  394. llvm::MemoryBuffer *FileManager::
  395. getBufferForFile(const FileEntry *Entry, std::string *ErrorStr) {
  396. OwningPtr<llvm::MemoryBuffer> Result;
  397. llvm::error_code ec;
  398. const char *Filename = Entry->getName();
  399. // If the file is already open, use the open file descriptor.
  400. if (Entry->FD != -1) {
  401. ec = llvm::MemoryBuffer::getOpenFile(Entry->FD, Filename, Result,
  402. Entry->getSize());
  403. if (ErrorStr)
  404. *ErrorStr = ec.message();
  405. close(Entry->FD);
  406. Entry->FD = -1;
  407. return Result.take();
  408. }
  409. // Otherwise, open the file.
  410. if (FileSystemOpts.WorkingDir.empty()) {
  411. ec = llvm::MemoryBuffer::getFile(Filename, Result, Entry->getSize());
  412. if (ec && ErrorStr)
  413. *ErrorStr = ec.message();
  414. return Result.take();
  415. }
  416. llvm::SmallString<128> FilePath(Entry->getName());
  417. FixupRelativePath(FilePath);
  418. ec = llvm::MemoryBuffer::getFile(FilePath.str(), Result, Entry->getSize());
  419. if (ec && ErrorStr)
  420. *ErrorStr = ec.message();
  421. return Result.take();
  422. }
  423. llvm::MemoryBuffer *FileManager::
  424. getBufferForFile(StringRef Filename, std::string *ErrorStr) {
  425. OwningPtr<llvm::MemoryBuffer> Result;
  426. llvm::error_code ec;
  427. if (FileSystemOpts.WorkingDir.empty()) {
  428. ec = llvm::MemoryBuffer::getFile(Filename, Result);
  429. if (ec && ErrorStr)
  430. *ErrorStr = ec.message();
  431. return Result.take();
  432. }
  433. llvm::SmallString<128> FilePath(Filename);
  434. FixupRelativePath(FilePath);
  435. ec = llvm::MemoryBuffer::getFile(FilePath.c_str(), Result);
  436. if (ec && ErrorStr)
  437. *ErrorStr = ec.message();
  438. return Result.take();
  439. }
  440. /// getStatValue - Get the 'stat' information for the specified path,
  441. /// using the cache to accelerate it if possible. This returns true
  442. /// if the path points to a virtual file or does not exist, or returns
  443. /// false if it's an existent real file. If FileDescriptor is NULL,
  444. /// do directory look-up instead of file look-up.
  445. bool FileManager::getStatValue(const char *Path, struct stat &StatBuf,
  446. int *FileDescriptor) {
  447. // FIXME: FileSystemOpts shouldn't be passed in here, all paths should be
  448. // absolute!
  449. if (FileSystemOpts.WorkingDir.empty())
  450. return FileSystemStatCache::get(Path, StatBuf, FileDescriptor,
  451. StatCache.get());
  452. llvm::SmallString<128> FilePath(Path);
  453. FixupRelativePath(FilePath);
  454. return FileSystemStatCache::get(FilePath.c_str(), StatBuf, FileDescriptor,
  455. StatCache.get());
  456. }
  457. bool FileManager::getNoncachedStatValue(StringRef Path,
  458. struct stat &StatBuf) {
  459. llvm::SmallString<128> FilePath(Path);
  460. FixupRelativePath(FilePath);
  461. return ::stat(FilePath.c_str(), &StatBuf) != 0;
  462. }
  463. void FileManager::GetUniqueIDMapping(
  464. SmallVectorImpl<const FileEntry *> &UIDToFiles) const {
  465. UIDToFiles.clear();
  466. UIDToFiles.resize(NextFileUID);
  467. // Map file entries
  468. for (llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator>::const_iterator
  469. FE = SeenFileEntries.begin(), FEEnd = SeenFileEntries.end();
  470. FE != FEEnd; ++FE)
  471. if (FE->getValue() && FE->getValue() != NON_EXISTENT_FILE)
  472. UIDToFiles[FE->getValue()->getUID()] = FE->getValue();
  473. // Map virtual file entries
  474. for (SmallVector<FileEntry*, 4>::const_iterator
  475. VFE = VirtualFileEntries.begin(), VFEEnd = VirtualFileEntries.end();
  476. VFE != VFEEnd; ++VFE)
  477. if (*VFE && *VFE != NON_EXISTENT_FILE)
  478. UIDToFiles[(*VFE)->getUID()] = *VFE;
  479. }
  480. void FileManager::PrintStats() const {
  481. llvm::errs() << "\n*** File Manager Stats:\n";
  482. llvm::errs() << UniqueRealFiles.size() << " real files found, "
  483. << UniqueRealDirs.size() << " real dirs found.\n";
  484. llvm::errs() << VirtualFileEntries.size() << " virtual files found, "
  485. << VirtualDirectoryEntries.size() << " virtual dirs found.\n";
  486. llvm::errs() << NumDirLookups << " dir lookups, "
  487. << NumDirCacheMisses << " dir cache misses.\n";
  488. llvm::errs() << NumFileLookups << " file lookups, "
  489. << NumFileCacheMisses << " file cache misses.\n";
  490. //llvm::errs() << PagesMapped << BytesOfPagesMapped << FSLookups;
  491. }