<commit_before>(in-package #:cleavir-ir)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instructions for Common Lisp operators.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instruction ENTER-INSTRUCTION.
;;;
;;; This instruction encapsulates all the implementation-specific
;;; machinery involved in verifying the argument count and parsing the
;;; arguments.  It has a single successor.

(defclass enter-instruction (instruction one-successor-mixin)
  ((%lambda-list :initarg :lambda-list :accessor lambda-list)
   ;; This slot is meant to contain a list of closed-over variables
   ;; that are not owned by this ENTER-INSTRUCTION, but that are used
   ;; by the instructions owned by this ENTER-INSTRUCTION.  We
   ;; initialize it to the empty list and during later phases we push
   ;; elements onto that list.
   (%imports :initform '() :accessor imports)))

(defun make-enter-instruction
    (lambda-list &optional (successor nil successor-p))
  (let* ((outputs (loop for item in lambda-list
			append (cond ((member item lambda-list-keywords) '())
				     ((consp item)
				      (if (= (length item) 3)
					  (cdr item)
					  item))
				     (t (list item))))))
    (make-instance 'enter-instruction
      :lambda-list lambda-list
      :outputs outputs
      :successors (if successor-p (list successor) '()))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instruction NOP-INSTRUCTION.

(defclass nop-instruction (instruction one-successor-mixin)
  ())

(defun make-nop-instruction (successors)
  (make-instance 'nop-instruction
    :successors successors))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instruction ASSIGNMENT-INSTRUCTION.

(defclass assignment-instruction (instruction one-successor-mixin)
  ())

(defun make-assignment-instruction
    (input output &optional (successor nil successor-p))
  (make-instance 'assignment-instruction
    :inputs (list input)
    :outputs (list output)
    :successors (if successor-p (list successor) '())))
<commit_msg>Create an additional output in the ENTER-INSTRUCTION for the static environment.<commit_after>(in-package #:cleavir-ir)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instructions for Common Lisp operators.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instruction ENTER-INSTRUCTION.
;;;
;;; This instruction encapsulates all the implementation-specific
;;; machinery involved in verifying the argument count and parsing the
;;; arguments.  It has a single successor.

(defclass enter-instruction (instruction one-successor-mixin)
  ((%lambda-list :initarg :lambda-list :accessor lambda-list)
   ;; This slot is meant to contain a list of closed-over variables
   ;; that are not owned by this ENTER-INSTRUCTION, but that are used
   ;; by the instructions owned by this ENTER-INSTRUCTION.  We
   ;; initialize it to the empty list and during later phases we push
   ;; elements onto that list.
   (%imports :initform '() :accessor imports)))

(defun make-enter-instruction
    (lambda-list &optional (successor nil successor-p))
  (let* ((outputs (loop for item in lambda-list
			append (cond ((member item lambda-list-keywords) '())
				     ((consp item)
				      (if (= (length item) 3)
					  (cdr item)
					  item))
				     (t (list item))))))
    (make-instance 'enter-instruction
      :lambda-list lambda-list
      ;; We add an additional output that will hold the static
      ;; environment.
      :outputs (cons (new-temporary) outputs)
      :successors (if successor-p (list successor) '()))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instruction NOP-INSTRUCTION.

(defclass nop-instruction (instruction one-successor-mixin)
  ())

(defun make-nop-instruction (successors)
  (make-instance 'nop-instruction
    :successors successors))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Instruction ASSIGNMENT-INSTRUCTION.

(defclass assignment-instruction (instruction one-successor-mixin)
  ())

(defun make-assignment-instruction
    (input output &optional (successor nil successor-p))
  (make-instance 'assignment-instruction
    :inputs (list input)
    :outputs (list output)
    :successors (if successor-p (list successor) '())))

{'fraction_non_alphanumeric': 0.20613726868118998, 'fraction_numerical': 0.00046849379245724994, 'mean_word_length': 4.271604938271605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6126746', 'n_tokens_mistral': 1451, 'n_tokens_neox': 1222, 'n_words': 367}