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():
138138 shlex .split ("cmake --build . --target llvm-bolt" ), cwd = args .build_dir
139139 )
140140
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.
146142 if args .switch_back :
147143 if stash :
148144 subprocess .run (shlex .split ("git stash pop" ), cwd = source_dir )
@@ -153,6 +149,12 @@ def main():
153149 f"to { new_ref } . Local changes were stashed. Switch back using\n \t "
154150 f"git checkout { old_ref } \n "
155151 )
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+
156158 print (
157159 f"Build directory { args .build_dir } is ready to run BOLT tests, e.g.\n "
158160 "\t bin/llvm-lit -sv tools/bolt/test\n or\n "
You can’t perform that action at this time.
0 commit comments