[llvm-profdata] Allow omission of -o for --text output
authorFangrui Song <i@maskray.me>
Mon, 21 Jun 2021 19:01:57 +0000 (12:01 -0700)
committerFangrui Song <i@maskray.me>
Mon, 21 Jun 2021 19:01:57 +0000 (12:01 -0700)
commitea23c38d0605514f68e33d319a6bdd858381257a
tree328375b603acd752cabece4f6f9da43901d716d8
parentb2cd98d5fe7ab71415f2a87c741ebf62a7e3ba54
[llvm-profdata] Allow omission of -o for --text output

This makes it more convenient to get a text format profile.

Add an error for printing non-text format output to a terminal for instrumentation profile.
(It cannot be portably tested. For sample profile, raw_fd_ostream is hidden deeply so it's inconvenient to add a diagnostic.)

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D104600
llvm/test/tools/llvm-profdata/text-dump.test
llvm/tools/llvm-profdata/llvm-profdata.cpp