Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- THIS FUNCTION TAKES A VALUE, AND WRAPS IT IN AN LLVM OBJECT OF THE
- TYPE DETECTED IN THE FUNCTION SIGNATURE
- """
- # Visitor for functions with >= 1 argument
- def visit_call_args(self, fn_name, fn_args):
- """
- This function wraps a given value in an LLVM type
- Declaring the function inside another function means that
- this function is accessible withi the scope of the outer
- function
- """
- def type_arg(value: int, typ):
- return typ(value)
- fun = self.fun_headers[fn_name] # Retrieving the function header
- arg_list = [i.value for i in fn_args] # Retrieving the function arguments
- print(arg_list)
- typed = [type_arg(n, ir.DoubleType()) for n in arg_list]
- self.builder.call(fun, (typed))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement