diff --git a/llvm/tools/sancov/sancov.cpp b/llvm/tools/sancov/sancov.cpp --- a/llvm/tools/sancov/sancov.cpp +++ b/llvm/tools/sancov/sancov.cpp @@ -131,8 +131,12 @@ // Contents of .sancov file: list of coverage point addresses that were // executed. struct RawCoverage { - explicit RawCoverage(std::unique_ptr> Addrs) - : Addrs(std::move(Addrs)) {} + explicit RawCoverage(std::unique_ptr> RawAddrs) + : Addrs(std::move(RawAddrs)) { + // Ignore slots that are zero, so a runtime implementation is not required + // to compactify the data. + Addrs->erase(0); + } // Read binary .sancov file. static ErrorOr> @@ -1231,7 +1235,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 "