[llvm] r290278 - [sancov] skip duplicated points
Mike Aizatsky via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 21 14:10:01 PST 2016
Author: aizatsky
Date: Wed Dec 21 16:10:01 2016
New Revision: 290278
URL: http://llvm.org/viewvc/llvm-project?rev=290278&view=rev
Log:
[sancov] skip duplicated points
Modified:
llvm/trunk/tools/sancov/sancov.cc
Modified: llvm/trunk/tools/sancov/sancov.cc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/sancov/sancov.cc?rev=290278&r1=290277&r2=290278&view=diff
==============================================================================
--- llvm/trunk/tools/sancov/sancov.cc (original)
+++ llvm/trunk/tools/sancov/sancov.cc Wed Dec 21 16:10:01 2016
@@ -408,6 +408,8 @@ static void operator<<(JSONWriter &W,
for (const auto &P : PointsByFn) {
std::string FunctionName = P.first;
+ std::set<std::string> WrittenIds;
+
ByFn->key(FunctionName);
// Output <point_id> : "<line>:<col>".
@@ -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));
}
More information about the llvm-commits
mailing list