diff options
| author | Mike Aizatsky <aizatsky@chromium.org> | 2016-12-21 22:10:01 +0000 |
|---|---|---|
| committer | Mike Aizatsky <aizatsky@chromium.org> | 2016-12-21 22:10:01 +0000 |
| commit | bfe5045b9c02217cab683d5c18bd3aa645de2e83 (patch) | |
| tree | 267d8a7b69f59ce57b2b6713eaa067b4bd4d9cc6 | |
| parent | 987f6420accf4f667b6b1b11212cce44d12464de (diff) | |
| download | bcm5719-llvm-bfe5045b9c02217cab683d5c18bd3aa645de2e83.tar.gz bcm5719-llvm-bfe5045b9c02217cab683d5c18bd3aa645de2e83.zip | |
[sancov] skip duplicated points
llvm-svn: 290278
| -rw-r--r-- | llvm/tools/sancov/sancov.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/sancov/sancov.cc b/llvm/tools/sancov/sancov.cc index d7ce120c7e2..ff2039de35e 100644 --- a/llvm/tools/sancov/sancov.cc +++ b/llvm/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<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)); } |

