Page MenuHomePhabricator

[Driver] Fix naming conflicts of getStatsFileName when using LTO
Needs ReviewPublic

Authored by dtcxzyw on Sat, Mar 18, 11:32 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

When using clang with -flto=thin -save-stats=obj to compile a multi-file program, clang will save internal statistics during the link time code generation to <obj_dir>/.stats because BaseName is empty. When multiple binaries are placed in the same directory, conflicts will be caused by identical filenames for statistics. This patch uses the output filename as the base name instead of the input when -save-stats=obj.

Diff Detail

Event Timeline

dtcxzyw created this revision.Sat, Mar 18, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptSat, Mar 18, 11:32 AM
Herald added a subscriber: inglorion. · View Herald Transcript
dtcxzyw requested review of this revision.Sat, Mar 18, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptSat, Mar 18, 11:32 AM
dtcxzyw updated this revision to Diff 506387.Sun, Mar 19, 6:39 AM
dtcxzyw removed subscribers: MaskRay, cfe-commits, inglorion.

Fix test errors.