They can be built easily enough using `call', and `deliver-call' makes
it easier on the fingers than the dedicated instructions.
do-while-inst class
if-inst class
inst-alt generic
do-while-inst class
if-inst class
inst-alt generic
- inst-ap generic
- inst-arg generic
inst-args generic
inst-body generic
inst-cond generic
inst-conseq generic
inst-args generic
inst-body generic
inst-cond generic
inst-conseq generic
make-call-inst function
make-do-while-inst function
make-if-inst function
make-call-inst function
make-do-while-inst function
make-if-inst function
- make-va-copy-inst function
- make-va-end-inst function
- make-va-start-inst function
make-while-inst function
temporary-argument class
temporary-function function class
temporary-variable class
make-while-inst function
temporary-argument class
temporary-function function class
temporary-variable class
- va-copy-inst class
- va-end-inst class
- va-start-inst class
while-inst class
codegen-proto.lisp
while-inst class
codegen-proto.lisp
return-inst
set-inst
update-inst
return-inst
set-inst
update-inst
- va-copy-inst
- va-end-inst
- va-start-inst
var-inst
while-inst
islots
var-inst
while-inst
islots
-inst-ap
- va-end-inst
- va-start-inst
-inst-arg
- va-start-inst
inst-args
call-inst
inst-body
inst-args
call-inst
inst-body
return-inst
set-inst
update-inst
return-inst
set-inst
update-inst
-inst-from
- va-copy-inst
inst-func
call-inst
inst-init
inst-func
call-inst
inst-init
return-inst
set-inst
update-inst
return-inst
set-inst
update-inst
- va-copy-inst
- va-end-inst
- va-start-inst
var-inst
while-inst
inst-name
var-inst
while-inst
inst-name
var-inst
inst-op
update-inst
var-inst
inst-op
update-inst
inst-type
function-inst
var-inst
inst-type
function-inst
var-inst
sod-slot t
temporary-name t
update-inst t
sod-slot t
temporary-name t
update-inst t
- va-copy-inst t
- va-end-inst t
- va-start-inst t
var-inst t
vtable t
vtable-pointer t
var-inst t
vtable t
vtable-pointer t
@|expr| & @<expr> & @<expr>; \\ \hlx{v}
@|call| & @<func> @<args> & @<func>(@<arg>_1,
$\ldots$,
@|expr| & @<expr> & @<expr>; \\ \hlx{v}
@|call| & @<func> @<args> & @<func>(@<arg>_1,
$\ldots$,
- @<arg>_n) \\ \hlx{v}
- @|va-start| & @<ap> @<arg> & va_start(@<ap>, @<arg>);
- \\ \hlx{v}
- @|va-copy| & @<to> @<from> & va_copy(@<to>, @<from>);
- \\ \hlx{v}
- @|va-end| & @<ap> & va_end(@<ap>); \\ \hlx{vhv}
@|block| & @<decls> @<body> & \{ @[@<decls>@] @<body> \}
\\ \hlx{v}
@|if| & @<cond> @<conseq> @<alt> & if (@<cond>) @<conseq>
@|block| & @<decls> @<body> & \{ @[@<decls>@] @<body> \}
\\ \hlx{v}
@|if| & @<cond> @<conseq> @<alt> & if (@<cond>) @<conseq>
(write-string "do" stream))
(format stream "while (~A);" #1#))
(write-string "do" stream))
(format stream "while (~A);" #1#))
-;; Special varargs hacks.
-
-(definst va-start (stream :export t) (ap arg)
- (format stream "va_start(~@<~A, ~_~A~:>);" ap arg))
-
-(definst va-copy (stream :export t) (to from)
- (format stream "va_copy(~@<~A, ~_~A~:>);" to from))
-
-(definst va-end (stream :export t) (ap)
- (format stream "va_end(~A);" ap))
(ensure-var codegen *sod-ap* c-type-va-list)
(convert-stmts codegen entry-target return-type
(lambda (target)
(ensure-var codegen *sod-ap* c-type-va-list)
(convert-stmts codegen entry-target return-type
(lambda (target)
- (emit-inst codegen
- (make-va-start-inst
- *sod-ap*
- (argument-name parm-n)))
+ (deliver-call codegen :void "va_start"
+ *sod-ap* parm-n)
(deliver-expr codegen target call)
(deliver-expr codegen target call)
- (emit-inst codegen
- (make-va-end-inst *sod-ap*))))
+ (deliver-call codegen :void "va_end"
+ *sod-ap*)))
(codegen-pop-function codegen main main-type))))))
;; Generate the method body. We'll work out what to do with it later.
(codegen-pop-function codegen main main-type))))))
;; Generate the method body. We'll work out what to do with it later.
(c-type-subtype (sod-method-type direct-method))
(lambda (var)
(ensure-var codegen *sod-tmp-ap* c-type-va-list)
(c-type-subtype (sod-method-type direct-method))
(lambda (var)
(ensure-var codegen *sod-tmp-ap* c-type-va-list)
- (emit-inst codegen
- (make-va-copy-inst *sod-tmp-ap*
- *sod-ap*))
+ (deliver-call codegen :void "va_copy"
+ *sod-tmp-ap* *sod-ap*)
(apply #'deliver-call codegen var
function arguments)
(apply #'deliver-call codegen var
function arguments)
- (emit-inst codegen
- (make-va-end-inst *sod-tmp-ap*))))
+ (deliver-call codegen :void "va_end" *sod-tmp-ap*)))
(apply #'deliver-call codegen target function arguments))))
(export 'ensure-ilayout-var)
(apply #'deliver-call codegen target function arguments))))
(export 'ensure-ilayout-var)