From b810b02b853dc4e42d641cea24bc853f1894b9f0 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Mon, 4 Apr 2016 20:26:57 +0000 Subject: [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 --- clang/lib/Driver/Job.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/Driver/Job.cpp') 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 and are treated as two // arguments. Therefore, we need to skip the flag and the next argument. bool Res = llvm::StringSwitch(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). 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; -- cgit v1.2.3