cleavir ast to bir
1.1.0Compiler of abstract syntax trees into BIR.
The AST-to-BIR system converts ASTs to the block-based intermediate representation (BIR).
Use
(compile-toplevel some-ast)
is how this system should usually be used. Note that the function only accepts a function AST, as all IR must be within some function.
The compile-into-module
function can be used to add a new function into an existing module after that module's initial production. This can be useful for late transformations.
Customization
Custom ASTs will need specializations of the compile-ast
generic function. This function takes an AST, an "inserter", and the system as an argument. The inserter is an object that handles creation of IR. The begin
function sets the iblock the inserter will insert into, while the insert
, and terminate
functions actually add instructions.
compile-ast
should return either nil
, indicating the AST outputs no values; a list of one BIR datum, indicating that is returned; or :no-return
, indicating that control aborts somehow.
To smooth over handling sub-ASTs correctly, you can use with-compiled-ast
, with-compiled-asts
, and with-compiled-arguments
. These macros mostly ensure that if a sub-AST of an AST always aborts, the AST itself does.
System Information
Definition Index
-
CLEAVIR-AST-TO-BIR
No documentation provided.-
EXTERNAL FUNCTION COMPILE-ARGUMENTS
- ARG-ASTS
- INSERTER
- SYSTEM
No documentation provided. -
EXTERNAL FUNCTION COMPILE-INTO-MODULE
- AST
- MODULE
- SYSTEM
No documentation provided. -
EXTERNAL FUNCTION COMPILE-SEQUENCE-FOR-EFFECT
- ASTS
- INSERTER
- SYSTEM
No documentation provided. -
EXTERNAL FUNCTION COMPILE-TOPLEVEL
- AST
- SYSTEM
No documentation provided. -
EXTERNAL GENERIC-FUNCTION COMPILE-AST
- AST
- INSERTER
- SYSTEM
No documentation provided. -
EXTERNAL GENERIC-FUNCTION COMPILE-FUNCTION
- AST
- SYSTEM
No documentation provided. -
EXTERNAL GENERIC-FUNCTION COMPILE-TEST-AST
- AST
- INSERTER
- SYSTEM
No documentation provided. -
EXTERNAL GENERIC-FUNCTION INLINE-ORIGIN
- ORIGIN
- INLINED-AT
- SYSTEM
No documentation provided. -
EXTERNAL MACRO DEFPRIMOP
- PRIMOP
- AST
- &REST
- READERS
No documentation provided. -
EXTERNAL MACRO WITH-COMPILED-ARGUMENTS
- NAME
- ASTS
- INSERTER
- SYSTEM
- &BODY
- BODY
No documentation provided. -
EXTERNAL MACRO WITH-COMPILED-AST
- NAME
- AST
- INSERTER
- SYSTEM
- &BODY
- BODY
No documentation provided. -
EXTERNAL MACRO WITH-COMPILED-ASTS
- NAME
- (&REST ASTS)
- INSERTER
- SYSTEM
- &BODY
- BODY
No documentation provided.
-