Recognize '-' as special -MF argument (write to stdout)
commitb4bbadc125a7fc5d772e774756bf7a4a720d1b5f
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Jun 2017 16:05:57 +0000 (14 16:05 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Jun 2017 16:05:57 +0000 (14 16:05 +0000)
tree8b372d46d33e5b585b9e4735fe7bc7e234ad0e79
parentc4e8bef923f193818cd3a93c2fca7dcfb42fab2e
Recognize '-' as special -MF argument (write to stdout)

Sometimes it is useful to generate pre-processed output to a file and
the dependency information to stdout for further analysis/processing.
For example:

g++ -E -MD -fdirectives-only -o test.ii test.cxx

This will generate the dependency information to test.d (as per the
documentation). While changing this behavior is probably unwise, one
traditional (e.g., supported by -o) way to handle this is to recognize
the special '-' file name as an instruction to write to stdout:

g++ -E -MD -fdirectives-only -o test.ii -MF - test.cxx

Currently this will create a file named '-'. The included patch
changes this behavior to write to stdout.

Note also that Clang has supported this from at least version 3.5.

gcc:
2017-06-14  Boris Kolpackov  <boris@codesynthesis.com>

* doc/cppopts.texi: Document '-' special value to -MF.

gcc/c-family:
2017-06-14  Boris Kolpackov  <boris@codesynthesis.com>

* c-opts.c (c_common_finish): Handle '-' special value to -MF.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249201 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/doc/cppopts.texi