[PATCH] D63695: [sancov] Ignore PC samples with value 0

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 12:25:00 PDT 2019


mcgrathr updated this revision to Diff 206277.
mcgrathr added a comment.

Move logic out of RawCoverage constructor.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63695

Files:
  llvm/tools/sancov/sancov.cpp


Index: llvm/tools/sancov/sancov.cpp
===================================================================
--- llvm/tools/sancov/sancov.cpp
+++ llvm/tools/sancov/sancov.cpp
@@ -259,6 +259,10 @@
     return make_error_code(errc::illegal_byte_sequence);
   }
 
+  // Ignore slots that are zero, so a runtime implementation is not required
+  // to compactify the data.
+  Addrs->erase(0);
+
   return std::unique_ptr<RawCoverage>(new RawCoverage(std::move(Addrs)));
 }
 
@@ -1229,7 +1233,7 @@
   llvm::InitializeAllTargetMCs();
   llvm::InitializeAllDisassemblers();
 
-  cl::ParseCommandLineOptions(Argc, Argv, 
+  cl::ParseCommandLineOptions(Argc, Argv,
       "Sanitizer Coverage Processing Tool (sancov)\n\n"
       "  This tool can extract various coverage-related information from: \n"
       "  coverage-instrumented binary files, raw .sancov files and their "


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63695.206277.patch
Type: text/x-patch
Size: 863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190624/9c2ab7f9/attachment.bin>


More information about the llvm-commits mailing list