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 f930ff1..afa7147 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 @@ -79,12 +79,14 @@ :compiler compiler :file file :action compiler-action - :output output) - (pcase action - ('debug (format "-mllvm -debug-only=%s" (ll/read-pass-name "Which pass? "))) - ('before-after (let ((pass (ll/read-pass-name "Which pass? "))) - (format "-mllvm -print-before=%s -mllvm -print-after=%s" pass pass))) - ('changed "-mllvm -print-before-all")) + :output output + :flags + (list + (pcase action + ('debug (format "-mllvm -debug-only=%s" (ll/read-pass-name "Which pass? "))) + ('before-after (let ((pass (ll/read-pass-name "Which pass? "))) + (format "-mllvm -print-before=%s -mllvm -print-after=%s" pass pass))) + ('changed "-mllvm -print-before-all")))) " ") " ")))) diff --git a/lisp/llvm-lib/llvm-shared.el b/lisp/llvm-lib/llvm-shared.el index dd1ba03..29975a3 100644 --- a/lisp/llvm-lib/llvm-shared.el +++ b/lisp/llvm-lib/llvm-shared.el @@ -247,8 +247,8 @@ (apply (lls/conf-get 'dis-command-fun) args)) ;; ========================= LLVM Build Dirs ========================= -(cl-defun lls/default-comp-fun (&key compiler file action output rest) - (string-join +(cl-defun lls/default-comp-fun (&key compiler file action output flags) + (--> (list compiler (lls/get-clang-options) (string-join rest " ") @@ -259,11 +259,13 @@ ('preprocess "-E") ('llvm-ir "-S -emit-llvm") ('executable "")) + flags "-o -" (or (and output (format "| tee %s" output)) "")) - " ")) + (flatten-list it) + (string-join it " "))) (defun ll/read-pass () (completing-read "Which pass? "