mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
Remove old style hacks to register AsmPrinter into TargetMachine.
- No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0df5c8e3f1
commit
f05522974b
@ -45,9 +45,6 @@ static RegisterTarget<ThumbTargetMachine> Y(TheThumbTarget, "thumb", "Thumb");
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeARMTarget() { }
|
||||
|
||||
// No assembler printer by default
|
||||
ARMBaseTargetMachine::AsmPrinterCtorFn ARMBaseTargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
/// TargetMachine ctor - Create an ARM architecture model.
|
||||
///
|
||||
ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T,
|
||||
@ -136,11 +133,10 @@ bool ARMBaseTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
// Output assembly language.
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -38,14 +38,6 @@ private:
|
||||
InstrItineraryData InstrItins;
|
||||
Reloc::Model DefRelocModel; // Reloc model before it's overridden.
|
||||
|
||||
protected:
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
ARMBaseTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool isThumb);
|
||||
@ -57,10 +49,6 @@ public:
|
||||
return InstrItins;
|
||||
}
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// Pass Pipeline Configuration
|
||||
|
@ -1293,14 +1293,6 @@ FunctionPass *llvm::createARMCodePrinterPass(formatted_raw_ostream &o,
|
||||
return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
ARMBaseTargetMachine::registerAsmPrinter(createARMCodePrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeARMAsmPrinter() {
|
||||
extern Target TheARMTarget, TheThumbTarget;
|
||||
|
@ -26,9 +26,6 @@ extern Target TheAlphaTarget;
|
||||
static RegisterTarget<AlphaTargetMachine> X(TheAlphaTarget, "alpha",
|
||||
"Alpha [experimental]");
|
||||
|
||||
// No assembler printer by default
|
||||
AlphaTargetMachine::AsmPrinterCtorFn AlphaTargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeAlphaTarget() { }
|
||||
|
||||
@ -68,43 +65,34 @@ bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
// Output assembly language.
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||
PM.add(createAlphaCodeEmitterPass(*this, MCE));
|
||||
if (DumpAsm) {
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(ferrs(), *this, true));
|
||||
}
|
||||
if (DumpAsm)
|
||||
addAssemblyEmitter(PM, OptLevel, true, ferrs());
|
||||
return false;
|
||||
}
|
||||
bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool DumpAsm, JITCodeEmitter &JCE) {
|
||||
PM.add(createAlphaJITCodeEmitterPass(*this, JCE));
|
||||
if (DumpAsm) {
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(ferrs(), *this, true));
|
||||
}
|
||||
if (DumpAsm)
|
||||
addAssemblyEmitter(PM, OptLevel, true, ferrs());
|
||||
return false;
|
||||
}
|
||||
bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool DumpAsm, ObjectCodeEmitter &OCE) {
|
||||
PM.add(createAlphaObjectCodeEmitterPass(*this, OCE));
|
||||
if (DumpAsm) {
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(ferrs(), *this, true));
|
||||
}
|
||||
if (DumpAsm)
|
||||
addAssemblyEmitter(PM, OptLevel, true, ferrs());
|
||||
return false;
|
||||
}
|
||||
bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM,
|
||||
|
@ -37,13 +37,6 @@ class AlphaTargetMachine : public LLVMTargetMachine {
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
AlphaTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
@ -85,10 +78,6 @@ public:
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool DumpAsm,
|
||||
ObjectCodeEmitter &OCE);
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -293,14 +293,6 @@ bool AlphaAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
AlphaTargetMachine::registerAsmPrinter(createAlphaCodePrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeAlphaAsmPrinter() {
|
||||
extern Target TheAlphaTarget;
|
||||
|
@ -605,14 +605,6 @@ FunctionPass *llvm::createSPUAsmPrinterPass(formatted_raw_ostream &o,
|
||||
return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
SPUTargetMachine::registerAsmPrinter(createSPUAsmPrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeCellSPUAsmPrinter() {
|
||||
extern Target TheCellSPUTarget;
|
||||
|
@ -30,9 +30,6 @@ namespace {
|
||||
CELLSPU(TheCellSPUTarget, "cellspu", "STI CBEA Cell SPU [experimental]");
|
||||
}
|
||||
|
||||
// No assembler printer by default
|
||||
SPUTargetMachine::AsmPrinterCtorFn SPUTargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeCellSPUTarget() { }
|
||||
|
||||
@ -80,9 +77,9 @@ bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
// Output assembly language.
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
@ -39,13 +39,6 @@ class SPUTargetMachine : public LLVMTargetMachine {
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
SPUTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
@ -89,10 +82,6 @@ public:
|
||||
virtual bool addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose, formatted_raw_ostream &Out);
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -375,15 +375,6 @@ FunctionPass *llvm::createIA64CodePrinterPass(formatted_raw_ostream &o,
|
||||
return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
IA64TargetMachine::registerAsmPrinter(createIA64CodePrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeIA64AsmPrinter() {
|
||||
extern Target TheIA64Target;
|
||||
|
@ -24,9 +24,6 @@ extern Target TheIA64Target;
|
||||
static RegisterTarget<IA64TargetMachine> X(TheIA64Target, "ia64",
|
||||
"IA-64 (Itanium) [experimental]");
|
||||
|
||||
// No assembler printer by default
|
||||
IA64TargetMachine::AsmPrinterCtorFn IA64TargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeIA64Target() { }
|
||||
|
||||
@ -65,10 +62,9 @@ bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
// Output assembly language.
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -34,13 +34,6 @@ class IA64TargetMachine : public LLVMTargetMachine {
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
IA64TargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
@ -61,10 +54,6 @@ public:
|
||||
virtual bool addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose, formatted_raw_ostream &Out);
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
};
|
||||
} // End llvm namespace
|
||||
|
||||
|
@ -576,14 +576,6 @@ doFinalization(Module &M)
|
||||
return AsmPrinter::doFinalization(M);
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
MipsTargetMachine::registerAsmPrinter(createMipsCodePrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeMipsAsmPrinter() {
|
||||
extern Target TheMipsTarget;
|
||||
|
@ -35,9 +35,6 @@ extern Target TheMipselTarget;
|
||||
static RegisterTarget<MipselTargetMachine> Y(TheMipselTarget, "mipsel",
|
||||
"Mipsel");
|
||||
|
||||
MipsTargetMachine::AsmPrinterCtorFn MipsTargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeMipsTarget() { }
|
||||
|
||||
@ -103,8 +100,9 @@ addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
|
||||
bool MipsTargetMachine::
|
||||
addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
|
||||
bool Verbose, formatted_raw_ostream &Out) {
|
||||
// Output assembly language.
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
@ -33,23 +33,11 @@ namespace llvm {
|
||||
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
protected:
|
||||
// To avoid having target depend on the asmprinter stuff libraries,
|
||||
// asmprinter set this functions to ctor pointer at startup time if they are
|
||||
// linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
MipsTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool isLittle);
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
|
||||
virtual const MipsInstrInfo *getInstrInfo() const
|
||||
{ return &InstrInfo; }
|
||||
virtual const TargetFrameInfo *getFrameInfo() const
|
||||
|
@ -1092,14 +1092,6 @@ FunctionPass *llvm::createPPCAsmPrinterPass(formatted_raw_ostream &o,
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
PPCTargetMachine::registerAsmPrinter(createPPCAsmPrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
extern "C" int PowerPCAsmPrinterForceLink;
|
||||
int PowerPCAsmPrinterForceLink = 0;
|
||||
|
||||
|
@ -41,9 +41,6 @@ Y(ThePPC64Target, "ppc64", "PowerPC 64");
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializePowerPCTarget() { }
|
||||
|
||||
// No assembler printer by default
|
||||
PPCTargetMachine::AsmPrinterCtorFn PPCTargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
|
||||
if (Subtarget.isDarwin())
|
||||
return new PPCDarwinTargetAsmInfo(*this);
|
||||
@ -105,10 +102,10 @@ bool PPCTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -42,13 +42,6 @@ class PPCTargetMachine : public LLVMTargetMachine {
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &m,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
PPCTargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool is64Bit);
|
||||
@ -72,10 +65,6 @@ public:
|
||||
return &MachOWriterInfo;
|
||||
}
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
|
||||
// Pass Pipeline Configuration
|
||||
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
||||
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
||||
|
@ -351,14 +351,6 @@ bool SparcAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
SparcTargetMachine::registerAsmPrinter(createSparcCodePrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeSparcAsmPrinter() {
|
||||
extern Target TheSparcTarget;
|
||||
|
@ -22,10 +22,6 @@ using namespace llvm;
|
||||
extern Target TheSparcTarget;
|
||||
static RegisterTarget<SparcTargetMachine> X(TheSparcTarget, "sparc", "SPARC");
|
||||
|
||||
// No assembler printer by default
|
||||
SparcTargetMachine::AsmPrinterCtorFn SparcTargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
|
||||
// Force static initialization.
|
||||
extern "C" void LLVMInitializeSparcTarget() { }
|
||||
|
||||
@ -64,9 +60,9 @@ bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
// Output assembly language.
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
@ -35,13 +35,6 @@ class SparcTargetMachine : public LLVMTargetMachine {
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
SparcTargetMachine(const Target &T, const Module &M, const std::string &FS);
|
||||
|
||||
@ -62,10 +55,6 @@ public:
|
||||
virtual bool addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose, formatted_raw_ostream &Out);
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -34,14 +34,6 @@ FunctionPass *llvm::createX86CodePrinterPass(formatted_raw_ostream &o,
|
||||
return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
|
||||
}
|
||||
|
||||
namespace {
|
||||
static struct Register {
|
||||
Register() {
|
||||
X86TargetMachine::registerAsmPrinter(createX86CodePrinterPass);
|
||||
}
|
||||
} Registrator;
|
||||
}
|
||||
|
||||
extern "C" int X86AsmPrinterForceLink;
|
||||
int X86AsmPrinterForceLink = 0;
|
||||
|
||||
|
@ -44,9 +44,6 @@ extern "C" void LLVMInitializeX86Target() {
|
||||
|
||||
}
|
||||
|
||||
// No assembler printer by default
|
||||
X86TargetMachine::AsmPrinterCtorFn X86TargetMachine::AsmPrinterCtor = 0;
|
||||
|
||||
const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const {
|
||||
if (Subtarget.isFlavorIntel())
|
||||
return new X86WinTargetAsmInfo(*this);
|
||||
@ -188,9 +185,10 @@ bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
bool Verbose,
|
||||
formatted_raw_ostream &Out) {
|
||||
assert(AsmPrinterCtor && "AsmPrinter was not linked in");
|
||||
if (AsmPrinterCtor)
|
||||
PM.add(AsmPrinterCtor(Out, *this, Verbose));
|
||||
FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, Verbose);
|
||||
if (!Printer)
|
||||
llvm_report_error("unable to create assembly printer");
|
||||
PM.add(Printer);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -41,13 +41,6 @@ class X86TargetMachine : public LLVMTargetMachine {
|
||||
protected:
|
||||
virtual const TargetAsmInfo *createTargetAsmInfo() const;
|
||||
|
||||
// To avoid having target depend on the asmprinter stuff libraries, asmprinter
|
||||
// set this functions to ctor pointer at startup time if they are linked in.
|
||||
typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
|
||||
TargetMachine &tm,
|
||||
bool verbose);
|
||||
static AsmPrinterCtorFn AsmPrinterCtor;
|
||||
|
||||
public:
|
||||
X86TargetMachine(const Target &T, const Module &M, const std::string &FS,
|
||||
bool is64Bit);
|
||||
@ -67,10 +60,6 @@ public:
|
||||
return Subtarget.isTargetELF() ? &ELFWriterInfo : 0;
|
||||
}
|
||||
|
||||
static void registerAsmPrinter(AsmPrinterCtorFn F) {
|
||||
AsmPrinterCtor = F;
|
||||
}
|
||||
|
||||
// Set up the pass pipeline.
|
||||
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
||||
virtual bool addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user