forked from OSchip/llvm-project
Revert "Add a TargetMachine local MCRegisterInfo and MCInstrInfo so that"
Committed too early. This reverts commit r232666. llvm-svn: 232667
This commit is contained in:
parent
4e80e18e78
commit
5ac4e120be
|
@ -30,8 +30,6 @@ class Mangler;
|
||||||
class MCAsmInfo;
|
class MCAsmInfo;
|
||||||
class MCCodeGenInfo;
|
class MCCodeGenInfo;
|
||||||
class MCContext;
|
class MCContext;
|
||||||
class MCInstrInfo;
|
|
||||||
class MCRegisterInfo;
|
|
||||||
class MCSymbol;
|
class MCSymbol;
|
||||||
class Target;
|
class Target;
|
||||||
class DataLayout;
|
class DataLayout;
|
||||||
|
@ -88,8 +86,6 @@ protected: // Can only create subclasses.
|
||||||
/// AsmInfo - Contains target specific asm information.
|
/// AsmInfo - Contains target specific asm information.
|
||||||
///
|
///
|
||||||
const MCAsmInfo *AsmInfo;
|
const MCAsmInfo *AsmInfo;
|
||||||
const MCRegisterInfo *MRI;
|
|
||||||
const MCInstrInfo *MII;
|
|
||||||
|
|
||||||
unsigned RequireStructuredCFG : 1;
|
unsigned RequireStructuredCFG : 1;
|
||||||
|
|
||||||
|
@ -138,8 +134,6 @@ public:
|
||||||
/// getMCAsmInfo - Return target specific asm information.
|
/// getMCAsmInfo - Return target specific asm information.
|
||||||
///
|
///
|
||||||
const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
|
const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
|
||||||
const MCRegisterInfo *getMCRegisterInfo() const { return MRI; }
|
|
||||||
const MCInstrInfo *getMCInstrInfo() const { return MII; }
|
|
||||||
|
|
||||||
/// getIntrinsicInfo - If intrinsic information is available, return it. If
|
/// getIntrinsicInfo - If intrinsic information is available, return it. If
|
||||||
/// not, return null.
|
/// not, return null.
|
||||||
|
|
|
@ -47,10 +47,8 @@ EnableFastISelOption("fast-isel", cl::Hidden,
|
||||||
cl::desc("Enable the \"fast\" instruction selector"));
|
cl::desc("Enable the \"fast\" instruction selector"));
|
||||||
|
|
||||||
void LLVMTargetMachine::initAsmInfo() {
|
void LLVMTargetMachine::initAsmInfo() {
|
||||||
MRI = TheTarget.createMCRegInfo(getTargetTriple());
|
MCAsmInfo *TmpAsmInfo = TheTarget.createMCAsmInfo(
|
||||||
MII = TheTarget.createMCInstrInfo();
|
*getSubtargetImpl()->getRegisterInfo(), getTargetTriple());
|
||||||
|
|
||||||
MCAsmInfo *TmpAsmInfo = TheTarget.createMCAsmInfo(*MRI, getTargetTriple());
|
|
||||||
// TargetSelect.h moved to a different directory between LLVM 2.9 and 3.0,
|
// TargetSelect.h moved to a different directory between LLVM 2.9 and 3.0,
|
||||||
// and if the old one gets included then MCAsmInfo will be NULL and
|
// and if the old one gets included then MCAsmInfo will be NULL and
|
||||||
// we'll crash later.
|
// we'll crash later.
|
||||||
|
@ -166,15 +164,15 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
||||||
|
|
||||||
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
||||||
const MCAsmInfo &MAI = *getMCAsmInfo();
|
const MCAsmInfo &MAI = *getMCAsmInfo();
|
||||||
const MCRegisterInfo &MRI = *getMCRegisterInfo();
|
const MCRegisterInfo &MRI = *getSubtargetImpl()->getRegisterInfo();
|
||||||
const MCInstrInfo &MII = *getMCInstrInfo();
|
const MCInstrInfo &MII = *getSubtargetImpl()->getInstrInfo();
|
||||||
|
|
||||||
std::unique_ptr<MCStreamer> AsmStreamer;
|
std::unique_ptr<MCStreamer> AsmStreamer;
|
||||||
|
|
||||||
switch (FileType) {
|
switch (FileType) {
|
||||||
case CGFT_AssemblyFile: {
|
case CGFT_AssemblyFile: {
|
||||||
MCInstPrinter *InstPrinter = getTarget().createMCInstPrinter(
|
MCInstPrinter *InstPrinter =
|
||||||
MAI.getAssemblerDialect(), MAI, MII, MRI, STI);
|
getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI,
|
||||||
|
MII, MRI, STI);
|
||||||
|
|
||||||
// Create a code emitter if asked to show the encoding.
|
// Create a code emitter if asked to show the encoding.
|
||||||
MCCodeEmitter *MCE = nullptr;
|
MCCodeEmitter *MCE = nullptr;
|
||||||
|
@ -241,7 +239,8 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
|
||||||
|
|
||||||
// Create the code emitter for the target if it exists. If not, .o file
|
// Create the code emitter for the target if it exists. If not, .o file
|
||||||
// emission fails.
|
// emission fails.
|
||||||
const MCRegisterInfo &MRI = *getMCRegisterInfo();
|
const MCRegisterInfo &MRI = *getSubtargetImpl()->getRegisterInfo();
|
||||||
|
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
||||||
MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(
|
MCCodeEmitter *MCE = getTarget().createMCCodeEmitter(
|
||||||
*getSubtargetImpl()->getInstrInfo(), MRI, *Ctx);
|
*getSubtargetImpl()->getInstrInfo(), MRI, *Ctx);
|
||||||
MCAsmBackend *MAB = getTarget().createMCAsmBackend(MRI, getTargetTriple(),
|
MCAsmBackend *MAB = getTarget().createMCAsmBackend(MRI, getTargetTriple(),
|
||||||
|
@ -250,7 +249,6 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Triple T(getTargetTriple());
|
Triple T(getTargetTriple());
|
||||||
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
|
||||||
std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer(
|
std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer(
|
||||||
T, *Ctx, *MAB, Out, MCE, STI, Options.MCOptions.MCRelaxAll));
|
T, *Ctx, *MAB, Out, MCE, STI, Options.MCOptions.MCRelaxAll));
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,12 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString,
|
||||||
StringRef TT, StringRef CPU, StringRef FS,
|
StringRef TT, StringRef CPU, StringRef FS,
|
||||||
const TargetOptions &Options)
|
const TargetOptions &Options)
|
||||||
: TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),
|
: TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),
|
||||||
TargetFS(FS), CodeGenInfo(nullptr), AsmInfo(nullptr), MII(nullptr),
|
TargetFS(FS), CodeGenInfo(nullptr), AsmInfo(nullptr),
|
||||||
MRI(nullptr), RequireStructuredCFG(false), Options(Options) {}
|
RequireStructuredCFG(false), Options(Options) {}
|
||||||
|
|
||||||
TargetMachine::~TargetMachine() {
|
TargetMachine::~TargetMachine() {
|
||||||
delete CodeGenInfo;
|
delete CodeGenInfo;
|
||||||
delete AsmInfo;
|
delete AsmInfo;
|
||||||
delete MII;
|
|
||||||
delete MRI;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Reset the target options based on the function's attributes.
|
/// \brief Reset the target options based on the function's attributes.
|
||||||
|
|
Loading…
Reference in New Issue