]> granicus.if.org Git - clang/commitdiff
Use llvm::sys::fs::equivalent rather than comparing inodes, because
authorDouglas Gregor <dgregor@apple.com>
Fri, 9 Dec 2011 16:22:07 +0000 (16:22 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 9 Dec 2011 16:22:07 +0000 (16:22 +0000)
comparing inodes doesn't actually work on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146260 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReader.cpp

index c7393e4c78cfd3ed91d0baa9fc814e1382c3eaae..44ffc29bad254781578eadcd2a3e30918bbc4a0f 100644 (file)
@@ -1427,14 +1427,13 @@ bool HeaderFileInfoTrait::EqualKey(internal_key_type a, internal_key_type b) {
   
   if (llvm::sys::path::filename(a) != llvm::sys::path::filename(b))
     return false;
-  
-  // The file names match, but the path names don't. stat() the files to
-  // see if they are the same.      
-  struct stat StatBufA, StatBufB;
-  if (StatSimpleCache(a, &StatBufA) || StatSimpleCache(b, &StatBufB))
+
+  // Determine whether the actual files are equivalent.
+  bool Result = false;
+  if (llvm::sys::fs::equivalent(a, b, Result))
     return false;
   
-  return StatBufA.st_ino == StatBufB.st_ino;
+  return Result;
 }
     
 std::pair<unsigned, unsigned>