Compare commits

...

2 Commits

Author SHA1 Message Date
mingmingl
4fd84dbc4e undo empty line 2025-08-21 21:53:46 -07:00
mingmingl
f19f3f75ca [NFC]In text sample prof reader, report dreport more concrete parsing errors for different line types 2025-08-21 21:42:54 -07:00

View File

@ -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) {