[cfe-commits] r38728 - /cfe/cfe/trunk/Basic/FileManager.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:24:09 PDT 2007
Author: sabre
Date: Wed Jul 11 11:24:09 2007
New Revision: 38728
URL: http://llvm.org/viewvc/llvm-project?rev=38728&view=rev
Log:
cleanups, add some code for instrumenting stat
Modified:
cfe/cfe/trunk/Basic/FileManager.cpp
Modified: cfe/cfe/trunk/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Basic/FileManager.cpp?rev=38728&r1=38727&r2=38728&view=diff
==============================================================================
--- cfe/cfe/trunk/Basic/FileManager.cpp (original)
+++ cfe/cfe/trunk/Basic/FileManager.cpp Wed Jul 11 11:24:09 2007
@@ -102,14 +102,18 @@
// Nope, there isn't. Check to see if the file exists.
struct stat StatBuf;
+ //std::cerr << "STATING: " << Filename;
if (stat(Filename.c_str(), &StatBuf) || // Error stat'ing.
- S_ISDIR(StatBuf.st_mode)) // A directory?
+ S_ISDIR(StatBuf.st_mode)) { // A directory?
+ // If this file doesn't exist, we leave a null in FileEntries for this path.
+ //std::cerr << ": Not existing\n";
return 0;
+ }
+ //std::cerr << ": exists\n";
// It exists. See if we have already opened a directory with the same inode.
// This occurs when one dir is symlinked to another, for example.
- FileEntry *&UFE =
- UniqueFiles[std::make_pair(StatBuf.st_dev, StatBuf.st_ino)];
+ FileEntry *&UFE = UniqueFiles[std::make_pair(StatBuf.st_dev, StatBuf.st_ino)];
if (UFE) // Already have an entry with this inode, return it.
return Ent = UFE;
More information about the cfe-commits
mailing list