diff --git a/lisp/llvm-lib/lib-comp-dev.el b/lisp/llvm-lib/lib-comp-dev.el index 5655020..f78242b 100644 --- a/lisp/llvm-lib/lib-comp-dev.el +++ b/lisp/llvm-lib/lib-comp-dev.el @@ -158,19 +158,7 @@ (t (completing-read (format "Which %s? " prompt) collection nil nil initial-input))))) -(defun lls/prompt-tool (tool-regexp &optional directories) - (let (;;(vertico-sort-function nil) - ) - (my/completing-read tool-regexp - (lls/get-tool tool-regexp - (or (and (eq 'string (type-of directories)) - (list directories)) - directories)) - (awhen (ti/current-tools-directory) - (concat (file-name-nondirectory it) - " "))))) - -(defun lls/get-tool (tool-regexp &optional directories) +(defun comp-dev/prompt-tool (tool-regexp &optional directories) (cl-mapcan #'(lambda (dir) (when (file-exists-p dir) (when (string-match-p "/sim/sds11.*" dir) @@ -178,3 +166,11 @@ (directory-files dir t tool-regexp))) (or directories (comp-dev/get-bin-dirs (comp-dev/get-config))))) + +(defun comp-dev/prompt-tool (tool-regexp &optional directories) + (let (;;(vertico-sort-function nil) + ) + (my/completing-read tool-regexp + (comp-dev/prompt-tool tool-regexp + (or (and (eq 'string (type-of directories)) + (list directories))))))) diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-asm-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-asm-file.el index f3a0963..7474137 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-asm-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-asm-file.el @@ -37,14 +37,14 @@ (list (string-join (list - (lls/prompt-tool "clang$") + (comp-dev/prompt-tool "clang$") file "-target c29 -c -o" temp-file) " ") (string-join (list - (lls/prompt-tool "objdump$") + (comp-dev/prompt-tool "objdump$") "-d" temp-file) " ")) 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 52aa00e..d2c1a87 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 @@ -47,7 +47,7 @@ ll/c-file-action-map)) (defun ll/clang-output-disassemble-command (file) - (let ((compiler (lls/prompt-tool "clang$")) + (let ((compiler (comp-dev/prompt-tool "clang$")) (tmp-file (make-temp-file (file-name-sans-extension (file-name-nondirectory file))))) (string-join (list (lls/get-clang-command-fun :compiler compiler @@ -76,7 +76,7 @@ (let ((end (aml/get-map-prop (ll/get-c-action-map) action :end-state)) - (compiler (lls/prompt-tool (comp-dev/tool-name (comp-dev/get-config) 'compiler)))) + (compiler (comp-dev/prompt-tool (comp-dev/tool-name (comp-dev/get-config) 'compiler)))) (string-join (list (when (y-or-n-p "Would you like to `rr record`? ") diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-ll-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-ll-file.el index cd3f211..006fae0 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-ll-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-ll-file.el @@ -38,7 +38,7 @@ (defun ll/build-llc-command (file action &optional output pass) (lls/get-llc-command-fun :file file :action action :output output :pass pass - :llc (lls/prompt-tool "llc$"))) + :llc (comp-dev/prompt-tool "llc$"))) (defun ll/ll-file-diff-action (file action) ) diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-dump-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-dump-file.el index e1d81dc..16d8128 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-dump-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-llvm-dump-file.el @@ -56,7 +56,7 @@ (defun ll/act-on-llvm-dump-file (fname) (let* ((action (aml/read-action-map ll/dump-file-action-map)) (command-flags (ll/dump-extract-command-flags (ll/dump-to-sh-file fname))) - (clang (lls/prompt-tool "clang$"))) + (clang (comp-dev/prompt-tool "clang$"))) (compilation-start (concat (when (y-or-n-p "Would you like to `rr record`? ") diff --git a/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el b/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el index 5be3679..062e3cf 100644 --- a/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el +++ b/lisp/llvm-lib/llvm-act-on-file/act-on-tablegen-file.el @@ -37,7 +37,7 @@ (string-join it " "))) (defun ll-tblgen/gen-command (file flags output-file build-dir) - (let ((bin (car (lls/get-tool "llvm-tblgen$" (list (expand-file-name "bin" build-dir)))))) + (let ((bin (car (comp-dev/prompt-tool "llvm-tblgen$" (list (expand-file-name "bin" build-dir)))))) (format "%s %s %s %s" bin file 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 0084054..595beed 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 @@ -76,7 +76,7 @@ (defun ll/build-lit-command (file action) (format "%s %s %s" - (lls/prompt-tool "llvm-lit") + (comp-dev/prompt-tool "llvm-lit") (pcase action ('verbose "-v") ('all "-a") @@ -121,7 +121,7 @@ (resolved (save-match-data (or (gethash tool lookups) - (aprog1 (lls/prompt-tool (concat tool "$")) + (aprog1 (comp-dev/prompt-tool (concat tool "$")) (puthash tool it lookups)))))) (replace-match resolved nil nil res 1)))) it) diff --git a/lisp/llvm-lib/llvm-comp-dev.el b/lisp/llvm-lib/llvm-comp-dev.el index c97de99..01cfb5f 100644 --- a/lisp/llvm-lib/llvm-comp-dev.el +++ b/lisp/llvm-lib/llvm-comp-dev.el @@ -189,7 +189,7 @@ (defun lls/lldb (binary) (interactive - (list (lls/prompt-tool (rx (or "clang" "llc") line-end)))) + (list (comp-dev/prompt-tool (rx (or "clang" "llc") line-end)))) (realgud--lldb (format "lldb %s" binary))) diff --git a/lisp/llvm-lib/llvm-gdb-command.el b/lisp/llvm-lib/llvm-gdb-command.el index eb6d016..4c4b5b8 100644 --- a/lisp/llvm-lib/llvm-gdb-command.el +++ b/lisp/llvm-lib/llvm-gdb-command.el @@ -55,7 +55,7 @@ (interactive) (let* ((buf (current-buffer)) (fname (buffer-file-name buf)) - (clang (lls/prompt-tool "clang$")) + (clang (comp-dev/prompt-tool "clang$")) (command (with-current-buffer buf (cond ((or compilation-minor-mode