Function: comp-add-cond-cstrs-target-block

comp-add-cond-cstrs-target-block is a byte-compiled function defined in comp.el.gz.

Signature

(comp-add-cond-cstrs-target-block CURR-BB TARGET-BB-SYM)

Documentation

Return the appropriate basic block to add constraint assumptions into.

CURR-BB is the current basic block. TARGET-BB-SYM is the symbol name of the target block.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp.el.gz
(defun comp-add-cond-cstrs-target-block (curr-bb target-bb-sym)
  "Return the appropriate basic block to add constraint assumptions into.
CURR-BB is the current basic block.
TARGET-BB-SYM is the symbol name of the target block."
  (let* ((target-bb (gethash target-bb-sym
                             (comp-func-blocks comp-func)))
         (target-bb-in-edges (comp-block-in-edges target-bb)))
    (cl-assert target-bb-in-edges)
    (if (length= target-bb-in-edges 1)
        ;; If block has only one predecessor is already suitable for
        ;; adding constraint assumptions.
        target-bb
      (cl-loop
       ;; Search for the first suitable basic block name.
       for i from 0
       for new-name = (intern (format "%s_cstrs_%d" (symbol-name target-bb-sym)
                                      i))
       until (null (gethash new-name (comp-func-blocks comp-func)))
       finally
       ;; Add it.
       (cl-return (comp-add-new-block-between new-name curr-bb target-bb))))))