[llvm] [llvm-cov] - Output better error message when the error kind is `coveragemap_error::malforme`. (PR #65264)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 06:34:59 PDT 2023


================
@@ -925,26 +926,45 @@ LineCoverageIterator &LineCoverageIterator::operator++() {
   return *this;
 }
 
-static std::string getCoverageMapErrString(coveragemap_error Err) {
+static std::string getCoverageMapErrString(coveragemap_error Err,
+                                           const std::string &ErrMsg = "") {
+  std::string Msg;
+  raw_string_ostream OS(Msg);
+
   switch (Err) {
   case coveragemap_error::success:
-    return "Success";
+    OS << "Success";
----------------
MaggieYingYi wrote:

The diagnostic formatting of llvm-cov has been updated to follow Clang in the commit https://github.com/llvm/llvm-project/pull/65264/commits/521abebc6c3a64f7c4060564300f9725a5a1a751.


https://github.com/llvm/llvm-project/pull/65264


More information about the llvm-commits mailing list