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