[PATCH] D54883: [Support/FileSystem] Use st_atimespec only when __APPLE__ is defined

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 10:16:51 PST 2018


MaskRay updated this revision to Diff 175287.
MaskRay edited the summary of this revision.
MaskRay added a comment.

.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54883/new/

https://reviews.llvm.org/D54883

Files:
  cmake/config-ix.cmake
  include/llvm/Config/config.h.cmake
  lib/Support/Unix/Path.inc


Index: lib/Support/Unix/Path.inc
===================================================================
--- lib/Support/Unix/Path.inc
+++ lib/Support/Unix/Path.inc
@@ -592,14 +592,12 @@
   }
 
   uint32_t atime_nsec, mtime_nsec;
-#if defined(HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
+#ifdef __APPLE__
   atime_nsec = Status.st_atimespec.tv_nsec;
   mtime_nsec = Status.st_mtimespec.tv_nsec;
-#elif defined(HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
+#else
   atime_nsec = Status.st_atim.tv_nsec;
   mtime_nsec = Status.st_mtim.tv_nsec;
-#else
-  atime_nsec = mtime_nsec = 0;
 #endif
 
   perms Perms = static_cast<perms>(Status.st_mode) & all_perms;
Index: include/llvm/Config/config.h.cmake
===================================================================
--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -208,12 +208,6 @@
 /* Define to 1 if you have the <sys/time.h> header file. */
 #cmakedefine HAVE_SYS_TIME_H ${HAVE_SYS_TIME_H}
 
-/* Define to 1 if stat struct has st_mtimespec member .*/
-#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC ${HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC}
-
-/* Define to 1 if stat struct has st_mtim member. */
-#cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC ${HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC}
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
 
Index: cmake/config-ix.cmake
===================================================================
--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -7,7 +7,6 @@
 include(CheckLibraryExists)
 include(CheckSymbolExists)
 include(CheckFunctionExists)
-include(CheckStructHasMember)
 include(CheckCCompilerFlag)
 
 include(CheckCompilerVersion)
@@ -249,11 +248,6 @@
   endif()
 endif()
 
-CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec
-    "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
-CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec
-    "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
-
 check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
 if( LLVM_USING_GLIBC )
   add_definitions( -D_GNU_SOURCE )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54883.175287.patch
Type: text/x-patch
Size: 2120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181126/a5158be0/attachment.bin>


More information about the llvm-commits mailing list