First effort to revive BasicBlock and Function classes and
[jitcs.git] / include / jitcs_machine_x86_64.h
blob7f10a43166015471fba9ec111d8577ffa6061ef5
1 //===-- jitcs_machine_x86_64.h - Machine info -------------------*- C++ -*-===//
2 //
3 //===----------------------------------------------------------------------===//
5 #ifndef _JITCS_MACHINE_X86_64_H_
6 #define _JITCS_MACHINE_X86_64_H_
8 #include "jitcs_adt_ref.h"
9 #include "jitcs_base.h"
10 #include "jitcs_dumper.h"
11 #include "jitcs_machine.h"
12 #include "jitcs_x86_64.h"
14 namespace jitcs {
15 struct Instruction;
16 class CallingConvention;
17 class Function;
19 class X86_64MachineInfo : public MachineInfo {
20 public:
21 enum ABIEnum { ABI_Win, ABI_Posix };
22 public:
23 X86_64MachineInfo(ABIEnum);
24 private:
25 X86_64MachineInfo() = delete;
26 X86_64MachineInfo(const X86_64MachineInfo&) = delete;
27 X86_64MachineInfo& operator =(const X86_64MachineInfo&) = delete;
28 public:
29 //static std::string GetInsName(InsId id);
30 //static std::string GetRegName(RegId r);
31 //static std::string GetRegClassName(RegClassId r);
32 //static void dump(IDumper&, Ref<Instruction>, const Function&);
33 virtual std::shared_ptr<const CallingConvention>
34 getCC(FTSubType, Slice<FTTypeId>, Slice<FTTypeId>);
36 class X86_64WinMachineInfo : public X86_64MachineInfo {
37 public:
38 X86_64WinMachineInfo() : X86_64MachineInfo(ABI_Win) {}
39 private:
40 X86_64WinMachineInfo(const X86_64WinMachineInfo&) = delete;
41 X86_64WinMachineInfo& operator =(const X86_64WinMachineInfo&) = delete;
43 class X86_64PosixMachineInfo : public X86_64MachineInfo {
44 public:
45 X86_64PosixMachineInfo() : X86_64MachineInfo(ABI_Posix) {}
46 private:
47 X86_64PosixMachineInfo(const X86_64PosixMachineInfo&) = delete;
48 X86_64PosixMachineInfo& operator =(const X86_64PosixMachineInfo&) = delete;
51 class X86_64MachineDumper : public IMachineDumper {
52 public:
53 X86_64MachineDumper(std::unique_ptr<IDumper> &&);
54 private:
55 X86_64MachineDumper() = delete;
56 X86_64MachineDumper(const X86_64MachineDumper&) = delete;
57 X86_64MachineDumper& operator =(const X86_64MachineDumper&) = delete;
58 public:
59 /*[[override]]*/ virtual void write(Ref<Instruction>);
60 /*[[override]]*/ virtual void write(Ref<VirtualRegister>);
63 } // end namespace jitcs
65 #endif
66 // _JITCS_MACHINE_X86_64_H_