File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -138,11 +138,7 @@ def main():
138
138
shlex .split ("cmake --build . --target llvm-bolt" ), cwd = args .build_dir
139
139
)
140
140
141
- # rename llvm-bolt
142
- if not os .path .exists (bolt_path ):
143
- sys .exit (f"Failed to build the previous revision: '{ bolt_path } '" )
144
- os .replace (bolt_path , f"{ bolt_path } .old" )
145
-
141
+ # A build error may have occurred, so switch back before renaming.
146
142
if args .switch_back :
147
143
if stash :
148
144
subprocess .run (shlex .split ("git stash pop" ), cwd = source_dir )
@@ -153,6 +149,12 @@ def main():
153
149
f"to { new_ref } . Local changes were stashed. Switch back using\n \t "
154
150
f"git checkout { old_ref } \n "
155
151
)
152
+
153
+ # rename llvm-bolt
154
+ if not os .path .exists (bolt_path ):
155
+ sys .exit (f"Failed to build the previous revision: '{ bolt_path } '" )
156
+ os .replace (bolt_path , f"{ bolt_path } .old" )
157
+
156
158
print (
157
159
f"Build directory { args .build_dir } is ready to run BOLT tests, e.g.\n "
158
160
"\t bin/llvm-lit -sv tools/bolt/test\n or\n "
You can’t perform that action at this time.
0 commit comments