Skip to content
Snippets Groups Projects
globaldb.lisp 37.4 KiB
Newer Older
wlott's avatar
wlott committed

;;; Where this information came from:
;;;  :declared, from a declaration.
;;;  :assumed, from uses of the object.
;;;  :defined, from examination of the definition.
(define-info-type function where-from (member :declared :assumed :defined)
  #+new-compiler
  (if (fboundp name) :defined :assumed)
  #-new-compiler
  :assumed)

;;; Lambda used for inline expansion of this function.
(define-info-type function inline-expansion list)

;;; Specifies whether this function may be expanded inline.  If null, we
;;; don't care.
(define-info-type function inlinep inlinep nil)

;;; A macro-like function which transforms a call to this function into some
;;; other Lisp form.  This expansion is inhibited if inline expansion is
;;; inhibited.
(define-info-type function source-transform (or function null list))
wlott's avatar
wlott committed

;;; The macroexpansion function for this macro.
(define-info-type function macro-function (or function null list)
wlott's avatar
wlott committed
  nil)

;;; A function which converts this special form into IR1.
(define-info-type function ir1-convert (or function null list))
wlott's avatar
wlott committed

;;; A function which gets a chance to do stuff to the IR1 for any call to this
;;; function.
(define-info-type function ir1-transform (or function null list))
wlott's avatar
wlott committed

;;; If a function is an alien-operator, then this is the Alien-Info.
(define-info-type function alien-operator (or lisp::alien-info null) nil)

;;; If a function is a defstruct slot accessor or setter, then this is the
;;; defstruct-definition for the structure that it belongs to.
(define-info-type function accessor-for (or defstruct-description null)
  nil)

;;; If a function is "known" to the compiler, then this is FUNCTION-INFO
;;; structure containing the info used to special-case compilation.
(define-info-type function info (or function-info null) nil)

(define-info-type function documentation (or string null) nil)

wlott's avatar
wlott committed
); defun function-info-init

#|
  Other:
    Documentation?
|#

;;;; Definitions for other random information.

(defun other-info-init ()

(define-info-class variable)

;;; The kind of variable-like thing described.
(define-info-type variable kind (member :special :constant :global)
  #+new-compiler
  (if (or (eq (symbol-package name) (symbol-package :end))
	  (member name '(t nil)))
      :constant
      :global)
  #-new-compiler
  (if (constantp name)
      :constant
      :global))

;;; The declared type for this variable.
(define-info-type variable type ctype *universal-type*)

;;; Where this type and kind information came from.
(define-info-type variable where-from (member :declared :assumed :defined)
  :assumed)

;;; The the lisp object which is the value of this constant, if known.
(define-info-type variable constant-value t
  #+new-compiler
  (if (boundp name)
      (values (symbol-value name) t)
      (values nil nil))
  #-new-compiler
  (if (constantp name)
      (values (symbol-value name) t)
      (values nil nil)))

(define-info-type variable alien-value (or lisp::ct-a-val null) nil)

(define-info-type variable documentation (or string null) nil)

wlott's avatar
wlott committed
(define-info-class type)

;;; The kind of type described.  We return :Structure for standard types that
;;; are implemented as structures.
;;;
(define-info-type type kind (member :primitive :defined :structure nil)
  (if (or (info type builtin name)
	  (info type translator name))
wlott's avatar
wlott committed
      :primitive
      nil))

;;; Expander function for a defined type.
(define-info-type type expander (or function null list) nil)
wlott's avatar
wlott committed

;;; Print function for a type.
(define-info-type type printer (or function symbol null list) nil)

;;; Defstruct description information for a structure type.  DEFINED is the
;;; current global definition, and is not shadowed by compilation of
;;; structure definitions.
;;;
wlott's avatar
wlott committed
(define-info-type type structure-info (or defstruct-description null) nil)
(define-info-type type defined-structure-info (or defstruct-description null)
  nil)
wlott's avatar
wlott committed

(define-info-type type documentation (or string null))

;;; Function that parses type specifiers into CTYPE structures.
;;;
(define-info-type type translator (or function null list) nil)

;;; If true, then the type coresponding to this name.
;;;
(define-info-type type builtin (or ctype null) nil)


wlott's avatar
wlott committed
(define-info-class declaration)
(define-info-type declaration recognized boolean)

(define-info-class alien-stack)
(define-info-type alien-stack info (or lisp::stack-info null) nil)

(define-info-class enumeration)
(define-info-type enumeration info (or lisp::enumeration-info null) nil)

(define-info-class setf)

(define-info-type setf inverse (or symbol null) nil)

(define-info-type setf documentation (or string null) nil)

(define-info-type setf expander (or function null list) nil)
wlott's avatar
wlott committed

;;; Used for storing random documentation types.  The stuff is an alist
;;; translating documentation kinds to values.
;;;
(define-info-class random-documentation)
(define-info-type random-documentation stuff list ())

wlott's avatar
wlott committed
); defun other-info-init