diff options
author | Kostya Serebryany <kcc@google.com> | 2015-03-18 00:23:44 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-03-18 00:23:44 +0000 |
commit | 3be65454a60e1aac3bb120b3334c322a637e1031 (patch) | |
tree | 83d13e5bcef7f5de6d421d6190cfb0e88fc883f8 /lib/sanitizer_common/scripts | |
parent | fdadb15ad3ddb79538fb6c8ffbff6f012fcc7b6b (diff) |
[sanitizer] add run-time a flag coverage_order_pcs. When true, the PCs are dumped in the order of their appearance
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@232573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/scripts')
-rwxr-xr-x | lib/sanitizer_common/scripts/sancov.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sanitizer_common/scripts/sancov.py b/lib/sanitizer_common/scripts/sancov.py index 1614877ab..443521633 100755 --- a/lib/sanitizer_common/scripts/sancov.py +++ b/lib/sanitizer_common/scripts/sancov.py @@ -30,20 +30,23 @@ def ReadOneFile(path, bits): f.seek(0, 2) size = f.tell() f.seek(0, 0) - s = set(array.array(TypeCodeForBits(bits), f.read(size))) + s = array.array(TypeCodeForBits(bits), f.read(size)) print >>sys.stderr, "%s: read %d PCs from %s" % (prog_name, size * 8 / bits, path) return s def Merge(files, bits): s = set() for f in files: - s = s.union(ReadOneFile(f, bits)) + s = s.union(set(ReadOneFile(f, bits))) print >> sys.stderr, "%s: %d files merged; %d PCs total" % \ (prog_name, len(files), len(s)) return sorted(s) def PrintFiles(files, bits): - s = Merge(files, bits) + if len(files) > 1: + s = Merge(files, bits) + else: # If there is just on file, print the PCs in order. + s = ReadOneFile(files[0], bits) for i in s: print "0x%x" % i |