aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-12-12 06:04:28 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-12-12 06:04:28 +0000
commitd45fbe62270eaf826419b93f1da66f1850f37faf (patch)
tree0201ac7435851c79ad95e82f1bd9108feacdc160 /include
parentc3b00e80400d27d5d6152374d87c0ad5866c780c (diff)
downloadexternal_llvm-d45fbe62270eaf826419b93f1da66f1850f37faf.zip
external_llvm-d45fbe62270eaf826419b93f1da66f1850f37faf.tar.gz
external_llvm-d45fbe62270eaf826419b93f1da66f1850f37faf.tar.bz2
Support/FileSystem: Implement bool equivalent(file_status A, file_status B);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/FileSystem.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h
index 6db4554..2abbc48 100644
--- a/include/llvm/Support/FileSystem.h
+++ b/include/llvm/Support/FileSystem.h
@@ -39,6 +39,10 @@
#include <stack>
#include <string>
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
namespace llvm {
namespace sys {
namespace fs {
@@ -94,7 +98,20 @@ struct space_info {
/// a platform specific member to store the result.
class file_status
{
- // implementation defined status field.
+ #if defined(LLVM_ON_UNIX)
+ dev_t st_dev;
+ ino_t st_ino;
+ #elif defined (LLVM_ON_WIN32)
+ uint32_t LastWriteTimeHigh;
+ uint32_t LastWriteTimeLow;
+ uint32_t VolumeSerialNumber;
+ uint32_t FileSizeHigh;
+ uint32_t FileSizeLow;
+ uint32_t FileIndexHigh;
+ uint32_t FileIndexLow;
+ #endif
+ friend bool equivalent(file_status A, file_status B);
+ friend error_code status(const Twine &path, file_status &result);
file_type Type;
public:
explicit file_status(file_type v=file_type::status_error)
@@ -244,6 +261,8 @@ bool equivalent(file_status A, file_status B);
/// @brief Do paths represent the same thing?
///
+/// assert(status_known(A) || status_known(B));
+///
/// @param A Input path A.
/// @param B Input path B.
/// @param result Set to true if stat(A) and stat(B) have the same device and