|
57 | 57 | extra_opt_args))
|
58 | 58 |
|
59 | 59 | lst = pipeline.fromStr(args.passes)
|
60 |
| -passes = '-passes={}'.format(pipeline.toStr(lst)) |
61 | 60 | ll_input = args.input
|
62 | 61 |
|
63 | 62 | # Step #-1
|
|
67 | 66 | if not args.dont_expand_passes:
|
68 | 67 | run_args = [
|
69 | 68 | args.opt_binary, '-disable-symbolication', '-disable-output',
|
70 |
| - '-print-pipeline-passes', passes, ll_input |
| 69 | + '-print-pipeline-passes', '-passes={}'.format(pipeline.toStr(lst)), |
| 70 | + ll_input |
71 | 71 | ]
|
72 | 72 | run_args.extend(extra_opt_args)
|
73 | 73 | opt = subprocess.run(run_args,
|
|
81 | 81 | exit(1)
|
82 | 82 | stdout = opt.stdout.decode()
|
83 | 83 | stdout = stdout[:stdout.rfind('\n')]
|
84 |
| - print('Expanded pass sequence: {}'.format(stdout)) |
85 |
| - passes = '-passes={}'.format(stdout) |
| 84 | + lst = pipeline.fromStr(stdout) |
| 85 | + print('Expanded pass sequence: {}'.format(pipeline.toStr(lst))) |
86 | 86 |
|
87 | 87 | # Step #0
|
88 | 88 | # Confirm that the given input, passes and options result in failure.
|
89 | 89 | print('---Starting step #0---')
|
90 | 90 | run_args = [
|
91 |
| - args.opt_binary, '-disable-symbolication', '-disable-output', passes, |
92 |
| - ll_input |
| 91 | + args.opt_binary, '-disable-symbolication', '-disable-output', |
| 92 | + '-passes={}'.format(pipeline.toStr(lst)), ll_input |
93 | 93 | ]
|
94 | 94 | run_args.extend(extra_opt_args)
|
95 | 95 | opt = subprocess.run(run_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
121 | 121 | if not args.dont_remove_empty_pm:
|
122 | 122 | lstA = pipeline.prune(lstA)
|
123 | 123 | lstB = pipeline.prune(lstB)
|
124 |
| - passesA = '-passes=' + pipeline.toStr(lstA) |
125 |
| - passesB = '-passes=' + pipeline.toStr(lstB) |
126 | 124 |
|
127 | 125 | intermediate = 'intermediate-0.ll' if idx % 2 else 'intermediate-1.ll'
|
128 | 126 | intermediate = tmpd.name + '/' + intermediate
|
129 | 127 | run_args = [
|
130 | 128 | args.opt_binary, '-disable-symbolication', '-S', '-o', intermediate,
|
131 |
| - passesA, ll_input |
| 129 | + '-passes={}'.format(pipeline.toStr(lstA)), ll_input |
132 | 130 | ]
|
133 | 131 | run_args.extend(extra_opt_args)
|
134 | 132 | optA = subprocess.run(run_args,
|
135 | 133 | stdout=subprocess.PIPE,
|
136 | 134 | stderr=subprocess.PIPE)
|
137 | 135 | run_args = [
|
138 |
| - args.opt_binary, '-disable-symbolication', '-disable-output', passesB, |
139 |
| - intermediate |
| 136 | + args.opt_binary, '-disable-symbolication', '-disable-output', |
| 137 | + '-passes={}'.format(pipeline.toStr(lstB)), intermediate |
140 | 138 | ]
|
141 | 139 | run_args.extend(extra_opt_args)
|
142 | 140 | optB = subprocess.run(run_args,
|
|
161 | 159 | [lstA, lstB] = pipeline.split(lst, idx)
|
162 | 160 | if not args.dont_remove_empty_pm:
|
163 | 161 | lstA = pipeline.prune(lstA)
|
164 |
| - passesA = '-passes=' + pipeline.toStr(lstA) |
165 | 162 | run_args = [
|
166 |
| - args.opt_binary, '-disable-symbolication', '-disable-output', passesA, |
167 |
| - ll_input |
| 163 | + args.opt_binary, '-disable-symbolication', '-disable-output', |
| 164 | + '-passes={}'.format(pipeline.toStr(lstA)), ll_input |
168 | 165 | ]
|
169 | 166 | run_args.extend(extra_opt_args)
|
170 | 167 | optA = subprocess.run(run_args,
|
|
188 | 185 | candLst = pipeline.remove(lst, idx)
|
189 | 186 | if not args.dont_remove_empty_pm:
|
190 | 187 | candLst = pipeline.prune(candLst)
|
191 |
| - passes = '-passes=' + pipeline.toStr(candLst) |
192 | 188 | run_args = [
|
193 | 189 | args.opt_binary, '-disable-symbolication', '-disable-output',
|
194 |
| - passes, ll_input |
| 190 | + '-passes={}'.format(pipeline.toStr(candLst)), ll_input |
195 | 191 | ]
|
196 | 192 | run_args.extend(extra_opt_args)
|
197 | 193 | opt = subprocess.run(run_args,
|
|
0 commit comments