aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-03-18 19:23:19 +0000
committerAnders Carlsson <andersca@mac.com>2011-03-18 19:23:19 +0000
commit7dbafb3ade491a41100c97597209455ee10c537d (patch)
tree15d3ab693f93793db68f5e21a8c38d35f069235d /lib/Basic
parent0d8d7e6067f9093e7d5abc45c9639ab977aab692 (diff)
Add FileManager::getNoncachedStatValue, which will resolve relative paths against the working directory specified in the file system options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r--lib/Basic/FileManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp
index 1a8b01938e..4e5a129082 100644
--- a/lib/Basic/FileManager.cpp
+++ b/lib/Basic/FileManager.cpp
@@ -541,6 +541,14 @@ bool FileManager::getStatValue(const char *Path, struct stat &StatBuf,
StatCache.get());
}
+bool FileManager::getNoncachedStatValue(llvm::StringRef Path,
+ struct stat &StatBuf) {
+ llvm::SmallString<128> FilePath(Path);
+ FixupRelativePath(FilePath);
+
+ return ::stat(FilePath.c_str(), &StatBuf) != 0;
+}
+
void FileManager::GetUniqueIDMapping(
llvm::SmallVectorImpl<const FileEntry *> &UIDToFiles) const {
UIDToFiles.clear();