Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5bf5a0

Browse files
authored
[mypyc] Refactor: move emit related modules to mypyc.codegen (#8472)
The modules are unchanged, and I preserved the original module names, except for adding `.codegen` in the middle.
1 parent 1cfd9b4 commit b5bf5a0

12 files changed

Lines changed: 17 additions & 17 deletions

File tree

mypyc/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from mypyc.common import shared_lib_name
4141
from mypyc.ir.module_ir import format_modules
4242

43-
from mypyc import emitmodule
43+
from mypyc.codegen import emitmodule
4444

4545
if TYPE_CHECKING:
4646
from distutils.core import Extension # noqa

mypyc/codegen/__init__.py

Whitespace-only changes.
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from collections import OrderedDict
66

77
from mypyc.common import PREFIX, NATIVE_PREFIX, REG_PREFIX
8-
from mypyc.emit import Emitter, HeaderDeclaration
9-
from mypyc.emitfunc import native_function_header, native_getter_name, native_setter_name
10-
from mypyc.emitwrapper import (
8+
from mypyc.codegen.emit import Emitter, HeaderDeclaration
9+
from mypyc.codegen.emitfunc import native_function_header, native_getter_name, native_setter_name
10+
from mypyc.codegen.emitwrapper import (
1111
generate_dunder_wrapper, generate_hash_wrapper, generate_richcompare_wrapper,
1212
generate_bool_wrapper, generate_get_wrapper,
1313
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mypyc.common import (
66
REG_PREFIX, NATIVE_PREFIX, STATIC_PREFIX, TYPE_PREFIX, MODULE_PREFIX,
77
)
8-
from mypyc.emit import Emitter
8+
from mypyc.codegen.emit import Emitter
99
from mypyc.ir.ops import (
1010
OpVisitor, Goto, Branch, Return, Assign, LoadInt, LoadErrorValue, GetAttr, SetAttr,
1111
LoadStatic, InitStatic, TupleGet, TupleSet, Call, IncRef, DecRef, Box, Cast, Unbox,
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
from mypyc.common import (
2626
PREFIX, TOP_LEVEL_NAME, INT_PREFIX, MODULE_PREFIX, shared_lib_name,
2727
)
28-
from mypyc.cstring import encode_as_c_string, encode_bytes_as_c_string
29-
from mypyc.emit import EmitterContext, Emitter, HeaderDeclaration
30-
from mypyc.emitfunc import generate_native_function, native_function_header
31-
from mypyc.emitclass import generate_class_type_decl, generate_class
32-
from mypyc.emitwrapper import (
28+
from mypyc.codegen.cstring import encode_as_c_string, encode_bytes_as_c_string
29+
from mypyc.codegen.emit import EmitterContext, Emitter, HeaderDeclaration
30+
from mypyc.codegen.emitfunc import generate_native_function, native_function_header
31+
from mypyc.codegen.emitclass import generate_class_type_decl, generate_class
32+
from mypyc.codegen.emitwrapper import (
3333
generate_wrapper_function, wrapper_function_header,
3434
)
3535
from mypyc.ir.ops import LiteralsMap, DeserMaps
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mypy.nodes import ARG_POS, ARG_OPT, ARG_NAMED_OPT, ARG_NAMED, ARG_STAR, ARG_STAR2
66

77
from mypyc.common import PREFIX, NATIVE_PREFIX, DUNDER_PREFIX
8-
from mypyc.emit import Emitter
8+
from mypyc.codegen.emit import Emitter
99
from mypyc.ir.rtypes import (
1010
RType, is_object_rprimitive, is_int_rprimitive, is_bool_rprimitive, object_rprimitive
1111
)

mypyc/test/test_emit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from mypy.nodes import Var
44

5-
from mypyc.emit import Emitter, EmitterContext
5+
from mypyc.codegen.emit import Emitter, EmitterContext
66
from mypyc.ir.ops import BasicBlock, Environment
77
from mypyc.ir.rtypes import int_rprimitive
88
from mypyc.namegen import NameGenerator

mypyc/test/test_emitfunc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
from mypyc.ir.func_ir import FuncIR, FuncDecl, RuntimeArg, FuncSignature
1818
from mypyc.ir.class_ir import ClassIR
1919
from mypyc.irbuild.vtable import compute_vtable
20-
from mypyc.emit import Emitter, EmitterContext
21-
from mypyc.emitfunc import generate_native_function, FunctionEmitterVisitor
20+
from mypyc.codegen.emit import Emitter, EmitterContext
21+
from mypyc.codegen.emitfunc import generate_native_function, FunctionEmitterVisitor
2222
from mypyc.primitives.registry import binary_ops
2323
from mypyc.primitives.misc_ops import none_object_op, true_op, false_op
2424
from mypyc.primitives.list_ops import (

0 commit comments

Comments
 (0)