This commit is contained in:
Benson Chu 2026-04-04 17:02:59 -05:00
parent 2a0f9fef64
commit 26c05d08c4
9 changed files with 20 additions and 24 deletions

View file

@ -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)))))))

View file

@ -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)
" "))

View file

@ -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`? ")

View file

@ -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) )

View file

@ -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`? ")

View file

@ -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

View file

@ -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)

View file

@ -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)))

View file

@ -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