mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
Compiling languages with closures often requires passing an extra environment parameter to the called function. One solution is to use a convention, and reserve, say, the first argument for that purpose. However, that makes binding to C a little less smooth. Alternatively, QBE now provides a way to remain fully ABI compatible with C by having a "hidden" environment argument (marked with the keyword 'env'). Calling a function expecting an environment from C will make the contents of the environment undefined, but the normal arguments will be passed without alteration. Conversely, calling a C function like it is a closure by passing it an environemnt will work smoothly. |
||
|---|---|---|
| doc | ||
| minic | ||
| test | ||
| tools | ||
| .gitignore | ||
| .tag | ||
| alias.c | ||
| all.h | ||
| cfg.c | ||
| copy.c | ||
| emit.c | ||
| fold.c | ||
| isel.c | ||
| LICENSE | ||
| live.c | ||
| load.c | ||
| main.c | ||
| Makefile | ||
| mem.c | ||
| parse.c | ||
| README | ||
| rega.c | ||
| spill.c | ||
| ssa.c | ||
| sysv.c | ||
| util.c | ||
QBE - Backend Compiler http://c9x.me/compile/ doc/ Documentation. minic/ An example C frontend for QBE. tools/ Miscellaneous tools (testing). test/ Unit tests. The LICENSE file applies to all files distributed. - Compilation Invoke GNU make in this directory to create the executable file obj/qbe. On some systems (BSD) you might have to use 'gmake' instead of 'make'.