diff options
| author | Mingming Liu <minglotus6@gmail.com> | 2025-08-23 14:48:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-23 14:48:06 -0700 |
| commit | 846f7df0b717ff30ec160c399a90df1387ef0e5d (patch) | |
| tree | 1393273d241605b9bd0d7ba0912c681fe8526415 | |
| parent | ebac9f4338592dbf83767ff229e6f219c73bb6b9 (diff) | |
Revert "Revert "[NFC][SampleFDO] In text sample prof reader, report dreport m…"revert-155121-revert-154885-users/mingmingl-llvm/sampleproferror
This reverts commit ebac9f4338592dbf83767ff229e6f219c73bb6b9.
| -rw-r--r-- | llvm/lib/ProfileData/SampleProfReader.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp index d147222fe2ce..15eb1d174d6f 100644 --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -382,9 +382,16 @@ std::error_code SampleProfileReaderText::readImpl() { if (!ParseLine(*LineIt, LineTy, Depth, NumSamples, LineOffset, Discriminator, FName, TargetCountMap, FunctionHash, Attributes, IsFlat)) { - reportError(LineIt.line_number(), - "Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " + - *LineIt); + switch (LineTy) { + case LineType::Metadata: + reportError(LineIt.line_number(), + "Cannot parse metadata: " + *LineIt); + break; + default: + reportError(LineIt.line_number(), + "Expected 'NUM[.NUM]: NUM[ mangled_name:NUM]*', found " + + *LineIt); + } return sampleprof_error::malformed; } if (LineTy != LineType::Metadata && Depth == DepthMetadata) { |
