From 559d836439c8b9470e4d96d5a1a7324b9175a71d Mon Sep 17 00:00:00 2001
From: wlott <wlott>
Date: Sun, 14 Oct 1990 23:18:42 +0000
Subject: [PATCH] Added ``save-vop-counts'' and ``augment-vop-counts.''

---
 compiler/main.lisp | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/compiler/main.lisp b/compiler/main.lisp
index 232115e3d..f5156cd79 100644
--- a/compiler/main.lisp
+++ b/compiler/main.lisp
@@ -146,6 +146,26 @@
 	      (truncate (cddr info) (cadr info)))))
   (values))
 
+(defun save-vop-counts (filename)
+  (with-open-file (stream filename :direction :output :if-exists :supersede)
+    (maphash #'(lambda (key value)
+		 (print (cons key value) stream))
+	     *vop-counts*)))
+
+(defun augment-vop-counts (filename)
+  (with-open-file (stream filename)
+    (loop
+      (let ((stuff (read stream nil :eof)))
+	(when (eq stuff :eof)
+	  (return))
+	(multiple-value-bind (entry found) (gethash (car stuff) *vop-counts*)
+	  (cond (found
+		 (incf (car entry) (cadr stuff))
+		 (incf (cdr entry) (cddr stuff)))
+		(t
+		 (setf (gethash (car stuff) *vop-counts*)
+		       (cdr stuff)))))))))
+
 
 ;;;; Component compilation:
 
-- 
GitLab