r300027 - [Modules] Remove darwin specific code to check for SystemVersion.plist

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 11 21:49:00 PDT 2017


Author: bruno
Date: Tue Apr 11 23:49:00 2017
New Revision: 300027

URL: http://llvm.org/viewvc/llvm-project?rev=300027&view=rev
Log:
[Modules] Remove darwin specific code to check for SystemVersion.plist

This isn't need anymore and modules options -fbuild-session-file and
-fmodules-validate-once-per-build-session already provide a sane
mechanism to validate the system headers.

rdar://problem/19767523

Removed:
    cfe/trunk/test/Modules/system_version.m
Modified:
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=300027&r1=300026&r2=300027&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Apr 11 23:49:00 2017
@@ -2660,29 +2660,6 @@ std::string CompilerInvocation::getModul
     code = ext->hashExtension(code);
   }
 
-  // Darwin-specific hack: if we have a sysroot, use the contents and
-  // modification time of
-  //   $sysroot/System/Library/CoreServices/SystemVersion.plist
-  // as part of the module hash.
-  if (!hsOpts.Sysroot.empty()) {
-    SmallString<128> systemVersionFile;
-    systemVersionFile += hsOpts.Sysroot;
-    llvm::sys::path::append(systemVersionFile, "System");
-    llvm::sys::path::append(systemVersionFile, "Library");
-    llvm::sys::path::append(systemVersionFile, "CoreServices");
-    llvm::sys::path::append(systemVersionFile, "SystemVersion.plist");
-
-    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> buffer =
-        llvm::MemoryBuffer::getFile(systemVersionFile);
-    if (buffer) {
-      code = hash_combine(code, buffer.get()->getBuffer());
-
-      struct stat statBuf;
-      if (stat(systemVersionFile.c_str(), &statBuf) == 0)
-        code = hash_combine(code, statBuf.st_mtime);
-    }
-  }
-
   return llvm::APInt(64, code).toString(36, /*Signed=*/false);
 }
 

Removed: cfe/trunk/test/Modules/system_version.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/system_version.m?rev=300026&view=auto
==============================================================================
--- cfe/trunk/test/Modules/system_version.m (original)
+++ cfe/trunk/test/Modules/system_version.m (removed)
@@ -1,31 +0,0 @@
-// Test checking that we're hashing a system version file in the
-// module hash.
-
-// First, build a system root.
-// RUN: rm -rf %t
-// RUN: mkdir -p %t/usr/include
-// RUN: cp %S/Inputs/Modified/A.h %t/usr/include
-// RUN: cp %S/Inputs/Modified/B.h %t/usr/include
-// RUN: cp %S/Inputs/Modified/module.map %t/usr/include
-
-// Run once with no system version file. We should end up with one module.
-// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
-// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 1
-
-// Add a system version file and run again. We should now have two
-// module variants.
-// RUN: mkdir -p %t/System/Library/CoreServices
-// RUN: echo "hello" > %t/System/Library/CoreServices/SystemVersion.plist
-// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
-// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 2
-
-// Change the system version file and run again. We should now have three
-// module variants.
-// RUN: mkdir -p %t/System/Library/CoreServices
-// RUN: echo "modules" > %t/System/Library/CoreServices/SystemVersion.plist
-// RUN: %clang_cc1 -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -isysroot %t -I %t/usr/include %s -verify
-// RUN: ls -R %t | grep -c "ModA.*pcm" | grep 3
-
-// expected-no-diagnostics
- at import ModA;
-




More information about the cfe-commits mailing list