chiark / gitweb /
src/codegen-{proto,impl}.lisp: Make *temporary-index* be a module var.
[sod] / src / codegen-impl.lisp
index 170f4a8ac766225af87a006e9721aca2b3e45c18..c4f83e100d2b9f370d93947cd3d4b11203d1968a 100644 (file)
@@ -37,6 +37,16 @@ (defclass temporary-variable (temporary-name)
   ((in-use-p :initarg :in-use-p :initform nil
             :type boolean :accessor var-in-use-p)))
 
+(define-module-var *temporary-index* 0
+  "Index for temporary name generation.
+
+   This is automatically reset to zero before the output functions are
+   invoked to write a file.  This way, we can ensure that the same output
+   file is always produced from the same input.")
+
+(define-clear-the-decks reset-codegen-index
+  (setf *temporary-index* 0))
+
 (defmethod commentify-argument-name ((name temporary-name))
   nil)