[PATCH] D76796: [llvm-cov] Improve error message for missing profdata

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 13:05:16 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9eb1b41811c7: [llvm-cov] Improve error message for missing profdata (authored by efriedma).

Changed prior to commit:
  https://reviews.llvm.org/D76796?vs=252648&id=253676#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76796/new/

https://reviews.llvm.org/D76796

Files:
  llvm/test/tools/llvm-cov/misssing-profdata.test
  llvm/tools/llvm-cov/CodeCoverage.cpp


Index: llvm/tools/llvm-cov/CodeCoverage.cpp
===================================================================
--- llvm/tools/llvm-cov/CodeCoverage.cpp
+++ llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -867,8 +867,8 @@
   }
 
   sys::fs::file_status Status;
-  if (sys::fs::status(PGOFilename, Status)) {
-    error("profdata file error: can not get the file status. \n");
+  if (std::error_code EC = sys::fs::status(PGOFilename, Status)) {
+    error("Could not read profile data!", EC.message());
     return 1;
   }
 
Index: llvm/test/tools/llvm-cov/misssing-profdata.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-cov/misssing-profdata.test
@@ -0,0 +1,2 @@
+RUN: not llvm-cov show -instr-profile=%t.nonexistent %t.nonexistent 2>&1 | FileCheck %s
+CHECK: Could not read profile data


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76796.253676.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/b6950018/attachment-0001.bin>


More information about the llvm-commits mailing list