[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
This commit is contained in:
Chad Rosier 2012-05-03 17:07:55 +00:00
Родитель 975eef6418
Коммит d83217cbfc
1 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -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<std::string, 16> 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);