From 679e9ff3f75d5c4c8cdbaca325ac27518588cad5 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sun, 8 Feb 2015 03:46:36 -0800 Subject: [PATCH] Fall back to .globals.get because llvmlite pull request #42 wasn't merged. Once it's merged I can switch back to the convenience get_global. --- chapter6.py | 4 ++-- chapter7.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chapter6.py b/chapter6.py index 1229fb4..1a1e703 100644 --- a/chapter6.py +++ b/chapter6.py @@ -562,7 +562,7 @@ class LLVMCodeGenerator(object): def _codegen_UnaryExprAST(self, node): operand = self._codegen(node.operand) - func = self.module.get_global('unary{0}'.format(node.op)) + func = self.module.globals.get('unary{0}'.format(node.op)) return self.builder.call(func, [operand], 'unop') def _codegen_BinaryExprAST(self, node): @@ -581,7 +581,7 @@ class LLVMCodeGenerator(object): else: # Note one of predefined operator, so it must be a user-defined one. # Emit a call to it. - func = self.module.get_global('binary{0}'.format(node.op)) + func = self.module.globals.get('binary{0}'.format(node.op)) return self.builder.call(func, [lhs, rhs], 'binop') def _codegen_IfExprAST(self, node): diff --git a/chapter7.py b/chapter7.py index 72dd3e9..3948fe2 100644 --- a/chapter7.py +++ b/chapter7.py @@ -625,7 +625,7 @@ class LLVMCodeGenerator(object): def _codegen_UnaryExprAST(self, node): operand = self._codegen(node.operand) - func = self.module.get_global('unary{0}'.format(node.op)) + func = self.module.globals.get('unary{0}'.format(node.op)) return self.builder.call(func, [operand], 'unop') def _codegen_BinaryExprAST(self, node): @@ -654,7 +654,7 @@ class LLVMCodeGenerator(object): else: # Note one of predefined operator, so it must be a user-defined one. # Emit a call to it. - func = self.module.get_global('binary{0}'.format(node.op)) + func = self.module.globals.get('binary{0}'.format(node.op)) return self.builder.call(func, [lhs, rhs], 'binop') def _codegen_IfExprAST(self, node):