[pypy-commit] pypy default: Change the space separator to a '~' because if we have no bytecode_name
arigo
pypy.commits at gmail.com
Sun Nov 13 04:45:23 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r88337:e17c0d890864
Date: 2016-11-13 10:44 +0100
http://bitbucket.org/pypy/pypy/changeset/e17c0d890864/
Log: Change the space separator to a '~' because if we have no
bytecode_name to provide, it's tempting to leave out the final
space, and then the regexp doesn't match
diff --git a/rpython/tool/jitlogparser/parser.py b/rpython/tool/jitlogparser/parser.py
--- a/rpython/tool/jitlogparser/parser.py
+++ b/rpython/tool/jitlogparser/parser.py
@@ -17,7 +17,7 @@
# 'bytecode_no = currentlineno ^ -1': i.e. it abuses bytecode_no,
# which doesn't make sense in the generic format, as a negative
# number
- m = re.match(r'(.+?);(.+?):(\d+)-(\d+) (.*)', arg)
+ m = re.match(r'(.+?);(.+?):(\d+)-(\d+)~(.*)', arg)
if m is not None:
mask = -1
else:
diff --git a/rpython/tool/jitlogparser/test/test_parser.py b/rpython/tool/jitlogparser/test/test_parser.py
--- a/rpython/tool/jitlogparser/test/test_parser.py
+++ b/rpython/tool/jitlogparser/test/test_parser.py
@@ -404,16 +404,16 @@
print >> f, "F#6"
loop = parse("""
[]
- debug_merge_point(0, 0, 'myfunc;%(filename)s:2-2 one')
- debug_merge_point(0, 0, 'myfunc;%(filename)s:2-2 two')
- debug_merge_point(0, 0, 'myfunc;%(filename)s:2-4 three')
- debug_merge_point(0, 0, 'myfunc;%(filename)s:2-4 four')
+ debug_merge_point(0, 0, 'myfunc;%(filename)s:2-2~one')
+ debug_merge_point(0, 0, 'myfunc;%(filename)s:2-2~two')
+ debug_merge_point(0, 0, 'myfunc;%(filename)s:2-4~')
+ debug_merge_point(0, 0, 'myfunc;%(filename)s:2-4~four')
""" % {'filename': sourcefile})
f = Function.from_operations(loop.operations, LoopStorage())
expect = [(2, 'one', True),
(2, 'two', False),
- (4, 'three', True),
+ (4, '', True),
(4, 'four', False)]
assert len(f.chunks) == len(expect)
More information about the pypy-commit
mailing list