]> granicus.if.org Git - clang/commitdiff
When generating the clang crash diagnostic script, strip out the -o flag.
authorChad Rosier <mcrosier@apple.com>
Fri, 20 Apr 2012 17:21:42 +0000 (17:21 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 20 Apr 2012 17:21:42 +0000 (17:21 +0000)
Add a FIXME comment.
rdar://11283560

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155207 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index 0d105ac0d0c647018b5742172db14d2395ae95a5..c293b7fab630b08353f5e01e8e7816039c1022a0 100644 (file)
@@ -491,8 +491,8 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
       } else {
         // Strip -D, -F, and -I.
         // FIXME: This doesn't work with quotes (e.g., -D "foo bar").
-        std::string Flag[3] = {"-D ", "-F", "-I "};
-        for (unsigned i = 0; i < 3; ++i) {
+        std::string Flag[4] = {"-D ", "-F", "-I ", "-o "};
+        for (unsigned i = 0; i < 4; ++i) {
           size_t I = 0, E = 0;
           do {
             I = Cmd.find(Flag[i], I);
@@ -503,6 +503,7 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
             Cmd.erase(I, E - I + 1);
           } while(1);
         }
+        // FIXME: Append the new filename with correct preprocessed suffix.
         ScriptOS << Cmd;
         Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;
       }