From 22457bc19ca615c860b133fbd02c5ce2debd1209 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 8 Aug 2015 21:48:21 +0300 Subject: [PATCH] Ensure uwtable is added to all generated functions. --- artiq/compiler/transforms/llvm_ir_generator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 5d5e4addb..bccc2397c 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -175,6 +175,7 @@ class LLVMIRGenerator: 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: @@ -182,10 +183,12 @@ class LLVMIRGenerator: 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 = []