1 ;;;; DESCRIBE-COMPILER-POLICY
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB-C") ;(SB-C, not SB!C, since we're built in warm load.)
14 (defun describe-compiler-policy (&optional spec)
16 "Print all global optimization settings, augmented by SPEC."
17 (let ((policy (process-optimize-decl (cons 'optimize spec) *policy*)))
19 (format t " Basic qualities:~%")
20 (dolist (quality *policy-qualities*)
21 (format t "~S = ~D~%" quality (policy-quality policy quality)))
22 (format t " Dependent qualities:~%")
23 (loop for (name . info) in *policy-dependent-qualities*
24 for values-documentation = (policy-dependent-quality-values-documentation info)
25 for explicit-value = (policy-quality policy name)
26 do (if (= explicit-value 1)
27 (let* ((getter (policy-dependent-quality-getter info))
28 (value (funcall getter policy))
29 (documentation (elt values-documentation value)))
30 (format t "~S = ~D -> ~D (~A)~%"
33 (let ((documentation (elt values-documentation explicit-value)))
34 (format t "~S = ~D (~A)~%"
35 name explicit-value documentation)))))