Commit 776b08f5 authored by dbarbera's avatar dbarbera
Browse files

Added lenght operator generation

parent 8e991ecc
......@@ -566,7 +566,11 @@ def _prim_path(prim):
def generate_length(params):
''' Generate the code for the built-in length operation'''
raise NotImplementedError
seq_ptr = reference(params[0])
size = core.Constant.sizeof(seq_ptr.type.pointee)
tmp = g.builder.alloca(size.type)
g.builder.store(size, tmp)
return tmp
def generate_present(params):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment