summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Job.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-04-04 20:26:57 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-04-04 20:26:57 +0000
commitb810b02b853dc4e42d641cea24bc853f1894b9f0 (patch)
tree7cb9c52daa1828f4675bdcbfbab752e038edb9b1 /clang/lib/Driver/Job.cpp
parentd955f899142029a439a6d3dd2285d64153d54024 (diff)
downloadbcm5719-llvm-b810b02b853dc4e42d641cea24bc853f1894b9f0.tar.gz
bcm5719-llvm-b810b02b853dc4e42d641cea24bc853f1894b9f0.zip
[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using modules/vfs
The reproducer should use -I/-F/-resource-dir in the same way as the original command. The VFS already collects the right headers but without these flags the reproducer will fail to do the right thing. llvm-svn: 265343
Diffstat (limited to 'clang/lib/Driver/Job.cpp')
-rw-r--r--clang/lib/Driver/Job.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp
index d44458db2fb..2d99b1f2238 100644
--- a/clang/lib/Driver/Job.cpp
+++ b/clang/lib/Driver/Job.cpp
@@ -41,17 +41,16 @@ static int skipArgs(const char *Flag, bool HaveCrashVFS) {
// These flags are all of the form -Flag <Arg> and are treated as two
// arguments. Therefore, we need to skip the flag and the next argument.
bool Res = llvm::StringSwitch<bool>(Flag)
- .Cases("-I", "-MF", "-MT", "-MQ", true)
+ .Cases("-MF", "-MT", "-MQ", "-serialize-diagnostic-file", true)
.Cases("-o", "-coverage-file", "-dependency-file", true)
.Cases("-fdebug-compilation-dir", "-idirafter", true)
.Cases("-include", "-include-pch", "-internal-isystem", true)
.Cases("-internal-externc-isystem", "-iprefix", "-iwithprefix", true)
.Cases("-iwithprefixbefore", "-isystem", "-iquote", true)
- .Cases("-resource-dir", "-serialize-diagnostic-file", true)
.Cases("-dwarf-debug-flags", "-ivfsoverlay", true)
.Cases("-header-include-file", "-diagnostic-log-file", true)
// Some include flags shouldn't be skipped if we have a crash VFS
- .Case("-isysroot", !HaveCrashVFS)
+ .Cases("-isysroot", "-I", "-F", "-resource-dir", !HaveCrashVFS)
.Default(false);
// Match found.
@@ -72,7 +71,8 @@ static int skipArgs(const char *Flag, bool HaveCrashVFS) {
// These flags are treated as a single argument (e.g., -F<Dir>).
StringRef FlagRef(Flag);
- if (FlagRef.startswith("-F") || FlagRef.startswith("-I") ||
+ if ((!HaveCrashVFS &&
+ (FlagRef.startswith("-F") || FlagRef.startswith("-I"))) ||
FlagRef.startswith("-fmodules-cache-path="))
return 1;
OpenPOWER on IntegriCloud