FileManager.cpp 20 KB

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