From 16c218cc2577608c70f685d4e0b34e86128ce702 Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Sat, 4 Apr 2026 15:57:01 -0500 Subject: [PATCH] Rename function build target --- lisp/llvm-lib/lib-comp-dev.el | 11 ++++++----- lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el | 4 ++-- .../llvm-act-on-file/act-on-llvm-source-file.el | 2 +- lisp/llvm-lib/llvm-act-on-file/act-on-test-file.el | 4 ++-- lisp/llvm-lib/llvm-build-command.el | 2 +- lisp/llvm-lib/llvm-build-tool.el | 4 ++-- lisp/ti-config/libraries | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lisp/llvm-lib/lib-comp-dev.el b/lisp/llvm-lib/lib-comp-dev.el index 2a67c96..00af895 100644 --- a/lisp/llvm-lib/lib-comp-dev.el +++ b/lisp/llvm-lib/lib-comp-dev.el @@ -32,19 +32,20 @@ (require 'use-package) (use-package realgud-lldb) -;; =========================== LLVM Rebuild ========================== +;; =========================== Rebuild ========================== -(defvar llvm-core-count +(defvar comp-dev/default-parallelism (nprocs)) -(defun lls/run-build-command (build-dir targets &optional verbose) +(defun comp-dev/build-target (build-dir targets &optional verbose) (let ((cmake-make-program - (if (string= "Makefile" (car (directory-files build-dir nil "^\\(build\\.ninja$\\|Makefile\\)$"))) + (if (string= "Makefile" (car (directory-files build-dir nil + (rx line-start (or "build.ninja" "Makefile") line-end)))) "make" "ninja"))) (format "set -o pipefail && CLICOLOR_FORCE=1 %s -C %s -j %d %s %s 2>&1 | tee ninja.log" cmake-make-program - build-dir llvm-core-count + build-dir comp-dev/default-parallelism (if verbose "-v" "") (string-join targets " ")))) diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el index 9e675b1..f3577af 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-c-file.el @@ -38,7 +38,7 @@ (defun ll/ensure-clang-binary-built (dir) ;; TODO: assumed build-dir constant, should take as argument and prompt ;; further up - (lls/run-build-command dir '("clang"))) + (comp-dev/build-target dir '("clang"))) (defun ll/get-c-action-map () (append @@ -122,7 +122,7 @@ (call-interactively #'recompile))))) (defun ll/diff-on-optionset (file action) - (let ((comm (ll/build-clang-command (lls/un-trampify file) action)) + (let ((comm (ll/build-clang-command file action)) (extra-option (read-string "Extra option? ")) (pipe (if (y-or-n-p "Diff assembly (y) or debug (n)? ") ">" "2>"))) diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-source-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-source-file.el index d579992..18ca3c0 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-source-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-source-file.el @@ -36,7 +36,7 @@ (let ((dir (lls/get-llvm-build-dir))) (--> file (list (format "touch %s" it) - (lls/run-build-command dir (list (concat it "^")) t)) + (comp-dev/build-target dir (list (concat it "^")) t)) (string-join it " && ") (compilation-start it nil (lambda (_) diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-test-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-test-file.el index 326c16a..0084054 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-test-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-test-file.el @@ -72,7 +72,7 @@ ;; further up (let ((dir (lls/get-llvm-build-dir)) (tools (ll/get-required-binaries-for-test file))) - (lls/run-build-command dir tools))) + (comp-dev/build-target dir tools))) (defun ll/build-lit-command (file action) (format "%s %s %s" @@ -164,7 +164,7 @@ (when tools (--> ;; TODO: Assuming debug folder, (lls/get-llvm-build-dir) doesn't work - (lls/run-build-command "/scratch/benson/tools3/llvm_cgt/build/Debug/llvm" (seq-uniq tools)) + (comp-dev/build-target "/scratch/benson/tools3/llvm_cgt/build/Debug/llvm" (seq-uniq tools)) (compilation-start it nil diff --git a/lisp/llvm-lib/llvm-build-command.el b/lisp/llvm-lib/llvm-build-command.el index c5087f0..121a088 100644 --- a/lisp/llvm-lib/llvm-build-command.el +++ b/lisp/llvm-lib/llvm-build-command.el @@ -37,7 +37,7 @@ (compilation-start (--> (list (format "touch %s" file) - (lls/run-build-command + (comp-dev/build-target build-dir (list (format "%s^" file)) t)) (string-join it " && ")) nil diff --git a/lisp/llvm-lib/llvm-build-tool.el b/lisp/llvm-lib/llvm-build-tool.el index d80508f..33344ec 100644 --- a/lisp/llvm-lib/llvm-build-tool.el +++ b/lisp/llvm-lib/llvm-build-tool.el @@ -42,7 +42,7 @@ ;; "llc"))))) ;; (let* ((buffer-name (funcall lls/name-llvm-build-buffer directory tools))) ;; (compilation-start -;; (lls/run-build-command (lls/un-trampify directory) tools) +;; (comp-dev/build-target directory tools) ;; nil ;; (lambda (_) buffer-name)))) @@ -56,7 +56,7 @@ "llc"))))) (name (funcall lls/name-llvm-build-buffer directory tools)) - (lls/run-build-command (lls/un-trampify directory) tools)) + (comp-dev/build-target directory tools)) (provide 'llvm-build-tool) ;;; llvm-build-tool.el ends here diff --git a/lisp/ti-config/libraries b/lisp/ti-config/libraries index 5e5d498..9475fc9 160000 --- a/lisp/ti-config/libraries +++ b/lisp/ti-config/libraries @@ -1 +1 @@ -Subproject commit 5e5d4984816ace917f78190e04936b038c43365b +Subproject commit 9475fc97631749af237b5fcda503a0b945c16eab