From 031a2edb764359df9fa222910d7ab31d12828608 Mon Sep 17 00:00:00 2001 From: goffioul Date: Thu, 27 Oct 2005 13:17:49 +0000 Subject: [PATCH] Fix DEFINE-COMPILER-MACRO behavior: supersedes regular macros on compile time unless NOTINLINE. --- src/cmp/cmpeval.lsp | 5 +++-- src/cmp/cmptop.lsp | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cmp/cmpeval.lsp b/src/cmp/cmpeval.lsp index 276a3b251..e9b1ec580 100644 --- a/src/cmp/cmpeval.lsp +++ b/src/cmp/cmpeval.lsp @@ -55,14 +55,15 @@ ((and (setq fd (get-sysprop fname 'C1CONDITIONAL)) (inline-possible fname) (funcall fd args))) - ((setq fd (macro-function fname)) - (c1expr (cmp-expand-macro fd fname args))) ((and (setq fd (compiler-macro-function fname)) + (inline-possible fname) (let ((success nil)) (multiple-value-setq (fd success) (cmp-expand-compiler-macro fd fname args)) success)) (c1expr fd)) + ((setq fd (macro-function fname)) + (c1expr (cmp-expand-macro fd fname args))) ((and (setq fd (get-sysprop fname 'SYS::STRUCTURE-ACCESS)) (inline-possible fname) ;;; Structure hack. diff --git a/src/cmp/cmptop.lsp b/src/cmp/cmptop.lsp index 11cd1776a..19a7c5dca 100644 --- a/src/cmp/cmptop.lsp +++ b/src/cmp/cmptop.lsp @@ -40,6 +40,13 @@ ((setq fd (get-sysprop fun 'T1)) (funcall fd args)) ((get-sysprop fun 'C1) (t1ordinary form)) + ((and (setq fd (compiler-macro-function fun)) + (inline-possible fun) + (let ((success nil)) + (multiple-value-setq (fd success) + (cmp-expand-compiler-macro fd fun args)) + success)) + (t1expr* fd)) ((setq fd (macro-function fun)) (t1expr* (cmp-expand-macro fd fun (cdr form)))) ((and (setq fd (assoc fun *funs*))