Commits

Maciej Fijalkowski committed 9f5d6ac

major cleanup with imports

Comments (0)

Files changed (81)

pypy/jit/backend/llsupport/gc.py

 from pypy.rpython.lltypesystem import llgroup
 from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.rpython.annlowlevel import llhelper
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.jit.codewriter import heaptracker
 from pypy.jit.metainterp.history import ConstPtr, AbstractDescr
-from pypy.jit.metainterp.resoperation import ResOperation, rop
 from pypy.jit.backend.llsupport import symbolic
 from pypy.jit.backend.llsupport.symbolic import WORD
 from pypy.jit.backend.llsupport.descr import SizeDescr, ArrayDescr

pypy/jit/backend/llvm/llvm_rffi.py

 import py, os, sys
 import pypy
 from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo, log
+from platformer.cbuild import ExternalCompilationInfo, log
 
 if not sys.platform.startswith('linux'):
     py.test.skip("Linux only for now")

pypy/jit/backend/llvm/runner.py

 from pypy.rlib import runicode
 from pypy.jit.metainterp.history import AbstractDescr, INT
 from pypy.jit.metainterp.history import BoxInt, BoxPtr
-from pypy.jit.backend.model import AbstractCPU
 from pypy.jit.backend.llvm import llvm_rffi
 from pypy.jit.metainterp import history
 from pypy.jit.metainterp.resoperation import rop, ResOperation
         self._zer_error_instance = self._get_prebuilt_error(ZeroDivisionError)
         #
         # temporary (Boehm only)
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
+        from platformer.cbuild import ExternalCompilationInfo
         compilation_info = ExternalCompilationInfo(libraries=['gc'])
         self.malloc_fn_ptr = rffi.llexternal("GC_malloc",
                                              [rffi.SIZE_T],

pypy/jit/backend/test/runner_test.py

 from pypy.rlib import longlong2float
 from pypy.rlib.rarithmetic import intmask, is_valid_int
 from pypy.jit.backend.detect_cpu import autodetect_main_model_and_size
+from platformer.cbuild import ExternalCompilationInfo
 
 
 def boxfloat(x):
     def test_short_result_of_call_direct(self):
         # Test that calling a function that returns a CHAR, SHORT or INT,
         # signed or unsigned, properly gets zero-extended or sign-extended.
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         for RESTYPE in [rffi.SIGNEDCHAR, rffi.UCHAR,
                         rffi.SHORT, rffi.USHORT,
                         rffi.INT, rffi.UINT,
     def test_short_result_of_call_compiled(self):
         # Test that calling a function that returns a CHAR, SHORT or INT,
         # signed or unsigned, properly gets zero-extended or sign-extended.
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         for RESTYPE in [rffi.SIGNEDCHAR, rffi.UCHAR,
                         rffi.SHORT, rffi.USHORT,
                         rffi.INT, rffi.UINT,
     def test_longlong_result_of_call_direct(self):
         if not self.cpu.supports_longlong:
             py.test.skip("longlong test")
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.rlib.rarithmetic import r_longlong
         eci = ExternalCompilationInfo(
             separate_module_sources=["""
     def test_longlong_result_of_call_compiled(self):
         if not self.cpu.supports_longlong:
             py.test.skip("test of longlong result")
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.rlib.rarithmetic import r_longlong
         eci = ExternalCompilationInfo(
             separate_module_sources=["""
     def test_singlefloat_result_of_call_direct(self):
         if not self.cpu.supports_singlefloats:
             py.test.skip("singlefloat test")
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.rlib.rarithmetic import r_singlefloat
         eci = ExternalCompilationInfo(
             separate_module_sources=["""
         assert f(value) == expected
         #
         FUNC = self.FuncType([lltype.SingleFloat], lltype.SingleFloat)
-        FPTR = self.Ptr(FUNC)
         calldescr = self.cpu.calldescrof(FUNC, FUNC.ARGS, FUNC.RESULT,
                                          EffectInfo.MOST_GENERAL)
         ivalue = longlong.singlefloat2int(value)
     def test_singlefloat_result_of_call_compiled(self):
         if not self.cpu.supports_singlefloats:
             py.test.skip("test of singlefloat result")
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.rlib.rarithmetic import r_singlefloat
         eci = ExternalCompilationInfo(
             separate_module_sources=["""
         assert f(value) == expected
         #
         FUNC = self.FuncType([lltype.SingleFloat], lltype.SingleFloat)
-        FPTR = self.Ptr(FUNC)
         calldescr = self.cpu.calldescrof(FUNC, FUNC.ARGS, FUNC.RESULT,
                                          EffectInfo.MOST_GENERAL)
         funcbox = self.get_funcbox(self.cpu, f)

pypy/jit/backend/x86/oprofile.py

 from pypy.rpython.tool import rffi_platform
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.rlib.objectmodel import we_are_translated
+from pypy.rpython.lltypesystem import rffi
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.rposix import get_errno
 from pypy.jit.backend.x86 import profagent
 

pypy/jit/backend/x86/support.py

 import sys
 from pypy.rpython.lltypesystem import lltype, rffi, llmemory
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.jit.backend.x86.arch import WORD
 
 

pypy/jit/backend/x86/valgrind.py

 
 from pypy.rpython.tool import rffi_platform
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.objectmodel import we_are_translated
 
 

pypy/module/__pypy__/interp_time.py

 from pypy.interpreter.gateway import unwrap_spec
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 if os.name == 'nt':
     libraries = []

pypy/module/_demo/demo.py

 from pypy.interpreter.typedef import TypeDef, GetSetProperty
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-import sys, math
+from platformer.cbuild import ExternalCompilationInfo
+import math
 
 time_t = rffi_platform.getsimpletype('time_t', '#include <time.h>', rffi.LONG)
 

pypy/module/_ffi/test/test__ffi.py

 from pypy.conftest import gettestobjspace
-from pypy.translator.platform import platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.module._rawffi.interp_rawffi import TYPEMAP
-from pypy.module._rawffi.tracker import Tracker
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
 
-import os, sys, py
+import sys, py
 
 class AppTestFfi:
 
     @classmethod
     def prepare_c_example(cls):
         from pypy.tool.udir import udir
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
-        from pypy.translator.platform import platform
 
         c_file = udir.ensure("test__ffi", dir=1).join("foolib.c")
         # automatically collect the C source from the docstrings of the tests

pypy/module/_lsprof/interp_lsprof.py

 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rlib.rtimer import read_timestamp, _is_64_bit
 from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.tool.autopath import pypydir
 from pypy.rlib.rarithmetic import r_longlong
 

pypy/module/_minimal_curses/fficurses.py

 from pypy.rpython.tool import rffi_platform
 from pypy.rpython.extfunc import register_external
 from pypy.module._minimal_curses import interp_curses
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 eci = ExternalCompilationInfo(
     includes = ['curses.h', 'term.h'],

pypy/module/_multibytecodec/c_codecs.py

 import py
 from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.tool.autopath import pypydir
 
 UNICODE_REPLACEMENT_CHARACTER = u'\uFFFD'

pypy/module/_multiprocessing/interp_semaphore.py

 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rlib import rgc
 from pypy.rlib.rarithmetic import r_uint
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform as platform
 from pypy.module.thread import ll_thread
 from pypy.module._multiprocessing.interp_connection import w_handle

pypy/module/_multiprocessing/interp_win32.py

 from pypy.rlib import rwin32
 from pypy.rlib.rarithmetic import r_uint
 from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform
 from pypy.module._multiprocessing.interp_connection import w_handle
 

pypy/module/_rawffi/test/test__rawffi.py

 
 from pypy.conftest import gettestobjspace
 from pypy.translator.platform import platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.module._rawffi.interp_rawffi import TYPEMAP
 from pypy.module._rawffi.tracker import Tracker
 
-import os, sys, py
+import sys, py
 
 class AppTestFfi:
     def prepare_c_example():

pypy/module/bz2/interp_bz2.py

 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.rlib.streamio import Stream
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform as compiler
 from pypy.rlib.rarithmetic import intmask, r_longlong
 import sys

pypy/module/cmath/constant.py

 import math
 from pypy.rlib.rfloat import isinf
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 class CConfig:

pypy/module/cpyext/api.py

-import ctypes
 import sys, os
-import atexit
 
 import py
 
 from pypy.rpython.lltypesystem import ll2ctypes
 from pypy.rpython.annlowlevel import llhelper
 from pypy.rlib.objectmodel import we_are_translated
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.gensupp import NameManager
 from pypy.tool.udir import udir
-from pypy.translator import platform
 from pypy.module.cpyext.state import State
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.interpreter.gateway import unwrap_spec
-from pypy.interpreter.nestedscope import Cell
-from pypy.interpreter.module import Module
-from pypy.interpreter.function import StaticMethod
-from pypy.objspace.std.sliceobject import W_SliceObject
-from pypy.module.__builtin__.descriptor import W_Property
-from pypy.module.__builtin__.interp_classobj import W_ClassObject
-from pypy.module.__builtin__.interp_memoryview import W_MemoryView
 from pypy.rlib.entrypoint import entrypoint
 from pypy.rlib.rposix import is_valid_fd, validate_fd
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.rlib.objectmodel import specialize
 from pypy.rlib.exports import export_struct
 from pypy.module import exceptions
-from pypy.module.exceptions import interp_exceptions
 # CPython 2.4 compatibility
 from py.builtin import BaseException
 from pypy.tool.sourcetools import func_with_new_name

pypy/module/cpyext/test/test_cpyext.py

 import py
 
 from pypy.conftest import gettestobjspace
-from pypy.interpreter.error import OperationError
-from pypy.interpreter.gateway import interp2app
-from pypy.rpython.lltypesystem import rffi, lltype, ll2ctypes
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from pypy.rpython.lltypesystem import lltype, ll2ctypes
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator import platform
 from pypy.translator.gensupp import uniquemodulename
 from pypy.tool.udir import udir
 from pypy.module.cpyext import api
 from pypy.module.cpyext.state import State
 from pypy.module.cpyext.pyobject import RefcountState
-from pypy.module.cpyext.pyobject import Py_DecRef, InvalidPointerException
+from pypy.module.cpyext.pyobject import Py_DecRef
 from pypy.translator.goal import autopath
 from pypy.tool.identity_dict import identity_dict
 from pypy.tool import leakfinder

pypy/module/crypt/interp_crypt.py

 from pypy.interpreter.gateway import unwrap_spec
 from pypy.rpython.lltypesystem import rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 import sys
 
 if sys.platform.startswith('darwin'):

pypy/module/fcntl/interp_fcntl.py

 from pypy.interpreter.error import OperationError, wrap_oserror
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.rlib import rposix
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 import sys
 
 class CConfig:

pypy/module/oracle/roci.py

-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform as platform
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.conftest import option

pypy/module/posix/interp_posix.py

 from pypy.rlib.rarithmetic import r_longlong
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.interpreter.error import OperationError, wrap_oserror, wrap_oserror2
-from pypy.interpreter.error import operationerrfmt
 from pypy.rpython.module.ll_os import RegisterOs
 from pypy.rpython.module import ll_os_stat
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.module.sys.interp_encoding import getfilesystemencoding
 
 import os, sys

pypy/module/pwd/interp_pwd.py

-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform
 from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.interpreter.gateway import interp2app, unwrap_spec
-from pypy.interpreter.error import OperationError, operationerrfmt
+from pypy.interpreter.gateway import unwrap_spec
+from pypy.interpreter.error import operationerrfmt
 from pypy.rlib.rarithmetic import intmask
 
 eci = ExternalCompilationInfo(

pypy/module/pyexpat/interp_pyexpat.py

 from pypy.rlib import rgc
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
 
 import sys

pypy/module/rctime/interp_time.py

 from pypy.rpython.lltypesystem import lltype
 from pypy.rlib.rarithmetic import ovfcheck_float_to_int, intmask
 from pypy.rlib import rposix
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 import os
 import sys
 import time as pytime

pypy/module/select/interp_epoll.py

 from pypy.rpython.tool import rffi_platform
 from pypy.rlib._rsocket_rffi import socketclose, FD_SETSIZE
 from pypy.rlib.rposix import get_errno
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 eci = ExternalCompilationInfo(

pypy/module/select/interp_kqueue.py

 from pypy.rlib.rarithmetic import r_uint
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 eci = ExternalCompilationInfo(

pypy/module/signal/interp_signal.py

 import signal as cpy_signal
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 import py
 import sys
 from pypy.tool import autopath

pypy/module/test_lib_pypy/ctypes_tests/conftest.py

 
 def compile_so_file():
     from pypy.translator.platform import platform
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
+    from platformer.cbuild import ExternalCompilationInfo
     udir = pytest.ensuretemp('_ctypes_test')
     cfile = py.path.local(__file__).dirpath().join("_ctypes_test.c")
 

pypy/module/thread/ll_thread.py

 
 from pypy.rpython.lltypesystem import rffi, lltype, llmemory
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 import py
 from pypy.rlib import jit, rgc
 from pypy.rlib.debug import ll_assert

pypy/rlib/_rffi_stacklet.py

 import py
 from pypy.tool.autopath import pypydir
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform
 from pypy.rlib.rarithmetic import is_emulated_long
-import sys
 
 
 cdir = py.path.local(pypydir) / 'translator' / 'c'

pypy/rlib/_rsocket_rffi.py

 from pypy.rpython.tool import rffi_platform as platform
 from pypy.rpython.lltypesystem.rffi import CCHARP
 from pypy.rlib.rposix import get_errno as geterrno
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform as target_platform
 
 from pypy.rlib.rarithmetic import intmask, r_uint

pypy/rlib/clibffi.py

 from pypy.rpython.tool import rffi_platform
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib.rarithmetic import intmask, r_uint, is_emulated_long
+from pypy.rlib.rarithmetic import intmask, is_emulated_long
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rlib.rmmap import alloc
 from pypy.rlib.rdynload import dlopen, dlclose, dlsym, dlsym_byordinal
-from pypy.rlib.rdynload import DLOpenError, DLLHANDLE
+from pypy.rlib.rdynload import DLLHANDLE
 from pypy.rlib import jit
 from pypy.tool.autopath import pypydir
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
 import py
 import os

pypy/rlib/longlong2float.py

 from pypy.rlib.rarithmetic import r_int64
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.extregistry import ExtRegistryEntry
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 # -------- implement longlong2float and float2longlong --------

pypy/rlib/rdtoa.py

 from __future__ import with_statement
 from pypy.rlib import rfloat
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.tool.autopath import pypydir
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rlib import jit

pypy/rlib/rdynload.py

 from pypy.rpython.tool import rffi_platform
 from pypy.rpython.lltypesystem import rffi
 from pypy.rlib.rarithmetic import r_uint
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
 
 import sys

pypy/rlib/rfloat.py

 from pypy.rlib import objectmodel
 from pypy.rpython.extfunc import register_external
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 USE_SHORT_FLOAT_REPR = True # XXX make it a translation option?

pypy/rlib/rlocale.py

 import sys
 
 from pypy.rpython.lltypesystem import rffi, lltype
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform as platform
 from pypy.rpython.extfunc import register_external
 

pypy/rlib/rmd5.py

     Converted to RPython by arigo.
 """
 
-from pypy.rlib.rarithmetic import r_uint, r_ulonglong, intmask
+from pypy.rlib.rarithmetic import r_uint, r_ulonglong
 
 
 if r_uint.BITS == 32:
 
     # ----- start of custom code, think about something better... -----
     from pypy.rpython.lltypesystem import lltype, rffi
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
+    from platformer.cbuild import ExternalCompilationInfo
     eci = ExternalCompilationInfo(post_include_bits=["""
 static unsigned long pypy__rotateLeft(unsigned long x, long n) {
     unsigned int x1 = x;    /* arithmetic directly on int */

pypy/rlib/rmmap.py

 
 from pypy.rpython.tool import rffi_platform
-from pypy.rpython.lltypesystem import rffi, lltype, llmemory
+from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rlib import rposix
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.nonconst import NonConstant
 
 import sys

pypy/rlib/ropenssl.py

 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
 from pypy.translator.platform import platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 import sys, os
 

pypy/rlib/rposix.py

 import os
-from pypy.rpython.lltypesystem.rffi import (CConstant, CExternVariable,
-        INT, CCHARPP)
-from pypy.rpython.lltypesystem import lltype, ll2ctypes, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from pypy.rpython.lltypesystem.rffi import CConstant, CExternVariable, INT
+from pypy.rpython.lltypesystem import ll2ctypes, rffi
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.rarithmetic import intmask
 from pypy.rlib.objectmodel import specialize
 from pypy.rlib import jit

pypy/rlib/rsdl/RIMG.py

 import sys
-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.rpython.tool import rffi_platform as platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from pypy.rpython.lltypesystem import rffi
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.rsdl import RSDL
 
 

pypy/rlib/rsdl/RMix.py

 import sys
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.tool import rffi_platform as platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.rsdl import RSDL
 
 

pypy/rlib/rsdl/eci.py

-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import CompilationError
 import py
 import sys

pypy/rlib/rstack.py

 RPython-compliant way, intended mostly for use by the Stackless PyPy.
 """
 
-import inspect
-
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rlib.rarithmetic import r_uint
 from pypy.rlib import rgc
-from pypy.rpython.extregistry import ExtRegistryEntry
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.rpython.controllerentry import Controller, SomeControlledInstance
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 # ____________________________________________________________
 

pypy/rlib/rstruct/nativefmttable.py

 """
 import struct
 
-from pypy.rlib import jit, longlong2float
+from pypy.rlib import longlong2float
 from pypy.rlib.objectmodel import specialize
 from pypy.rlib.rarithmetic import r_singlefloat, widen
 from pypy.rlib.rstruct import standardfmttable as std
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 native_is_bigendian = struct.pack("=i", 1) == struct.pack(">i", 1)

pypy/rlib/rwin32.py

 
 from pypy.rpython.tool import rffi_platform
 from pypy.tool.udir import udir
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import CompilationError
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rlib.rarithmetic import intmask
 from pypy.rlib.rposix import validate_fd
 from pypy.rlib import jit
-import os, sys, errno
+import os, errno
 
 # This module can be imported on any platform,
 # but most symbols are not usable...

pypy/rlib/rwinreg.py

 from __future__ import with_statement
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.tool import rffi_platform as platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.rarithmetic import intmask
 from pypy.rlib import rwin32
 

pypy/rlib/rzlib.py

 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
 from pypy.translator.platform import platform as compiler, CompilationError
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 
 if compiler.name == "msvc":

pypy/rlib/streamio.py

 
 if sys.platform == "win32":
     from pypy.rlib.rwin32 import BOOL, HANDLE, get_osfhandle, GetLastError
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
+    from platformer.cbuild import ExternalCompilationInfo
     from pypy.rpython.lltypesystem import rffi
 
     _eci = ExternalCompilationInfo()

pypy/rlib/test/test_clibffi.py

 from pypy.rlib.objectmodel import keepalive_until_here
 from pypy.rpython.lltypesystem.ll2ctypes import ALLOCATED
 from pypy.rpython.lltypesystem import rffi, lltype
+from platformer.cbuild import ExternalCompilationInfo
 import py
 import sys
 import time
         lltype.free(tpe2, flavor='raw')
 
     def test_struct_by_val(self):
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.translator.platform import platform
         from pypy.tool.udir import udir
 
         assert not ALLOCATED
 
     def test_ret_struct_val(self):
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.translator.platform import platform
         from pypy.tool.udir import udir
 
         assert not ALLOCATED
 
     def test_cdll_life_time(self):
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.translator.platform import platform
         from pypy.tool.udir import udir
 

pypy/rlib/test/test_libffi.py

     @classmethod
     def setup_class(cls):
         from pypy.tool.udir import udir
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
-        from pypy.translator.tool.cbuild import STANDARD_DEFINES
+        from platformer.cbuild import ExternalCompilationInfo
+        from platformer.cbuild import STANDARD_DEFINES
         from pypy.translator.platform import platform
 
         BaseFfiTest.setup_class()

pypy/rpython/lltypesystem/llarena.py

 import array, weakref
 from pypy.rpython.lltypesystem import llmemory
 from pypy.rlib.rarithmetic import is_valid_int
+from platformer.cbuild import ExternalCompilationInfo
 
 
 # An "arena" is a large area of memory which can hold a number of
 import os, sys
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.extfunc import register_external
-from pypy.rlib.objectmodel import CDefinedIntSymbolic
 
 if sys.platform.startswith('linux'):
     # This only works with linux's madvise(), which is really not a memory
     # lazily-allocating pages on all Linux systems.
 
     from pypy.rpython.tool import rffi_platform
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
     _eci = ExternalCompilationInfo(includes=['sys/mman.h'])
     MADV_DONTNEED = rffi_platform.getconstantinteger('MADV_DONTNEED',
                                                      '#include <sys/mman.h>')
     clear_large_memory_chunk = llmemory.raw_memclear
 
 if os.name == "posix":
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
     _eci = ExternalCompilationInfo(includes=['sys/mman.h'])
     raw_mprotect = rffi.llexternal('mprotect',
                                    [llmemory.Address, rffi.SIZE_T, rffi.INT],

pypy/rpython/lltypesystem/module/ll_math.py

 from pypy.tool.sourcetools import func_with_new_name
 from pypy.tool.autopath import pypydir
 from pypy.rlib import jit, rposix
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
 from pypy.rlib.rfloat import isfinite, isinf, isnan, INFINITY, NAN
 

pypy/rpython/lltypesystem/rffi.py

 from pypy.rpython.extregistry import ExtRegistryEntry
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.rpython.tool.rfficache import platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.annlowlevel import llhelper
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rlib.rstring import StringBuilder, UnicodeBuilder, assert_str0
     the given global C variable.
     """
     from pypy.translator.c.primitive import PrimitiveType
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
     # XXX we cannot really enumerate all C types here, do it on a case-by-case
     #     basis
     if c_type is None:

pypy/rpython/lltypesystem/test/test_ll2ctypes.py

 import sys, struct
 import ctypes
 from pypy.rpython.lltypesystem import lltype, rffi, llmemory
-from pypy.rpython.tool import rffi_platform
 from pypy.rpython.lltypesystem.ll2ctypes import lltype2ctypes, ctypes2lltype
 from pypy.rpython.lltypesystem.ll2ctypes import standard_c_lib
 from pypy.rpython.lltypesystem.ll2ctypes import uninitialized2ctypes
-from pypy.rpython.lltypesystem.ll2ctypes import ALLOCATED, force_cast
+from pypy.rpython.lltypesystem.ll2ctypes import ALLOCATED
 from pypy.rpython.lltypesystem.ll2ctypes import cast_adr_to_int, get_ctypes_type
 from pypy.rpython.lltypesystem.ll2ctypes import _llgcopaque
 from pypy.rpython.annlowlevel import llhelper
 from pypy.rlib import rposix
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.tool.udir import udir
 from pypy.rpython.test.test_llinterp import interpret
 from pypy.annotation.annrpython import RPythonAnnotator

pypy/rpython/lltypesystem/test/test_rffi.py

 from pypy.rpython.lltypesystem.rffi import _keeper_for_type # crap
 from pypy.rlib.rposix import get_errno, set_errno
 from pypy.translator.c.test.test_genc import compile as compile_c
-from pypy.rpython.lltypesystem.lltype import Signed, Ptr, Char, malloc
-from pypy.rpython.lltypesystem.rstr import STR
+from pypy.rpython.lltypesystem.lltype import Signed, Char
 from pypy.rpython.lltypesystem import lltype
 from pypy.tool.udir import udir
 from pypy.rpython.test.test_llinterp import interpret
-from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
 from pypy.annotation.annrpython import RPythonAnnotator
 from pypy.rpython.rtyper import RPythonTyper
 from pypy.translator.backendopt.all import backend_optimizations
 from pypy.translator.translator import graphof
 from pypy.conftest import option
 from pypy.objspace.flow.model import summary
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rlib.rarithmetic import r_singlefloat
 
 class BaseTestRffi:
         h_file = udir.join("opaque.h")
         h_file.write(h_source)
     
-        from pypy.rpython.tool import rffi_platform
         eci = ExternalCompilationInfo(
             includes=['opaque.h'],
             include_dirs=[str(udir)],
         h_file = udir.join("opaque2%s.h" % (ctype_pref, ))
         h_file.write(h_source)
     
-        from pypy.rpython.tool import rffi_platform
         eci = ExternalCompilationInfo(
             includes=[h_file.basename],
             include_dirs=[str(udir)]

pypy/rpython/module/ll_os.py

 
 import os, sys, errno
 import py
-from pypy.rpython.module.support import ll_strcpy, OOSupport
-from pypy.tool.sourcetools import func_with_new_name, func_renamer
+from pypy.rpython.module.support import OOSupport
+from pypy.tool.sourcetools import func_renamer
 from pypy.rlib.rarithmetic import r_longlong
-from pypy.rpython.extfunc import (
-    BaseLazyRegistering, lazy_register, register_external)
+from pypy.rpython.extfunc import BaseLazyRegistering, register_external
 from pypy.rpython.extfunc import registering, registering_if, extdef
 from pypy.annotation.model import (
     SomeInteger, SomeString, SomeTuple, SomeFloat, SomeUnicodeString)
 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.tool import rffi_platform as platform
 from pypy.rlib import rposix
-from pypy.tool.udir import udir
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.rpython.lltypesystem.rstr import mallocstr
-from pypy.rpython.annlowlevel import llstr
-from pypy.rpython.lltypesystem.llmemory import sizeof,\
-     itemoffsetof, cast_ptr_to_adr, cast_adr_to_ptr, offsetof
+from platformer.cbuild import ExternalCompilationInfo
+from pypy.rpython.lltypesystem.llmemory import itemoffsetof, offsetof
 from pypy.rpython.lltypesystem.rstr import STR
-from pypy.rpython.annlowlevel import llstr
-from pypy.rlib import rgc
 from pypy.rlib.objectmodel import specialize
 
 str0 = SomeString(no_nul=True)

pypy/rpython/module/ll_os_environ.py

 # ____________________________________________________________
 # Access to the 'environ' external variable
 
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 if sys.platform.startswith('darwin'):
     CCHARPPP = rffi.CArrayPtr(rffi.CCHARPP)

pypy/rpython/module/ll_os_stat.py

 import os, sys
 from pypy.annotation import model as annmodel
 from pypy.tool.pairtype import pairtype
-from pypy.tool.sourcetools import func_with_new_name, func_renamer
+from pypy.tool.sourcetools import func_renamer
 from pypy.rpython import extregistry
-from pypy.rpython.extfunc import register_external, extdef
+from pypy.rpython.extfunc import extdef
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform as platform
 from pypy.rpython.lltypesystem.rtupletype import TUPLE_TYPE
 from pypy.rlib import rposix
 from pypy.rlib.rarithmetic import intmask
-from pypy.rlib.objectmodel import specialize
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.annlowlevel import hlstr
 
 # Support for float times is here.
     # - file modification times suffer from forth-and-back conversions between
     #   UTC and local time
     # Therefore, we implement our own stat, based on the Win32 API directly.
-    from pypy.rpython.tool import rffi_platform as platform
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
-    from pypy.rlib import rwin32
 
     assert len(STAT_FIELDS) == 10    # no extra fields on Windows
 

pypy/rpython/module/ll_strtod.py

 from pypy.tool.autopath import pypydir
 from pypy.rpython.ootypesystem import ootype
 from pypy.rlib import rposix
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.tool.autopath import pypydir
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.annotation.model import SomeString
 
 class CConfig:

pypy/rpython/module/ll_termios.py

 import termios
 from pypy.rpython.lltypesystem import rffi
 from pypy.rpython.lltypesystem import lltype
-from pypy.rpython.extfunc import lazy_register, register_external
+from pypy.rpython.extfunc import register_external
 from pypy.rlib.rarithmetic import intmask
-from pypy.rpython.extregistry import ExtRegistryEntry
-from pypy.annotation import model as annmodel
-from pypy.rpython import rclass
 from pypy.rlib import rtermios, rposix
 from pypy.rpython.tool import rffi_platform
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 eci = ExternalCompilationInfo(
     includes = ['termios.h', 'unistd.h']

pypy/rpython/module/ll_time.py

 from pypy.rpython.extfunc import BaseLazyRegistering, registering, extdef
 from pypy.rlib import rposix
 from pypy.rlib.rarithmetic import intmask, maxint32
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 if sys.platform == 'win32':
     TIME_H = 'time.h'

pypy/rpython/module/ll_win32file.py

 from __future__ import with_statement
 
 from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform as platform
 from pypy.tool.sourcetools import func_renamer
 from pypy.rlib.objectmodel import specialize

pypy/rpython/tool/genrffi.py

 import ctypes
 from pypy.rpython.lltypesystem import rffi
 from pypy.rpython.lltypesystem import lltype
-from pypy.rlib.unroll import unrolling_iterable
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-
-import py
+from platformer.cbuild import ExternalCompilationInfo
 
 #rffi.UINT = rffi.INT # XXX
 #rffi.UCHAR = lltype.Char # XXX

pypy/rpython/tool/rffi_platform.py

 import py
 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.lltypesystem import rffi
-from pypy.rpython.lltypesystem import llmemory
 from pypy.tool.gcc_cache import build_executable_cache, try_compile_cache
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import CompilationError
 from pypy.tool.udir import udir
 from pypy.tool.autopath import pypydir

pypy/rpython/tool/test/test_mkrffi.py

         import ctypes
         from pypy.tool.udir import udir
         from pypy.translator.platform import platform
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
+        from platformer.cbuild import ExternalCompilationInfo
         
         c_source = """
         void *int_to_void_p(int arg) {}

pypy/rpython/tool/test/test_rffi_platform.py

 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.lltypesystem import rffi
 from pypy.tool.udir import udir
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform
 from pypy.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong
 from pypy.rlib.rfloat import isnan

pypy/tool/gcc_cache.py

 from pypy.tool.autopath import pypydir
 from pypy.translator.platform import CompilationError
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.tool.compat import md5
 import py
 

pypy/tool/test/test_gcc_cache.py

 from pypy.tool.gcc_cache import *
 from pypy.tool.udir import udir
 import md5, cStringIO
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 localudir = udir.join('test_gcc_cache').ensure(dir=1)
 

pypy/translator/c/dlltool.py

 
 from pypy.translator.driver import TranslationDriver
-from pypy.translator.c.genc import CBuilder, CCompilerDriver
+from pypy.translator.c.genc import CBuilder
 from pypy.rpython.typesystem import getfunctionptr
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 
 class CLibraryBuilder(CBuilder):
     standalone = False

pypy/translator/c/gc.py

 from pypy.objspace.flow.model import Constant
 from pypy.translator.c.support import cdecl
 from pypy.translator.c.node import ContainerNode
-from pypy.rpython.lltypesystem.lltype import \
-     typeOf, Ptr, ContainerType, RttiStruct, \
-     RuntimeTypeInfo, getRuntimeTypeInfo, top_container
+from pypy.rpython.lltypesystem.lltype import typeOf, RttiStruct, \
+     RuntimeTypeInfo, top_container
 from pypy.rpython.memory.gctransform import \
      refcounting, boehm, framework, asmgcroot
-from pypy.rpython.lltypesystem import lltype, llmemory
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from pypy.rpython.lltypesystem import lltype
+from platformer.cbuild import ExternalCompilationInfo
 
 class BasicGcPolicy(object):
 

pypy/translator/c/gcc/test/test_asmgcroot.py

 from pypy.translator.c.genc import CStandaloneBuilder
 from pypy.annotation.listdef import s_list_of_strings
 from pypy import conftest
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.translator.platform import platform as compiler
 from pypy.rlib.rarithmetic import is_emulated_long
 from pypy.rpython.lltypesystem import lltype, rffi

pypy/translator/c/genc.py

 from pypy.translator.c.extfunc import pre_include_code_lines
 from pypy.translator.llsupport.wrapper import new_wrapper
 from pypy.translator.gensupp import uniquemodulename, NameManager
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from platformer.cbuild import ExternalCompilationInfo
 from pypy.rpython.lltypesystem import lltype
 from pypy.tool.udir import udir, pypydir
 from pypy.tool import isolate, runsubprocess

pypy/translator/c/node.py

 from pypy.rlib.rfloat import isfinite
 from pypy.rlib.rstackovf import _StackOverflow
 from pypy.translator.c import extfunc
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from py.builtin import BaseException
 
 def needs_gcheader(T):

pypy/translator/oosupport/test_template/builtin.py

 
     def test_rffi_primitive(self):
         from pypy.rpython.lltypesystem import rffi, lltype
-        from pypy.translator.tool.cbuild import ExternalCompilationInfo
+        from platformer.cbuild import ExternalCompilationInfo
         eci = ExternalCompilationInfo(
             includes = ['ctype.h']
         )

pypy/translator/tool/benchmark.py

 import autopath
-from pypy.tool import testit
-from pypy.tool.udir import udir
-from pypy.translator.tool.cbuild import build_cfunc
+from platformer.cbuild import build_cfunc
 from pypy.translator.test.test_cltrans import global_cl, make_cl_func
 
 def benchmark(func):

pypy/translator/tool/test/test_cbuild.py

 import py
 
 from pypy.tool.udir import udir
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from subprocess import Popen, PIPE, STDOUT
+from platformer.cbuild import ExternalCompilationInfo
 
 class TestEci:
     def setup_class(cls):