-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
29 lines (24 loc) · 1.08 KB
/
__init__.py
File metadata and controls
29 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from shellblocks.compiler_arch_option import CompilerArchOption
from shellblocks.compiler_archs.mips import CompilerArchMIPSBE, CompilerArchMIPSLE
from shellblocks.compiler_archs.arm import CompilerArchARMLE
from shellblocks.compiler_archs.x86 import CompilerArchX86
from shellblocks.compiler_archs.x86_64 import CompilerArchX86_64
from shellblocks.compiler_archs.powerpc import CompilerArchPowerPC
from shellblocks.compiler_arch import CompilerArch
def compiler_arch_to_object(arch: CompilerArchOption) -> CompilerArch:
if arch == CompilerArchOption.MIPSBE:
return CompilerArchMIPSBE()
elif arch == CompilerArchOption.MIPSLE:
return CompilerArchMIPSLE()
elif arch == CompilerArchOption.ARMLE:
return CompilerArchARMLE()
elif arch == CompilerArchOption.X86:
return CompilerArchX86()
elif arch == CompilerArchOption.X86_64:
return CompilerArchX86_64()
elif arch == CompilerArchOption.POWERPCLE:
return CompilerArchPowerPC()
raise NotImplementedError()
__all__ = [
CompilerArchMIPSBE, CompilerArchMIPSLE, CompilerArchARMLE,
]