From 4a8e397a77113a2d9e5dffe268782274af9c3a84 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 29 Jul 2015 13:54:00 +0300 Subject: [PATCH] Fold llvmlite patches into m-labs/llvmlite repository. --- artiq/coredevice/runtime.py | 4 +- artiq/py2llvm/ast_body.py | 2 +- artiq/py2llvm/base_types.py | 2 +- artiq/py2llvm/fractions.py | 2 +- artiq/py2llvm/lists.py | 2 +- artiq/py2llvm/module.py | 4 +- artiq/py2llvm/tools.py | 2 +- artiq/py2llvm/values.py | 2 +- artiq/test/py2llvm.py | 2 +- conda/llvmlite-or1k/bld.bat | 5 -- conda/llvmlite-or1k/build.sh | 3 - conda/llvmlite-or1k/meta.yaml | 4 +- misc/llvmlite-add-all-targets.patch | 38 ----------- misc/llvmlite-build-as-debug-on-windows.patch | 13 ---- misc/llvmlite-rename.patch | 65 ------------------- setup.py | 2 +- 16 files changed, 14 insertions(+), 138 deletions(-) delete mode 100644 misc/llvmlite-add-all-targets.patch delete mode 100644 misc/llvmlite-build-as-debug-on-windows.patch delete mode 100644 misc/llvmlite-rename.patch diff --git a/artiq/coredevice/runtime.py b/artiq/coredevice/runtime.py index 84a6bb386..ae818b1a6 100644 --- a/artiq/coredevice/runtime.py +++ b/artiq/coredevice/runtime.py @@ -1,7 +1,7 @@ import os -import llvmlite_or1k.ir as ll -import llvmlite_or1k.binding as llvm +import llvmlite_artiq.ir as ll +import llvmlite_artiq.binding as llvm from artiq.py2llvm import base_types, fractions, lists from artiq.language import units diff --git a/artiq/py2llvm/ast_body.py b/artiq/py2llvm/ast_body.py index 42de0fc9c..17b08c861 100644 --- a/artiq/py2llvm/ast_body.py +++ b/artiq/py2llvm/ast_body.py @@ -1,6 +1,6 @@ import ast -import llvmlite_or1k.ir as ll +import llvmlite_artiq.ir as ll from artiq.py2llvm import values, base_types, fractions, lists, iterators from artiq.py2llvm.tools import is_terminated diff --git a/artiq/py2llvm/base_types.py b/artiq/py2llvm/base_types.py index 3ef472984..a5690c396 100644 --- a/artiq/py2llvm/base_types.py +++ b/artiq/py2llvm/base_types.py @@ -1,4 +1,4 @@ -import llvmlite_or1k.ir as ll +import llvmlite_artiq.ir as ll from artiq.py2llvm.values import VGeneric diff --git a/artiq/py2llvm/fractions.py b/artiq/py2llvm/fractions.py index aae7575cc..d00ff74de 100644 --- a/artiq/py2llvm/fractions.py +++ b/artiq/py2llvm/fractions.py @@ -1,7 +1,7 @@ import inspect import ast -import llvmlite_or1k.ir as ll +import llvmlite_artiq.ir as ll from artiq.py2llvm.values import VGeneric, operators from artiq.py2llvm.base_types import VBool, VInt, VFloat diff --git a/artiq/py2llvm/lists.py b/artiq/py2llvm/lists.py index e17ab5348..d486e7ddd 100644 --- a/artiq/py2llvm/lists.py +++ b/artiq/py2llvm/lists.py @@ -1,4 +1,4 @@ -import llvmlite_or1k.ir as ll +import llvmlite_artiq.ir as ll from artiq.py2llvm.values import VGeneric from artiq.py2llvm.base_types import VInt, VNone diff --git a/artiq/py2llvm/module.py b/artiq/py2llvm/module.py index f4df806e6..b842833e9 100644 --- a/artiq/py2llvm/module.py +++ b/artiq/py2llvm/module.py @@ -1,5 +1,5 @@ -import llvmlite_or1k.ir as ll -import llvmlite_or1k.binding as llvm +import llvmlite_artiq.ir as ll +import llvmlite_artiq.binding as llvm from artiq.py2llvm import infer_types, ast_body, base_types, fractions, tools diff --git a/artiq/py2llvm/tools.py b/artiq/py2llvm/tools.py index ba9e76949..361b82a6f 100644 --- a/artiq/py2llvm/tools.py +++ b/artiq/py2llvm/tools.py @@ -1,4 +1,4 @@ -import llvmlite_or1k.ir as ll +import llvmlite_artiq.ir as ll def is_terminated(basic_block): return (basic_block.instructions diff --git a/artiq/py2llvm/values.py b/artiq/py2llvm/values.py index 6f0b90e2c..254d17541 100644 --- a/artiq/py2llvm/values.py +++ b/artiq/py2llvm/values.py @@ -1,7 +1,7 @@ from types import SimpleNamespace from copy import copy -import llvmlite_or1k.ir as ll +import llvmlite_artiq.ir as ll class VGeneric: diff --git a/artiq/test/py2llvm.py b/artiq/test/py2llvm.py index 6eb607c7d..6026d3797 100644 --- a/artiq/test/py2llvm.py +++ b/artiq/test/py2llvm.py @@ -5,7 +5,7 @@ from fractions import Fraction from ctypes import CFUNCTYPE, c_int, c_int32, c_int64, c_double import struct -import llvmlite_or1k.binding as llvm +import llvmlite_artiq.binding as llvm from artiq.language.core import int64 from artiq.py2llvm.infer_types import infer_function_types diff --git a/conda/llvmlite-or1k/bld.bat b/conda/llvmlite-or1k/bld.bat index 17e63ad30..bbb38d3c9 100644 --- a/conda/llvmlite-or1k/bld.bat +++ b/conda/llvmlite-or1k/bld.bat @@ -4,10 +4,5 @@ set CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% @rem Ensure there are no build leftovers (CMake can complain) if exist ffi\build rmdir /S /Q ffi\build -@rem Apply patches -patch -p1 < %RECIPE_DIR%/../../misc/llvmlite-add-all-targets.patch -patch -p1 < %RECIPE_DIR%/../../misc/llvmlite-rename.patch -patch -p1 < %RECIPE_DIR%/../../misc/llvmlite-build-as-debug-on-windows.patch - %PYTHON% -S setup.py install if errorlevel 1 exit 1 diff --git a/conda/llvmlite-or1k/build.sh b/conda/llvmlite-or1k/build.sh index 327c15518..d3b3bbe2c 100755 --- a/conda/llvmlite-or1k/build.sh +++ b/conda/llvmlite-or1k/build.sh @@ -1,6 +1,3 @@ #!/bin/bash -patch -p1 < ${RECIPE_DIR}/../../misc/llvmlite-add-all-targets.patch -patch -p1 < ${RECIPE_DIR}/../../misc/llvmlite-rename.patch -patch -p1 < ${RECIPE_DIR}/../../misc/llvmlite-build-as-debug-on-windows.patch PATH=/usr/local/llvm-or1k/bin:$PATH $PYTHON setup.py install diff --git a/conda/llvmlite-or1k/meta.yaml b/conda/llvmlite-or1k/meta.yaml index db3c24bcd..669c37881 100644 --- a/conda/llvmlite-or1k/meta.yaml +++ b/conda/llvmlite-or1k/meta.yaml @@ -19,8 +19,8 @@ build: test: imports: - - llvmlite_or1k - - llvmlite_or1k.llvmpy + - llvmlite_artiq + - llvmlite_artiq.llvmpy about: home: https://pypi.python.org/pypi/llvmlite/ diff --git a/misc/llvmlite-add-all-targets.patch b/misc/llvmlite-add-all-targets.patch deleted file mode 100644 index 6b52fad9f..000000000 --- a/misc/llvmlite-add-all-targets.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/ffi/initfini.cpp b/ffi/initfini.cpp -index 42c8965..067be62 100644 ---- a/ffi/initfini.cpp -+++ b/ffi/initfini.cpp -@@ -37,9 +37,10 @@ LLVMPY_Shutdown(){ - // NOTE: it is important that we don't export functions which we don't use, - // especially those which may pull in large amounts of additional code or data. - --// INIT(AllTargetInfos) --// INIT(AllTargets) --// INIT(AllTargetMCs) -+INIT(AllTargetInfos) -+INIT(AllTargets) -+INIT(AllTargetMCs) -+INIT(AllAsmPrinters) - INIT(NativeTarget) - INIT(NativeAsmParser) - INIT(NativeAsmPrinter) -diff --git a/llvmlite/binding/initfini.py b/llvmlite/binding/initfini.py -index bfaa5b2..7d0df11 100644 ---- a/llvmlite/binding/initfini.py -+++ b/llvmlite/binding/initfini.py -@@ -8,6 +8,15 @@ def initialize(): - ffi.lib.LLVMPY_InitializeCore() - - -+def initialize_all_targets(): -+ ffi.lib.LLVMPY_InitializeAllTargetInfos() -+ ffi.lib.LLVMPY_InitializeAllTargets() -+ ffi.lib.LLVMPY_InitializeAllTargetMCs() -+ -+def initialize_all_asmprinters(): -+ ffi.lib.LLVMPY_InitializeAllAsmPrinters() -+ -+ - def initialize_native_target(): - """ - Initialize the native (host) target. Necessary before doing any diff --git a/misc/llvmlite-build-as-debug-on-windows.patch b/misc/llvmlite-build-as-debug-on-windows.patch deleted file mode 100644 index e385fb4a2..000000000 --- a/misc/llvmlite-build-as-debug-on-windows.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/ffi/build.py b/ffi/build.py -index 3889ba5..58f93ec 100755 ---- a/ffi/build.py -+++ b/ffi/build.py -@@ -58,7 +58,7 @@ def find_win32_generator(): - - def main_win32(): - generator = find_win32_generator() -- config = 'Release' -+ config = 'Debug' - if not os.path.exists(build_dir): - os.mkdir(build_dir) - try_cmake(here_dir, build_dir, generator) diff --git a/misc/llvmlite-rename.patch b/misc/llvmlite-rename.patch deleted file mode 100644 index faea85104..000000000 --- a/misc/llvmlite-rename.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/setup.py b/setup.py -index 6d28265..f4edd29 100644 ---- a/setup.py -+++ b/setup.py -@@ -15,10 +15,10 @@ from llvmlite.utils import get_library_files - import versioneer - - versioneer.VCS = 'git' --versioneer.versionfile_source = 'llvmlite/_version.py' --versioneer.versionfile_build = 'llvmlite/_version.py' -+versioneer.versionfile_source = 'llvmlite_or1k/_version.py' -+versioneer.versionfile_build = 'llvmlite_or1k/_version.py' - versioneer.tag_prefix = 'v' # tags are like v1.2.0 --versioneer.parentdir_prefix = 'llvmlite-' # dirname like 'myproject-1.2.0' -+versioneer.parentdir_prefix = 'llvmlite_or1k-' # dirname like 'myproject-1.2.0' - - - here_dir = os.path.dirname(__file__) -@@ -54,7 +54,7 @@ class LlvmliteBuildExt(build_ext): - # HACK: this makes sure the library file (which is large) is only - # included in binary builds, not source builds. - self.distribution.package_data = { -- "llvmlite.binding": get_library_files(), -+ "llvmlite_or1k.binding": get_library_files(), - } - - -@@ -63,7 +63,7 @@ class LlvmliteInstall(install): - # This seems to only be necessary on OSX. - def run(self): - self.distribution.package_data = { -- "llvmlite.binding": get_library_files(), -+ "llvmlite_or1k.binding": get_library_files(), - } - install.run(self) - -@@ -74,14 +74,14 @@ cmdclass.update({'build': LlvmliteBuild, - }) - - --packages = ['llvmlite', -- 'llvmlite.binding', -- 'llvmlite.ir', -- 'llvmlite.llvmpy', -- 'llvmlite.tests', -+packages = ['llvmlite_or1k', -+ 'llvmlite_or1k.binding', -+ 'llvmlite_or1k.ir', -+ 'llvmlite_or1k.llvmpy', -+ 'llvmlite_or1k.tests', - ] - --setup(name='llvmlite', -+setup(name='llvmlite_or1k', - description="lightweight wrapper around basic LLVM functionality", - version=versioneer.get_version(), - classifiers=[ -@@ -96,6 +96,7 @@ setup(name='llvmlite', - "Topic :: Software Development :: Code Generators", - "Topic :: Software Development :: Compilers", - ], -+ package_dir={"llvmlite_or1k" : "llvmlite"}, - # Include the separately-compiled shared library - author="Continuum Analytics, Inc.", - author_email="numba-users@continuum.io", diff --git a/setup.py b/setup.py index 8c97ce619..1936af587 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ class PushDocCommand(Command): requirements = [ "sphinx", "sphinx-argparse", "pyserial", "numpy", "scipy", "python-dateutil", "prettytable", "h5py", "pydaqmx", "pyelftools", - "quamash", "pyqtgraph" + "quamash", "pyqtgraph", "llvmlite_artiq" ] scripts = [