1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Check for errors after reading a sample profile in llvm-profdata.

After reading the profile, check if the reader returned any errors
before showing the profile.

llvm-svn: 247873
This commit is contained in:
Diego Novillo 2015-09-17 00:17:21 +00:00
parent 3a461df12f
commit c0de8306fc

View File

@ -195,7 +195,9 @@ static int showSampleProfile(std::string Filename, bool ShowCounts,
exitWithError(EC.message(), Filename);
auto Reader = std::move(ReaderOrErr.get());
Reader->read();
if (std::error_code EC = Reader->read())
exitWithError(EC.message(), Filename);
if (ShowAllFunctions || ShowFunction.empty())
Reader->dump(OS);
else