From 2c04979727ab3afec6176f00a8878d01274b473a Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 31 Mar 2016 08:16:03 +0000 Subject: [PATCH] compiler: update for LLVM 3.7. --- artiq/compiler/testbench/jit.py | 2 +- artiq/compiler/transforms/llvm_ir_generator.py | 5 ++--- conda/artiq/meta.yaml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/artiq/compiler/testbench/jit.py b/artiq/compiler/testbench/jit.py index 9d35a5a93..309073404 100644 --- a/artiq/compiler/testbench/jit.py +++ b/artiq/compiler/testbench/jit.py @@ -28,7 +28,7 @@ def main(): llmachine = llvm.Target.from_triple(target.triple).create_target_machine() lljit = llvm.create_mcjit_compiler(llparsedmod, llmachine) - llmain = lljit.get_pointer_to_global(llparsedmod.get_function(llmod.name + ".__modinit__")) + llmain = lljit.get_function_address(llmod.name + ".__modinit__") ctypes.CFUNCTYPE(None)(llmain)() if __name__ == "__main__": diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 474dbd883..962733227 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -573,6 +573,7 @@ class LLVMIRGenerator: self.llfunction.attributes.add('noinline') self.llfunction.attributes.add('uwtable') + self.llfunction.attributes.personality = self.llbuiltin("__artiq_personality") self.llbuilder = ll.IRBuilder() llblock_map = {} @@ -1498,9 +1499,7 @@ class LLVMIRGenerator: def process_LandingPad(self, insn): # Layout on return from landing pad: {%_Unwind_Exception*, %Exception*} lllandingpadty = ll.LiteralStructType([llptr, llptr]) - lllandingpad = self.llbuilder.landingpad(lllandingpadty, - self.llbuiltin("__artiq_personality"), - cleanup=True) + lllandingpad = self.llbuilder.landingpad(lllandingpadty, cleanup=True) llrawexn = self.llbuilder.extract_value(lllandingpad, 1) llexn = self.llbuilder.bitcast(llrawexn, self.llty_of_type(insn.type)) llexnnameptr = self.llbuilder.gep(llexn, [self.llindex(0), self.llindex(0)], diff --git a/conda/artiq/meta.yaml b/conda/artiq/meta.yaml index ab2aec2a6..1fe9a465a 100644 --- a/conda/artiq/meta.yaml +++ b/conda/artiq/meta.yaml @@ -37,7 +37,7 @@ requirements: - binutils-or1k-linux run: - python >=3.5.1 - - llvmlite-artiq + - llvmlite-artiq 0.10.0.dev py35_20 - scipy - numpy - prettytable