mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-24 21:25:41 +00:00
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
This commit is contained in:
parent
ce79a25980
commit
4576247928
@ -25,6 +25,7 @@ set(sources
|
||||
X86InstrInfo.cpp
|
||||
X86JITInfo.cpp
|
||||
X86MCAsmInfo.cpp
|
||||
X86MCCodeEmitter.cpp
|
||||
X86RegisterInfo.cpp
|
||||
X86Subtarget.cpp
|
||||
X86TargetMachine.cpp
|
||||
|
@ -50,6 +50,7 @@ FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
|
||||
JITCodeEmitter &JCE);
|
||||
|
||||
MCCodeEmitter *createHeinousX86MCCodeEmitter(const Target &, TargetMachine &TM);
|
||||
MCCodeEmitter *createX86MCCodeEmitter(const Target &, TargetMachine &TM);
|
||||
|
||||
/// createX86EmitCodeToMemory - Returns a pass that converts a register
|
||||
/// allocated function into raw machine code in a dynamically
|
||||
|
@ -1099,8 +1099,19 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
static cl::opt<bool> EnableNewEncoder("enable-new-x86-encoder",
|
||||
cl::ReallyHidden);
|
||||
|
||||
|
||||
// Ok, now you can look.
|
||||
MCCodeEmitter *llvm::createHeinousX86MCCodeEmitter(const Target &,
|
||||
MCCodeEmitter *llvm::createHeinousX86MCCodeEmitter(const Target &T,
|
||||
TargetMachine &TM) {
|
||||
|
||||
// FIXME: Remove the heinous one when the new one works.
|
||||
if (EnableNewEncoder)
|
||||
return createX86MCCodeEmitter(T, TM);
|
||||
|
||||
return new X86MCCodeEmitter(static_cast<X86TargetMachine&>(TM));
|
||||
}
|
||||
|
41
lib/Target/X86/X86MCCodeEmitter.cpp
Normal file
41
lib/Target/X86/X86MCCodeEmitter.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
//===-- X86/X86MCCodeEmitter.cpp - Convert X86 code to machine code -------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the X86MCCodeEmitter class.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define DEBUG_TYPE "x86-emitter"
|
||||
#include "X86.h"
|
||||
#include "X86TargetMachine.h"
|
||||
#include "llvm/MC/MCCodeEmitter.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
class X86MCCodeEmitter : public MCCodeEmitter {
|
||||
X86MCCodeEmitter(const X86MCCodeEmitter &); // DO NOT IMPLEMENT
|
||||
void operator=(const X86MCCodeEmitter &); // DO NOT IMPLEMENT
|
||||
X86TargetMachine &TM;
|
||||
public:
|
||||
X86MCCodeEmitter(X86TargetMachine &tm) : TM(tm) {
|
||||
}
|
||||
|
||||
~X86MCCodeEmitter() {}
|
||||
|
||||
void EncodeInstruction(const MCInst &MI, raw_ostream &OS) const {
|
||||
}
|
||||
};
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
MCCodeEmitter *llvm::createX86MCCodeEmitter(const Target &,
|
||||
TargetMachine &TM) {
|
||||
return new X86MCCodeEmitter(static_cast<X86TargetMachine&>(TM));
|
||||
}
|
@ -48,6 +48,7 @@ extern "C" void LLVMInitializeX86Target() {
|
||||
RegisterAsmInfoFn B(TheX86_64Target, createMCAsmInfo);
|
||||
|
||||
// Register the code emitter.
|
||||
// FIXME: Remove the heinous one when the new one works.
|
||||
TargetRegistry::RegisterCodeEmitter(TheX86_32Target,
|
||||
createHeinousX86MCCodeEmitter);
|
||||
TargetRegistry::RegisterCodeEmitter(TheX86_64Target,
|
||||
|
Loading…
x
Reference in New Issue
Block a user