-;;; COMPILER-ABORT falls through to the default error handling, so
-;;; compilation terminates.
-(declaim (ftype (function (string &rest t) nil) compiler-error compiler-abort))
-(declaim (ftype (function (string &rest t) (values))
- compiler-warning compiler-style-warning))
-(defun compiler-abort (format-string &rest format-args)
- (error 'compiler-error
- :format-control format-string
- :format-arguments format-args))
-(defun compiler-error (format-string &rest format-args)
- (restart-case
- (progn
- (cerror "Replace form with call to ERROR."
- 'compiler-error
- :format-control format-string
- :format-arguments format-args)
- (funcall *compiler-error-bailout*)
- (bug "Control returned from *COMPILER-ERROR-BAILOUT*."))
- (signal-program-error ()
- (error 'simple-program-error
- :format-control format-string
- :format-arguments format-args))))
-(defun compiler-warn (format-string &rest format-args)
- (apply #'warn format-string format-args)
+(declaim (ftype (function (t &rest t) nil) compiler-error))
+(defun compiler-error (datum &rest arguments)
+ (let ((condition (coerce-to-condition datum arguments
+ 'simple-program-error 'compiler-error)))
+ (restart-case
+ (progn
+ (cerror "Replace form with call to ERROR."
+ 'compiler-error
+ :condition condition)
+ (funcall *compiler-error-bailout* condition)
+ (bug "Control returned from *COMPILER-ERROR-BAILOUT*."))
+ (signal-error ()
+ (error condition)))))
+
+(defun compiler-warn (datum &rest arguments)
+ (apply #'warn datum arguments)