Skip to content

Commit

Permalink
Ensure uwtable is added to all generated functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Aug 8, 2015
1 parent 13ad9b5 commit 22457bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion artiq/compiler/transforms/llvm_ir_generator.py
Expand Up @@ -175,17 +175,20 @@ def process(self, functions):
def process_function(self, func):
try:
self.llfunction = self.llmodule.get_global(func.name)

if self.llfunction is None:
llargtys = []
for arg in func.arguments:
llargtys.append(self.llty_of_type(arg.type))
llfunty = ll.FunctionType(args=llargtys,
return_type=self.llty_of_type(func.type.ret, for_return=True))
self.llfunction = ll.Function(self.llmodule, llfunty, func.name)
self.llfunction.attributes.add('uwtable')

if func.is_internal:
self.llfunction.linkage = 'internal'

self.llfunction.attributes.add('uwtable')

self.llmap = {}
self.llbuilder = ll.IRBuilder()
self.fixups = []
Expand Down

0 comments on commit 22457bc

Please sign in to comment.