Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Commit daa7185

Browse files
authored
Merge pull request #1 from nikomatsakis/master
do not fail when the incremental messages appear
2 parents 5cba0ca + ac95ebb commit daa7185

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

process.py

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
re_rustc = re.compile("rustc: .*/([\w\-_\.]*)")
1212
re_time_and_mem = re.compile("( *)time: ([0-9\.]*); rss: ([0-9]*)MB\s*(.*)")
1313
re_time = re.compile("( *)time: ([0-9\.]*)\s*(.*)")
14+
re_incremental_reuse = re.compile(" *incremental: re-using (\d+) out of (\d+) modules")
15+
re_incremental_dirty = re.compile(" *module .* is dirty because .* changed or was removed")
1416

1517
re_loc = re.compile("Lines of code: ([0-9]*)")
1618
re_pre_nc = re.compile("Pre\-expansion node count: ([0-9]*)")
@@ -103,29 +105,35 @@ def mk_times(in_file):
103105
cur_times['times'].append((label, float(time)))
104106
cur_times['rss'].append((label, int(0)))
105107
else:
106-
loc_match = re_loc.match(line)
107-
pre_nc_match = re_pre_nc.match(line)
108-
post_nc_match = re_post_nc.match(line)
109-
if loc_match:
110-
loc = loc_match.group(1)
111-
112-
elif pre_nc_match:
113-
pre_nc = pre_nc_match.group(1)
114-
115-
elif post_nc_match:
116-
post_nc = post_nc_match.group(1)
117-
118-
elif cur_times:
119-
if loc:
120-
cur_times['loc'] = int(loc)
121-
cur_times['pre_nc'] = int(pre_nc)
122-
cur_times['post_nc'] = int(post_nc)
123-
all_times.append(cur_times)
124-
cur_times = None
125-
last_file = None
126-
loc = None
127-
pre_nc = None
128-
post_nc = None
108+
incremental_reuse_match = re_incremental_reuse.match(line)
109+
incremental_dirty_match = re_incremental_dirty.match(line)
110+
if incremental_reuse_match or incremental_dirty_match:
111+
# FIXME -- might be useful to plot the reuse data somewhere
112+
pass
113+
else:
114+
loc_match = re_loc.match(line)
115+
pre_nc_match = re_pre_nc.match(line)
116+
post_nc_match = re_post_nc.match(line)
117+
if loc_match:
118+
loc = loc_match.group(1)
119+
120+
elif pre_nc_match:
121+
pre_nc = pre_nc_match.group(1)
122+
123+
elif post_nc_match:
124+
post_nc = post_nc_match.group(1)
125+
126+
elif cur_times:
127+
if loc:
128+
cur_times['loc'] = int(loc)
129+
cur_times['pre_nc'] = int(pre_nc)
130+
cur_times['post_nc'] = int(post_nc)
131+
all_times.append(cur_times)
132+
cur_times = None
133+
last_file = None
134+
loc = None
135+
pre_nc = None
136+
post_nc = None
129137

130138

131139
rustc_match = re_rustc.match(line)
@@ -139,7 +147,8 @@ def merge_times(times):
139147
for t in times:
140148
t.sort(key=lambda t: t['crate'])
141149
if len(t) != len(times[0]):
142-
print "Inconsistent data"
150+
print "Inconsistent data: len(t)=%s len(times[0])=%s" % (
151+
len(t), len(times[0]))
143152
return
144153

145154
crates = []

0 commit comments

Comments
 (0)