diff options
author | Diego Novillo <dnovillo@google.com> | 2015-09-17 00:17:21 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2015-09-17 00:17:21 +0000 |
commit | c6d032ab8153040cec8bc1610ba004081be85f48 (patch) | |
tree | 4b3bbae85a430d4dec64ce765ab5c21085544ed1 /llvm | |
parent | fa6b278f9ca65c0c8a345d7fcad7392f5779be08 (diff) | |
download | bcm5719-llvm-c6d032ab8153040cec8bc1610ba004081be85f48.tar.gz bcm5719-llvm-c6d032ab8153040cec8bc1610ba004081be85f48.zip |
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
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/tools/llvm-profdata/llvm-profdata.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp index 6fb48d8fad5..23fa7b40f50 100644 --- a/llvm/tools/llvm-profdata/llvm-profdata.cpp +++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp @@ -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 |