From d83217cbfcfcde7b21a829483347e593e2f2a4a3 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Thu, 3 May 2012 17:07:55 +0000 Subject: [PATCH] [driver crash diagnostics] Remove more flags that reference absolute paths that aren't necessary to reproduce the clang crash. Part of rdar://11285725 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156079 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 483575298d..d510a0f4f6 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -489,10 +489,23 @@ void Driver::generateCompilationDiagnostics(Compilation &C, Diag(clang::diag::note_drv_command_failed_diag_msg) << "Error generating run script: " + Script + " " + Err; } else { - // Strip -D, -F, and -I. + // Strip away options not necessary to reproduce the crash. // FIXME: This doesn't work with quotes (e.g., -D "foo bar"). - std::string Flag[4] = {"-D ", "-F", "-I ", "-o "}; - for (unsigned i = 0; i < 4; ++i) { + SmallVector Flag; + Flag.push_back("-D "); + Flag.push_back("-F"); + Flag.push_back("-I "); + Flag.push_back("-o "); + Flag.push_back("-coverage-file "); + Flag.push_back("-dependency-file "); + Flag.push_back("-fdebug-compilation-dir "); + Flag.push_back("-fmodule-cache-path "); + Flag.push_back("-include "); + Flag.push_back("-include-pch "); + Flag.push_back("-isysroot "); + Flag.push_back("-resource-dir "); + Flag.push_back("-serialize-diagnostic-file "); + for (unsigned i = 0, e = Flag.size(); i < e; ++i) { size_t I = 0, E = 0; do { I = Cmd.find(Flag[i], I); -- 2.40.0