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.
This commit is contained in:
parent
77dae34cf1
commit
679e9ff3f7
2 changed files with 4 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue