Skip to main content

Module foreign

Module foreign 

Source
Expand description

Foreign surface types → fic types: one ForeignTypes implementation per ForeignLang, chosen through lowering. The mirror of the backend’s per-target ABI (#338): that maps a fic type to a machine type, this maps a language’s spelling to a fic type: each language supplies its scalar table and its machine word; what every language shares at a C-ABI boundary (a pointer is an address, a struct is nominal) is signature’s, which rast lowers a called function’s signature with.

Widths are AArch64 LP64 (AAPCS64): C int is 32 bits, long and pointers 64, plain char unsigned. A shared per-target data model is #360.

Structs§

C
C, as libclang spells types (unsigned int, uint8_t, _Bool).
Pancake
Pancake: every export fun argument and return is one machine word.

Traits§

ForeignTypes
How one foreign language’s types lower to fic types.

Functions§

lowering
The lowering for lang.
signature
f’s parameter and return types as fic writes them, f declared in lang, or why fic cannot express it (a parameter or a non-void return with no fic type). structs resolves a struct name against the .fis’s.