summaryrefslogtreecommitdiffstats
path: root/clang/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-18 20:45:25 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-18 20:45:25 +0000
commita51c88ccd8eed9cf322a7d2912bd81921677edc1 (patch)
tree4e5f0dd906924f5820d3897379ead871dd898ded /clang/Basic/FileManager.cpp
parentb7016c53d14c32e1d17de27759c2b606284a4f9d (diff)
downloadbcm5719-llvm-a51c88ccd8eed9cf322a7d2912bd81921677edc1.tar.gz
bcm5719-llvm-a51c88ccd8eed9cf322a7d2912bd81921677edc1.zip
Added to FileEntry a pointer to the <dev_t,ino_t> pair for the file, and
accessors to FileEntry to query these values. llvm-svn: 45171
Diffstat (limited to 'clang/Basic/FileManager.cpp')
-rw-r--r--clang/Basic/FileManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/Basic/FileManager.cpp b/clang/Basic/FileManager.cpp
index 8ffde1f6fc9..9edbd03873f 100644
--- a/clang/Basic/FileManager.cpp
+++ b/clang/Basic/FileManager.cpp
@@ -65,7 +65,7 @@ const DirectoryEntry *FileManager::getDirectory(const char *NameStart,
return 0;
// 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.
+ // This occurs when one dir is symlinked to another, for example.
DirectoryEntry &UDE =
UniqueDirs[std::make_pair(StatBuf.st_dev, StatBuf.st_ino)];
@@ -144,7 +144,12 @@ const FileEntry *FileManager::getFile(const char *NameStart,
// 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)];
+ std::pair<FileEntryMap::iterator,bool> X =
+ UniqueFiles.insert(FileEntryMap::value_type(std::make_pair(StatBuf.st_dev,
+ StatBuf.st_ino),
+ FileEntry()));
+
+ FileEntry &UFE = X.first->second;
NamedFileEnt.setValue(&UFE);
if (UFE.getName()) // Already have an entry with this inode, return it.
@@ -158,6 +163,7 @@ const FileEntry *FileManager::getFile(const char *NameStart,
UFE.ModTime = StatBuf.st_mtime;
UFE.Dir = DirInfo;
UFE.UID = NextFileUID++;
+ UFE.InoDev = &X.first->first;
return &UFE;
}
OpenPOWER on IntegriCloud