summaryrefslogtreecommitdiffstats
path: root/clang/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-19 03:40:07 +0000
committerChris Lattner <sabre@nondot.org>2006-07-19 03:40:07 +0000
commit81500bc3ae9601f6e52b0ee1404fa3c766e4840d (patch)
treed7ed0ccf3b9783c76a6315ee7aa5e469060f5249 /clang/Basic/FileManager.cpp
parentc5cd2d6556500bf697edaa61d7a9154a9cb65898 (diff)
downloadbcm5719-llvm-81500bc3ae9601f6e52b0ee1404fa3c766e4840d.tar.gz
bcm5719-llvm-81500bc3ae9601f6e52b0ee1404fa3c766e4840d.zip
cleanups, add some code for instrumenting stat
llvm-svn: 38728
Diffstat (limited to 'clang/Basic/FileManager.cpp')
-rw-r--r--clang/Basic/FileManager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/Basic/FileManager.cpp b/clang/Basic/FileManager.cpp
index 50efc7c2b28..f8b1a7f3d79 100644
--- a/clang/Basic/FileManager.cpp
+++ b/clang/Basic/FileManager.cpp
@@ -102,14 +102,18 @@ const FileEntry *FileManager::getFile(const std::string &Filename) {
// 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;
OpenPOWER on IntegriCloud