Implement partial support for variadic parameters #485
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#485
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/vararg-param"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Variadic functions in Python can now be declared and called. The support is only "partial" as we currently do not have a way to access the variadic arguments in Python.
To test this branch:
misc/impl-tracert
(to providecall_prinf
).vararg.py
demo, and observe the following output:0bdecd4b9c
to346f69b5d8
@ -610,0 +626,4 @@
("i386" | "i486" | "i586" | "i686" | "amd64" | "x86_64" | "x86_64h", 32) => {
ctx.i8_type().ptr_type(AddressSpace::default()).into()
}
("amd64" | "x86_64" | "x86_64h", 64) => {
I don't understand why this usize issue is popping up again.
Isn't
llvm_usize.get_bit_width()
fixed for a givenarch
?Removed.
Are there still other parts of the codebase where this remains a problem?
I don't think there's anywhere else where
size_t
is used to determine logic that is not directly related to codegen. However, there are still some parts of the codebase that may be best refactored, e.g.range
(which is currentlytuple[int32, int32, int32]
) andlen
(which always returnsint32
).I think
range
should return the same as the type of its arguments, andlen
should besize_t
.346f69b5d8
toac0d83ef98
v2: Removed determination of
va_info
usingsize_t
, rebased against master