X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/4b8e5c0347115ff30841f1d1e71afe59ecb6c82c..06339d58e80cfb04604f00016f1c1e6921e87928:/src/codegen-impl.lisp?ds=sidebyside diff --git a/src/codegen-impl.lisp b/src/codegen-impl.lisp index 170f4a8..c4f83e1 100644 --- a/src/codegen-impl.lisp +++ b/src/codegen-impl.lisp @@ -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)