From 57e4fa8aaaaebe3dc8b36b2336d76ebb2e7541a6 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Wed, 21 Dec 2016 22:10:01 +0000 Subject: [PATCH] [sancov] skip duplicated points git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290278 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/sancov/sancov.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/sancov/sancov.cc b/tools/sancov/sancov.cc index d7ce120c7e2..ff2039de35e 100644 --- a/tools/sancov/sancov.cc +++ b/tools/sancov/sancov.cc @@ -408,6 +408,8 @@ static void operator<<(JSONWriter &W, for (const auto &P : PointsByFn) { std::string FunctionName = P.first; + std::set WrittenIds; + ByFn->key(FunctionName); // Output : ":". @@ -416,7 +418,10 @@ static void operator<<(JSONWriter &W, for (const auto &Loc : Point->Locs) { if (Loc.FileName != FileName || Loc.FunctionName != FunctionName) continue; + if (WrittenIds.find(Point->Id) != WrittenIds.end()) + continue; + WrittenIds.insert(Point->Id); ById->key(Point->Id); W << (utostr(Loc.Line) + ":" + utostr(Loc.Column)); } -- 2.11.0