This is an archive of the discontinued LLVM Phabricator instance.

PR 17421: Implemented -save-temps={obj|cwd} option
ClosedPublic

Authored by tra on Jan 30 2015, 1:33 PM.

Details

Summary

-save-temps=cwd is equivalent to -save-temps
-save-temps=obj saves temporary file in the same directory as output

This helps to avoid clobbering of temp files in case of parallel
compilation with -save-temps of the files that have the same name
but located in different directories.

Diff Detail

Repository
rL LLVM

Event Timeline

tra updated this revision to Diff 19054.Jan 30 2015, 1:33 PM
tra retitled this revision from to PR 17421: Implemented -save-temps={obj|cwd} option.
tra updated this object.
tra edited the test plan for this revision. (Show Details)
tra added a reviewer: echristo.
tra added a subscriber: Unknown Object (MLST).
rnk accepted this revision.Jan 30 2015, 1:53 PM
rnk added a reviewer: rnk.
rnk added a subscriber: rnk.

Looks good to me.

include/clang/Driver/Driver.h
72 ↗(On Diff #19054)

Any reason for this whitespace change?

lib/Driver/Driver.cpp
372 ↗(On Diff #19054)

Not worth it, IMO.

1792 ↗(On Diff #19054)

Looks unused

1793 ↗(On Diff #19054)

No need to check isSaveTempsObj(), we already know it, right?

This revision is now accepted and ready to land.Jan 30 2015, 1:53 PM
tra updated this revision to Diff 19167.Feb 2 2015, 10:56 AM
tra edited edge metadata.

Addressed rnk's comments.

tra added a comment.Feb 2 2015, 10:57 AM

I've updated the patch.

include/clang/Driver/Driver.h
72 ↗(On Diff #19054)

It was unintentional. Undone.

lib/Driver/Driver.cpp
372 ↗(On Diff #19054)

OK. I've removed the comment.

1793 ↗(On Diff #19054)

Indeed. And both ifs can be collapsed into one.

tra updated this revision to Diff 19188.Feb 2 2015, 2:12 PM

Made -save-tmeps an alias for -save-temps=cwd

rnk added a comment.Feb 2 2015, 2:27 PM

Cool, will commit this soon.

lib/Driver/Driver.cpp
365–366 ↗(On Diff #19188)

This seems unneeded now that we have the alias

This revision was automatically updated to reflect the committed changes.