[PATCH] D155657: [BOLT][Utils] Pass cmp-rev to nfc-check-setup
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 15:43:21 PDT 2023
Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.
Pass the revision to checkout to (cmp-rev) as nfc-check-setup option.
Simpifies the comparison against arbitrary commit, not just the previous one.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155657
Files:
bolt/utils/nfc-check-setup.py
Index: bolt/utils/nfc-check-setup.py
===================================================================
--- bolt/utils/nfc-check-setup.py
+++ bolt/utils/nfc-check-setup.py
@@ -42,6 +42,11 @@
action="store_true",
help="Checkout back to the starting revision",
)
+ parser.add_argument(
+ "--cmp-rev",
+ default="HEAD^",
+ help="Revision to checkout to compare vs HEAD",
+ )
args, wrapper_args = parser.parse_known_args()
bolt_path = f"{args.build_dir}/bin/llvm-bolt"
@@ -77,8 +82,8 @@
if stash:
# save local changes before checkout
subprocess.run(shlex.split("git stash push -u"), cwd=source_dir)
- # check out the previous commit
- subprocess.run(shlex.split("git checkout -f HEAD^"), cwd=source_dir)
+ # check out the previous/cmp commit
+ subprocess.run(shlex.split(f"git checkout -f {args.cmp_rev}"), cwd=source_dir)
# get the parent commit hash for logging
new_ref = get_git_ref_or_rev(source_dir)
# build the previous commit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155657.541768.patch
Type: text/x-patch
Size: 1042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230718/fe3d46a7/attachment.bin>
More information about the llvm-commits
mailing list