Rename comp-run.el and comp-cstr.el private functions

* lisp/emacs-lisp/comp-run.el (native-compile-async-skip-p)
(comp-async-runnings, comp-effective-async-max-jobs)
(comp-accept-and-process-async-output, comp-run-async-workers)
(comp-trampoline-search): rename using '--' separator convention for
private functions.
* lisp/emacs-lisp/comp-cstr.el
(comp-cstr-copy, comp-cstrs-homogeneous, comp-split-pos-neg)
(comp-normalize-valset, comp-union-valsets)
(comp-intersection-valsets, comp-normalize-typeset)
(comp-union-typesets, comp-intersect-two-typesets)
(comp-intersect-typesets, comp-range-union)
(comp-range-intersection, comp-range-negation, comp-cstr-add-2)
(comp-cstr-sub-2, comp-cstr-union-homogeneous-no-range)
(comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem)
(comp-cstr-union-1, comp-cstr-union-make)
(comp-cstr-intersection-make): Likewise.
This commit is contained in:
Davide Pola 2024-05-29 17:34:38 +02:00 committed by Andrea Corallo
parent 063b67325b
commit fd61cf3976
2 changed files with 86 additions and 86 deletions

View file

@ -138,7 +138,7 @@ if `confirm-kill-processes' is non-nil."
(declare-function comp-el-to-eln-filename "comp.c")
(declare-function native-elisp-load "comp.c")
(defun native-compile-async-skip-p (file load selector)
(defun native--compile-async-skip-p (file load selector)
"Return non-nil if FILE's compilation should be skipped.
LOAD and SELECTOR work as described in `native--compile-async'."
@ -164,7 +164,7 @@ LOAD and SELECTOR work as described in `native--compile-async'."
(defvar comp-async-compilations (make-hash-table :test #'equal)
"Hash table file-name -> async compilation process.")
(defun comp-async-runnings ()
(defun comp--async-runnings ()
"Return the number of async compilations currently running.
This function has the side effect of cleaning-up finished
processes from `comp-async-compilations'"
@ -178,7 +178,7 @@ processes from `comp-async-compilations'"
(hash-table-count comp-async-compilations))
(defvar comp-num-cpus nil)
(defun comp-effective-async-max-jobs ()
(defun comp--effective-async-max-jobs ()
"Compute the effective number of async jobs."
(if (zerop native-comp-async-jobs-number)
(or comp-num-cpus
@ -190,7 +190,7 @@ processes from `comp-async-compilations'"
(make-variable-buffer-local 'comp-last-scanned-async-output)
;; From warnings.el
(defvar warning-suppress-types)
(defun comp-accept-and-process-async-output (process)
(defun comp--accept-and-process-async-output (process)
"Accept PROCESS output and check for diagnostic messages."
(if native-comp-async-report-warnings-errors
(let ((warning-suppress-types
@ -218,14 +218,14 @@ processes from `comp-async-compilations'"
(defconst comp-valid-source-re (rx ".el" (? ".gz") eos)
"Regexp to match filename of valid input source files.")
(defun comp-run-async-workers ()
(defun comp--run-async-workers ()
"Start compiling files from `comp-files-queue' asynchronously.
When compilation is finished, run `native-comp-async-all-done-hook' and
display a message."
(cl-assert (null comp-no-spawn))
(if (or comp-files-queue
(> (comp-async-runnings) 0))
(unless (>= (comp-async-runnings) (comp-effective-async-max-jobs))
(> (comp--async-runnings) 0))
(unless (>= (comp--async-runnings) (comp--effective-async-max-jobs))
(cl-loop
for (source-file . load) = (pop comp-files-queue)
while source-file
@ -312,7 +312,7 @@ display a message."
(run-hook-with-args
'native-comp-async-cu-done-functions
source-file)
(comp-accept-and-process-async-output process)
(comp--accept-and-process-async-output process)
(ignore-errors (delete-file temp-file))
(let ((eln-file (comp-el-to-eln-filename
source-file1)))
@ -322,10 +322,10 @@ display a message."
(file-exists-p eln-file))
(native-elisp-load eln-file
(eq load1 'late))))
(comp-run-async-workers))
(comp--run-async-workers))
:noquery (not native-comp-async-query-on-exit))))
(puthash source-file process comp-async-compilations))
when (>= (comp-async-runnings) (comp-effective-async-max-jobs))
when (>= (comp--async-runnings) (comp--effective-async-max-jobs))
do (cl-return)))
;; No files left to compile and all processes finished.
(run-hooks 'native-comp-async-all-done-hook)
@ -348,7 +348,7 @@ display a message."
"List of primitives we want to warn about in case of redefinition.
This are essential for the trampoline machinery to work properly.")
(defun comp-trampoline-search (subr-name)
(defun comp--trampoline-search (subr-name)
"Search a trampoline file for SUBR-NAME.
Return the trampoline if found or nil otherwise."
(cl-loop
@ -371,7 +371,7 @@ Return the trampoline if found or nil otherwise."
(memq subr-name native-comp-never-optimize-functions)
(gethash subr-name comp-installed-trampolines-h))
(cl-assert (subr-primitive-p subr))
(when-let ((trampoline (or (comp-trampoline-search subr-name)
(when-let ((trampoline (or (comp--trampoline-search subr-name)
(comp-trampoline-compile subr-name))))
(comp--install-trampoline subr-name trampoline)))))
@ -437,7 +437,7 @@ bytecode definition was not changed in the meantime)."
else
collect i)))
(unless (native-compile-async-skip-p file load selector)
(unless (native--compile-async-skip-p file load selector)
(let* ((out-filename (comp-el-to-eln-filename file))
(out-dir (file-name-directory out-filename)))
(unless (file-exists-p out-dir)
@ -449,11 +449,11 @@ bytecode definition was not changed in the meantime)."
(display-warning 'comp
(format "No write access for %s skipping."
out-filename)))))))
;; Perhaps nothing passed `native-compile-async-skip-p'?
;; Perhaps nothing passed `native--compile-async-skip-p'?
(when (and added-something
;; Don't start if there's one already running.
(zerop (comp-async-runnings)))
(comp-run-async-workers))))
(zerop (comp--async-runnings)))
(comp--run-async-workers))))
;;;###autoload
(defun native-compile-async (files &optional recursively load selector)