llvm.org GIT mirror llvm / 4576247
stub out a new X86 encoder, which can be tried with -enable-new-x86-encoder until its stable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95256 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
5 changed file(s) with 56 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2424 X86InstrInfo.cpp
2525 X86JITInfo.cpp
2626 X86MCAsmInfo.cpp
27 X86MCCodeEmitter.cpp
2728 X86RegisterInfo.cpp
2829 X86Subtarget.cpp
2930 X86TargetMachine.cpp
4949 JITCodeEmitter &JCE);
5050
5151 MCCodeEmitter *createHeinousX86MCCodeEmitter(const Target &, TargetMachine &TM);
52 MCCodeEmitter *createX86MCCodeEmitter(const Target &, TargetMachine &TM);
5253
5354 /// createX86EmitCodeToMemory - Returns a pass that converts a register
5455 /// allocated function into raw machine code in a dynamically
10981098 };
10991099 }
11001100
1101 #include "llvm/Support/CommandLine.h"
1102
1103 static cl::opt EnableNewEncoder("enable-new-x86-encoder",
1104 cl::ReallyHidden);
1105
1106
11011107 // Ok, now you can look.
1102 MCCodeEmitter *llvm::createHeinousX86MCCodeEmitter(const Target &,
1108 MCCodeEmitter *llvm::createHeinousX86MCCodeEmitter(const Target &T,
11031109 TargetMachine &TM) {
1110
1111 // FIXME: Remove the heinous one when the new one works.
1112 if (EnableNewEncoder)
1113 return createX86MCCodeEmitter(T, TM);
1114
11041115 return new X86MCCodeEmitter(static_cast(TM));
11051116 }
0 //===-- X86/X86MCCodeEmitter.cpp - Convert X86 code to machine code -------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the X86MCCodeEmitter class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #define DEBUG_TYPE "x86-emitter"
14 #include "X86.h"
15 #include "X86TargetMachine.h"
16 #include "llvm/MC/MCCodeEmitter.h"
17 using namespace llvm;
18
19 namespace {
20 class X86MCCodeEmitter : public MCCodeEmitter {
21 X86MCCodeEmitter(const X86MCCodeEmitter &); // DO NOT IMPLEMENT
22 void operator=(const X86MCCodeEmitter &); // DO NOT IMPLEMENT
23 X86TargetMachine &TM;
24 public:
25 X86MCCodeEmitter(X86TargetMachine &tm) : TM(tm) {
26 }
27
28 ~X86MCCodeEmitter() {}
29
30 void EncodeInstruction(const MCInst &MI, raw_ostream &OS) const {
31 }
32 };
33
34 } // end anonymous namespace
35
36
37 MCCodeEmitter *llvm::createX86MCCodeEmitter(const Target &,
38 TargetMachine &TM) {
39 return new X86MCCodeEmitter(static_cast(TM));
40 }
4747 RegisterAsmInfoFn B(TheX86_64Target, createMCAsmInfo);
4848
4949 // Register the code emitter.
50 // FIXME: Remove the heinous one when the new one works.
5051 TargetRegistry::RegisterCodeEmitter(TheX86_32Target,
5152 createHeinousX86MCCodeEmitter);
5253 TargetRegistry::RegisterCodeEmitter(TheX86_64Target,