diff options
author | Kostya Serebryany <kcc@google.com> | 2014-03-14 07:09:01 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2014-03-14 07:09:01 +0000 |
commit | de54e50adca1ed8572a97ec8a923b9823d8850ae (patch) | |
tree | 5752e1efe0b0c59f90da8a6090b8c97972b5e598 /lib/sanitizer_common/sanitizer_bvgraph.h | |
parent | 1f0808c4fc2754b5c99c473bd488a7ab0e6af901 (diff) |
[sanitizer] in bitset-based deadlock detector collect edge's stack trace when an edge is added to the graph (in following CLs these stack traces will be added to the report)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_bvgraph.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_bvgraph.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/sanitizer_common/sanitizer_bvgraph.h b/lib/sanitizer_common/sanitizer_bvgraph.h index 157b9320e..a55757b5d 100644 --- a/lib/sanitizer_common/sanitizer_bvgraph.h +++ b/lib/sanitizer_common/sanitizer_bvgraph.h @@ -47,12 +47,16 @@ class BVGraph { } // Returns true if at least one new edge was added. - bool addEdges(const BV &from, uptr to) { - bool res = false; + uptr addEdges(const BV &from, uptr to, uptr added_edges[], + uptr max_added_edges) { + uptr res = 0; t1.copyFrom(from); - while (!t1.empty()) - if (v[t1.getAndClearFirstOne()].setBit(to)) - res = true; + while (!t1.empty()) { + uptr node = t1.getAndClearFirstOne(); + if (v[node].setBit(to)) + if (res < max_added_edges) + added_edges[res++] = node; + } return res; } |