Commit 5387788
committed
feat: use ZRTL signature return types for extern function calls
Updated Cranelift backend to prefer symbol signature return types over HIR types
when calling external functions. This ensures void functions are correctly
declared with no return value instead of defaulting to i32.
Changes:
- Check symbol_signatures for return type before falling back to HIR type
- Compare return type against TypeTag::VOID to determine if function returns void
- Functions with void signature now generate correct Cranelift IR with no returns
Remaining work:
- DynamicBox wrapping currently hardcodes TypeCategory::Opaque (0x12)
- Need to detect actual type and use correct TypeTag for primitives
- For i32: should use TypeCategory::Int with appropriate type_id
- For opaque types: current implementation is correct
- May need to allocate storage for primitive values and store pointer1 parent 1ef7881 commit 5387788
1 file changed
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1029 | 1037 | | |
1030 | 1038 | | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1041 | 1049 | | |
1042 | 1050 | | |
1043 | 1051 | | |
| |||
0 commit comments