r265162 - [CrashReproducer] Add -fmodule-cache-path to reproducer script

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 1 10:39:08 PDT 2016


Author: bruno
Date: Fri Apr  1 12:39:08 2016
New Revision: 265162

URL: http://llvm.org/viewvc/llvm-project?rev=265162&view=rev
Log:
[CrashReproducer] Add -fmodule-cache-path to reproducer script

The cc1 invocation in the reproducer script should contain a valid path in
-fmodule-cache-path; for that reuse "<name>.cache/module" dir we already
use to dump the vfs and modules.

Modified:
    cfe/trunk/lib/Driver/Job.cpp
    cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m
    cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
    cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m
    cfe/trunk/test/Modules/crash-vfs-path-traversal.m
    cfe/trunk/test/Modules/crash-vfs-relative-overlay.m

Modified: cfe/trunk/lib/Driver/Job.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Job.cpp?rev=265162&r1=265161&r2=265162&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Job.cpp (original)
+++ cfe/trunk/lib/Driver/Job.cpp Fri Apr  1 12:39:08 2016
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Program.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
@@ -194,6 +195,18 @@ void Command::Print(raw_ostream &OS, con
     printArg(OS, "-ivfsoverlay", Quote);
     OS << ' ';
     printArg(OS, CrashInfo->VFSPath.str().c_str(), Quote);
+
+    // Insert -fmodules-cache-path and use the relative module directory
+    // <name>.cache/vfs/modules where we already dumped the modules.
+    SmallString<128> RelModCacheDir = llvm::sys::path::parent_path(
+        llvm::sys::path::parent_path(CrashInfo->VFSPath));
+    llvm::sys::path::append(RelModCacheDir, "modules");
+
+    std::string ModCachePath = "-fmodules-cache-path=";
+    ModCachePath.append(RelModCacheDir.c_str());
+
+    OS << ' ';
+    printArg(OS, ModCachePath.c_str(), Quote);
   }
 
   if (ResponseFile != nullptr) {

Modified: cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m?rev=265162&r1=265161&r2=265162&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-emptydir-entries.m Fri Apr  1 12:39:08 2016
@@ -37,6 +37,7 @@
 // CHECKSH-NOT: "-fmodules-cache-path="
 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
 
 // CHECKYAML: 'type': 'directory',
 // CHECKYAML: 'name': "",

Modified: cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m?rev=265162&r1=265161&r2=265162&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-symlink-component.m Fri Apr  1 12:39:08 2016
@@ -38,6 +38,7 @@
 // CHECKSH-NOT: "-fmodules-cache-path="
 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
 
 // CHECKYAML: 'type': 'directory'
 // CHECKYAML: 'name': "/[[PATH:.*]]/i/usr/include",

Modified: cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m?rev=265162&r1=265161&r2=265162&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-symlink-topheader.m Fri Apr  1 12:39:08 2016
@@ -39,6 +39,7 @@
 // CHECKSH-NOT: "-fmodules-cache-path="
 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
 
 // CHECKYAML: 'type': 'directory',
 // CHECKYAML: 'name': "",

Modified: cfe/trunk/test/Modules/crash-vfs-path-traversal.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-path-traversal.m?rev=265162&r1=265161&r2=265162&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-path-traversal.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-path-traversal.m Fri Apr  1 12:39:08 2016
@@ -35,6 +35,7 @@
 // CHECKSH-NOT: "-fmodules-cache-path="
 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
 
 // CHECKYAML:     'type': 'directory'
 // CHECKYAML:     'name': "/[[PATH:.*]]/Inputs/crash-recovery/usr/include",

Modified: cfe/trunk/test/Modules/crash-vfs-relative-overlay.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/crash-vfs-relative-overlay.m?rev=265162&r1=265161&r2=265162&view=diff
==============================================================================
--- cfe/trunk/test/Modules/crash-vfs-relative-overlay.m (original)
+++ cfe/trunk/test/Modules/crash-vfs-relative-overlay.m Fri Apr  1 12:39:08 2016
@@ -33,6 +33,7 @@
 // CHECKSH-NOT: "-fmodules-cache-path="
 // CHECKSH: "crash-vfs-{{[^ ]*}}.m"
 // CHECKSH: "-ivfsoverlay" "crash-vfs-{{[^ ]*}}.cache/vfs/vfs.yaml"
+// CHECKSH: "-fmodules-cache-path=crash-vfs-{{[^ ]*}}.cache/modules"
 
 // CHECKYAML: 'type': 'directory'
 // CHECKYAML: 'name': "/[[PATH:.*]]/Inputs/crash-recovery/usr/include",




More information about the cfe-commits mailing list