aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/FileManager.h
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
commitda9954400aab56bc3df60eb1b7be2489121c6166 (patch)
treed36859e3ddcb825331c8ca1c351639f067bb34be /include/clang/Basic/FileManager.h
parent2b9d2ca4ce53fffbe8a77c7db2fe4df5ccfb9fd4 (diff)
Added to FileEntry a pointer to the <dev_t,ino_t> pair for the file, and
accessors to FileEntry to query these values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/FileManager.h')
-rw-r--r--include/clang/Basic/FileManager.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h
index ce58cdc4a9..dd12c1c33b 100644
--- a/include/clang/Basic/FileManager.h
+++ b/include/clang/Basic/FileManager.h
@@ -42,13 +42,16 @@ class FileEntry {
time_t ModTime; // Modification time of file.
const DirectoryEntry *Dir; // Directory file lives in.
unsigned UID; // A unique (small) ID for the file.
+ const std::pair<dev_t, ino_t>* InoDev; // Pointer to inode/device number pair.
friend class FileManager;
public:
- FileEntry() : Name(0) {}
+ FileEntry() : Name(0), InoDev(NULL) {}
const char *getName() const { return Name; }
off_t getSize() const { return Size; }
unsigned getUID() const { return UID; }
+ ino_t getInode() const { return InoDev->second; }
+ dev_t getDev() const { return InoDev->first; }
time_t getModificationTime() const { return ModTime; }
/// getDir - Return the directory the file lives in.
@@ -66,7 +69,9 @@ class FileManager {
/// UniqueDirs/UniqueFiles - Cache from ID's to existing directories/files.
///
std::map<std::pair<dev_t, ino_t>, DirectoryEntry> UniqueDirs;
- std::map<std::pair<dev_t, ino_t>, FileEntry> UniqueFiles;
+
+ typedef std::map<std::pair<dev_t, ino_t>, FileEntry> FileEntryMap;
+ FileEntryMap UniqueFiles;
/// DirEntries/FileEntries - This is a cache of directory/file entries we have
/// looked up. The actual Entry is owned by UniqueFiles/UniqueDirs above.