[BOLT] Fix diagnostics printing in data aggregator

Summary: Print correct part of the string while reporting an error.

(cherry picked from FBD8745329)
This commit is contained in:
Maksim Panchenko 2018-07-05 20:47:38 -07:00
parent d7b2474f83
commit b447979b8c
1 changed files with 2 additions and 2 deletions

View File

@ -655,7 +655,7 @@ ErrorOr<LBREntry> DataAggregator::parseLBREntry() {
if (MispredStr.size() != 1 ||
(MispredStr[0] != 'P' && MispredStr[0] != 'M')) {
reportError("expected single char for mispred bit");
Diag << "Found: " << OffsetStr << "\n";
Diag << "Found: " << MispredStr << "\n";
return make_error_code(llvm::errc::io_error);
}
Res.Mispred = MispredStr[0] == 'M';
@ -665,7 +665,7 @@ ErrorOr<LBREntry> DataAggregator::parseLBREntry() {
return EC;
if (Rest.get().size() < 5) {
reportError("expected rest of LBR entry");
Diag << "Found: " << OffsetStr << "\n";
Diag << "Found: " << Rest.get() << "\n";
return make_error_code(llvm::errc::io_error);
}
return Res;