diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-04-01 17:39:08 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-04-01 17:39:08 +0000 |
commit | f854b042e70fa85a32c8e71301686aab06913217 (patch) | |
tree | 60ca97508e4deaccaca6ea10c058db38f07b22fb /clang/lib/Driver/Job.cpp | |
parent | 9f413364d5a0e6c1f440b0ed7a14031130256922 (diff) | |
download | bcm5719-llvm-f854b042e70fa85a32c8e71301686aab06913217.tar.gz bcm5719-llvm-f854b042e70fa85a32c8e71301686aab06913217.zip |
[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.
llvm-svn: 265162
Diffstat (limited to 'clang/lib/Driver/Job.cpp')
-rw-r--r-- | clang/lib/Driver/Job.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp index 3eb23c9ee4c..d44458db2fb 100644 --- a/clang/lib/Driver/Job.cpp +++ b/clang/lib/Driver/Job.cpp @@ -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, const char *Terminator, bool Quote, 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) { |