From 815edd1219cc324340d71b8091ce26e521a1d128 Mon Sep 17 00:00:00 2001 From: Jan Hoenig <hrominium@gmail.com> Date: Thu, 8 Dec 2016 17:34:03 +0100 Subject: [PATCH] Fixed imports --- backends/llvm.py | 16 +++++++++------- llvm/__init__.py | 1 - 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/backends/llvm.py b/backends/llvm.py index 695b6b100..4a45844f5 100644 --- a/backends/llvm.py +++ b/backends/llvm.py @@ -7,6 +7,15 @@ from sympy import S from pystencils.llvm.control_flow import Loop +def generateLLVM(ast_node): + """ + Prints the ast as llvm code + """ + module = ir.Module() + builder = ir.IRBuilder() + printer = LLVMPrinter(module, builder) + return printer._print(ast_node) + class LLVMPrinter(Printer): """Convert expressions to LLVM IR""" @@ -133,10 +142,3 @@ class LLVMPrinter(Printer): def emptyPrinter(self, expr): raise TypeError("Unsupported type for LLVM JIT conversion: %s" % type(expr)) - - -def generateLLVM(astNode): - module = ir.Module() - builder = ir.IRBuilder() - printer = LLVMPrinter(module, builder) - return printer._print(astNode) diff --git a/llvm/__init__.py b/llvm/__init__.py index 7eb3311e9..681ec00a7 100644 --- a/llvm/__init__.py +++ b/llvm/__init__.py @@ -1,2 +1 @@ from pystencils.cpu.kernelcreation import createKernel -from pystencils.backends.llvm import generateLLVM \ No newline at end of file -- GitLab