summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/FileManager.h5
-rw-r--r--clang/lib/Basic/FileManager.cpp8
2 files changed, 13 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/FileManager.h b/clang/include/clang/Basic/FileManager.h
index 40f6d865636..465f856f946 100644
--- a/clang/include/clang/Basic/FileManager.h
+++ b/clang/include/clang/Basic/FileManager.h
@@ -195,6 +195,11 @@ public:
llvm::MemoryBuffer *getBufferForFile(llvm::StringRef Filename,
std::string *ErrorStr = 0);
+ // getNoncachedStatValue - Will get the 'stat' information for the given path.
+ // If the path is relative, it will be resolved against the WorkingDir of the
+ // FileManager's FileSystemOptions.
+ bool getNoncachedStatValue(llvm::StringRef Path, struct stat &StatBuf);
+
/// \brief If path is not absolute and FileSystemOptions set the working
/// directory, the path is modified to be relative to the given
/// working directory.
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 1a8b01938ed..4e5a129082f 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud