llvm.org GIT mirror llvm / 00cb3fe
wire up 64-bit MCCodeEmitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95438 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
3 changed file(s) with 17 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
4949 JITCodeEmitter &JCE);
5050
5151 MCCodeEmitter *createHeinousX86MCCodeEmitter(const Target &, TargetMachine &TM);
52 MCCodeEmitter *createX86MCCodeEmitter(const Target &, TargetMachine &TM);
52 MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM);
53 MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM);
5354
5455 /// createX86EmitCodeToMemory - Returns a pass that converts a register
5556 /// allocated function into raw machine code in a dynamically
11161116 TargetMachine &TM) {
11171117
11181118 // FIXME: Remove the heinous one when the new one works.
1119 if (EnableNewEncoder)
1120 return createX86MCCodeEmitter(T, TM);
1119 if (EnableNewEncoder) {
1120 if (TM.getTargetData()->getPointerSize() == 4)
1121 return createX86_32MCCodeEmitter(T, TM);
1122 return createX86_64MCCodeEmitter(T, TM);
1123 }
11211124
11221125 return new X86MCCodeEmitter(static_cast(TM));
11231126 }
2626 const TargetInstrInfo &TII;
2727 bool Is64BitMode;
2828 public:
29 X86MCCodeEmitter(TargetMachine &tm)
29 X86MCCodeEmitter(TargetMachine &tm, bool is64Bit)
3030 : TM(tm), TII(*TM.getInstrInfo()) {
31 // FIXME: Get this from the right place.
32 Is64BitMode = false;
31 Is64BitMode = is64Bit;
3332 }
3433
3534 ~X86MCCodeEmitter() {}
8281 } // end anonymous namespace
8382
8483
85 MCCodeEmitter *llvm::createX86MCCodeEmitter(const Target &,
86 TargetMachine &TM) {
87 return new X86MCCodeEmitter(TM);
84 MCCodeEmitter *llvm::createX86_32MCCodeEmitter(const Target &,
85 TargetMachine &TM) {
86 return new X86MCCodeEmitter(TM, false);
87 }
88
89 MCCodeEmitter *llvm::createX86_64MCCodeEmitter(const Target &,
90 TargetMachine &TM) {
91 return new X86MCCodeEmitter(TM, true);
8892 }
8993
9094