]> granicus.if.org Git - clang/commitdiff
[driver crash diagnostics] Remove more flags that reference absolute paths that
authorChad Rosier <mcrosier@apple.com>
Thu, 3 May 2012 17:07:55 +0000 (17:07 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 3 May 2012 17:07:55 +0000 (17:07 +0000)
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

index 483575298de22164b7038f296d61ea510c89be1c..d510a0f4f68f96d31bf331948609e3d4d97594bf 100644 (file)
@@ -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);