This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Driver] Remove -M group options before generating crash diagnostics
ClosedPublic

Authored by aganea on Feb 5 2020, 10:20 AM.

Details

Summary

When using -MF file.d on the command line, file.d would not be deleted after a compiler crash.

Previously, the code path below had no effect, because TCArgs was already created after the crash, thus changes to TranslatedArgs would have no effect.

This was covered by clang/test/Driver/output-file-cleanup.c, the test was succeeding by fluke because Driver::generateCompilationDiagnostics() would fail to launch the subsequent clang -E (see D74070 for a fix for this). So the test was only covering code in Driver.cpp, L1492 and L1496 (C.CleanupFileMap). After this patch, both cleanup and removal of -MF are exercised.

This patch is point 2. in D73742

Diff Detail

Event Timeline

aganea created this revision.Feb 5 2020, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2020, 10:20 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aganea edited the summary of this revision. (Show Details)Feb 5 2020, 10:21 AM
hans accepted this revision.Feb 6 2020, 12:27 AM
This revision is now accepted and ready to land.Feb 6 2020, 12:27 AM
This revision was automatically updated to reflect the committed changes.

FYI - reverted this too since I had conflicts when also reverting D74070.