]> granicus.if.org Git - llvm/commit
Allow VersionPrinter to print to arbitrary raw_ostreams
authorDimitry Andric <dimitry@andric.com>
Tue, 6 Jun 2017 21:54:04 +0000 (21:54 +0000)
committerDimitry Andric <dimitry@andric.com>
Tue, 6 Jun 2017 21:54:04 +0000 (21:54 +0000)
commit4a03a9f0896300aa490bd011c790a104480db49c
tree245cdc59da17186ad1855be326fd231c8e4cb1c8
parentfdb83c86c85bfbb00ae0fc584fb873bec17534e7
Allow VersionPrinter to print to arbitrary raw_ostreams

Summary:
I would like to add printing of registered targets to clang's version
information.  For this to work correctly, the VersionPrinter logic in
CommandLine.cpp should support printing to arbitrary raw_ostreams,
instead of always defaulting to outs().

Add a raw_ostream& parameter to the function pointer type used for
VersionPrinter, and while doing so, introduce a typedef for convenience.

Note that VersionPrinter::print() will still default to using outs(),
the clang part will necessarily go into a separate review.

Reviewers: beanz, chandlerc, dberris, mehdi_amini, zturner

Reviewed By: mehdi_amini

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33899

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304835 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/CommandLine.h
include/llvm/Support/TargetRegistry.h
lib/Support/CommandLine.cpp
lib/Support/TargetRegistry.cpp