[llvm-profdata] Bring back reading profile data from STDIN.

This feature was lost in r276197.

llvm-svn: 276407
This commit is contained in:
Benjamin Kramer 2016-07-22 12:39:55 +00:00
parent 4e6fad5760
commit a81f4728f3
2 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ RUN: diff %t-bintext %t-text
4- Merge the binary and text encodings of the profile and check that the
counters have doubled.
RUN: llvm-profdata merge --sample --text %t.profbin %p/Inputs/inline-samples.afdo -o - | FileCheck %s --check-prefix=MERGE1
RUN: llvm-profdata merge --sample --text - < %t.profbin %p/Inputs/inline-samples.afdo -o - | FileCheck %s --check-prefix=MERGE1
MERGE1: main:733692:0
MERGE1: 2.3: 120802
MERGE1: 2.3: _Z3fool:492088

View File

@ -319,6 +319,13 @@ getInputFilenamesFileBuf(const StringRef &InputFilenamesFile) {
static void addWeightedInput(WeightedFileVector &WNI, const WeightedFile &WF) {
StringRef Filename = WF.Filename;
uint64_t Weight = WF.Weight;
// If it's STDIN just pass it on.
if (Filename == "-") {
WNI.push_back({Filename, Weight});
return;
}
llvm::sys::fs::file_status Status;
llvm::sys::fs::status(Filename, Status);
if (!llvm::sys::fs::exists(Status))