From c656a658e9852b8f6e974db31304fba016dc9444 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 23 Mar 2009 18:49:03 +0000 Subject: [PATCH] doc xform Scheme API a provided by Will Farr (PR 10151) svn: r14242 --- collects/scribblings/mzc/cc.scrbl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/collects/scribblings/mzc/cc.scrbl b/collects/scribblings/mzc/cc.scrbl index cc5e7d2b03..6e9c005a89 100644 --- a/collects/scribblings/mzc/cc.scrbl +++ b/collects/scribblings/mzc/cc.scrbl @@ -1,6 +1,8 @@ #lang scribble/doc @(require scribble/manual - (for-label scheme/base) + (for-label scheme/base + compiler/xform + dynext/compile) "common.ss") @(define (xflag str) (as-index (DFlag str))) @@ -55,3 +57,29 @@ loaded into the 3m variant of PLT Scheme. The @as-index{@DFlag{cgc}} flag specifies that the extension is to be used with the CGC. The default depends on @|mzc|: @DFlag{3m} if @|mzc| itself is running in 3m, @DFlag{cgc} if @|mzc| itself is running in CGC. + + +@section[#:tag "xform-api"]{Scheme API for 3m Transformation} + +@defmodule[compiler/xform] + +@defproc[(xform [quiet? any/c] + [input-file path-string?] + [output-file path-string?] + [include-dirs (listof path-string?)] + [#:keep-lines? keep-lines? boolean? #f]) + any/c]{ + +Transforms C code that is written without explicit GC-cooperation +hooks to cooperate with PLT Scheme's 3m garbage collector; see +@secref[#:doc '(lib "scribblings/inside/inside.scrbl") "overview"] in +@other-manual['(lib "scribblings/inside/inside.scrbl")]. + +The arguments are as for @scheme[compile-extension]; in addition +@scheme[keep-lines?] can be @scheme[#t] to generate GCC-style +annotations to connect the generated C code with the original source +locations. + +The file generated by @scheme[xform] can be compiled via +@scheme[compile-extension].} +