mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-11 12:11:20 +00:00
Drop obsolete hook and change all usage to new interface
llvm-svn: 56572
This commit is contained in:
parent
ff79214785
commit
9e5d24042c
include/llvm/CodeGen
lib
CodeGen/AsmPrinter
Target
ARM/AsmPrinter
Alpha
CellSPU
IA64
Mips
PowerPC/AsmPrinter
Sparc
X86/AsmPrinter
@ -184,12 +184,6 @@ namespace llvm {
|
|||||||
unsigned AsmVariant,
|
unsigned AsmVariant,
|
||||||
const char *ExtraCode);
|
const char *ExtraCode);
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into. This defaults to 'TextSection'. This
|
|
||||||
/// should most likely be overridden by the target to put linkonce/weak
|
|
||||||
/// functions into special sections.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
|
|
||||||
/// SetupMachineFunction - This should be called when a new MachineFunction
|
/// SetupMachineFunction - This should be called when a new MachineFunction
|
||||||
/// is being processed from runOnMachineFunction.
|
/// is being processed from runOnMachineFunction.
|
||||||
void SetupMachineFunction(MachineFunction &MF);
|
void SetupMachineFunction(MachineFunction &MF);
|
||||||
|
@ -48,11 +48,6 @@ AsmPrinter::~AsmPrinter() {
|
|||||||
delete I->second;
|
delete I->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string AsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->getTextSection();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// SwitchToTextSection - Switch to the specified text section of the executable
|
/// SwitchToTextSection - Switch to the specified text section of the executable
|
||||||
/// if we are not already in it!
|
/// if we are not already in it!
|
||||||
///
|
///
|
||||||
@ -331,7 +326,7 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
|
|||||||
// function body itself, otherwise the label differences won't make sense.
|
// function body itself, otherwise the label differences won't make sense.
|
||||||
// We should also do if the section name is NULL or function is declared in
|
// We should also do if the section name is NULL or function is declared in
|
||||||
// discardable section.
|
// discardable section.
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
} else {
|
} else {
|
||||||
SwitchToDataSection(JumpTableDataSection);
|
SwitchToDataSection(JumpTableDataSection);
|
||||||
}
|
}
|
||||||
|
@ -130,10 +130,6 @@ namespace {
|
|||||||
bool doInitialization(Module &M);
|
bool doInitialization(Module &M);
|
||||||
bool doFinalization(Module &M);
|
bool doFinalization(Module &M);
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
|
|
||||||
/// EmitMachineConstantPoolValue - Print a machine constantpool value to
|
/// EmitMachineConstantPoolValue - Print a machine constantpool value to
|
||||||
/// the .s file.
|
/// the .s file.
|
||||||
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
|
||||||
@ -179,11 +175,6 @@ namespace {
|
|||||||
|
|
||||||
#include "ARMGenAsmWriter.inc"
|
#include "ARMGenAsmWriter.inc"
|
||||||
|
|
||||||
// Substitute old hook with new one temporary
|
|
||||||
std::string ARMAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printInstruction()
|
/// runOnMachineFunction - This uses the printInstruction()
|
||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
|
@ -149,7 +149,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
|
|
||||||
EmitAlignment(4, F);
|
EmitAlignment(4, F);
|
||||||
switch (F->getLinkage()) {
|
switch (F->getLinkage()) {
|
||||||
|
@ -297,9 +297,6 @@ namespace {
|
|||||||
SPUAsmPrinter::getAnalysisUsage(AU);
|
SPUAsmPrinter::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
};
|
};
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
@ -406,19 +403,6 @@ void SPUAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
printInstruction(MI);
|
printInstruction(MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string LinuxAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
switch (F.getLinkage()) {
|
|
||||||
default: assert(0 && "Unknown linkage type!");
|
|
||||||
case Function::ExternalLinkage:
|
|
||||||
case Function::InternalLinkage: return TAI->getTextSection();
|
|
||||||
case Function::WeakLinkage:
|
|
||||||
case Function::LinkOnceLinkage:
|
|
||||||
return ""; // Print nothing for the time being...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printMachineInstruction()
|
/// runOnMachineFunction - This uses the printMachineInstruction()
|
||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
@ -434,7 +418,7 @@ LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF)
|
|||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
|
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
EmitAlignment(3, F);
|
EmitAlignment(3, F);
|
||||||
|
|
||||||
switch (F->getLinkage()) {
|
switch (F->getLinkage()) {
|
||||||
|
@ -106,8 +106,6 @@ namespace {
|
|||||||
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
|
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getSectionForFunction(const Function &F) const;
|
|
||||||
|
|
||||||
void printMachineInstruction(const MachineInstr *MI);
|
void printMachineInstruction(const MachineInstr *MI);
|
||||||
void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
|
void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
|
||||||
void printModuleLevelGV(const GlobalVariable* GVar);
|
void printModuleLevelGV(const GlobalVariable* GVar);
|
||||||
@ -121,12 +119,6 @@ namespace {
|
|||||||
// Include the auto-generated portion of the assembly writer.
|
// Include the auto-generated portion of the assembly writer.
|
||||||
#include "IA64GenAsmWriter.inc"
|
#include "IA64GenAsmWriter.inc"
|
||||||
|
|
||||||
|
|
||||||
// Substitute old hook with new one temporary
|
|
||||||
std::string IA64AsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printMachineInstruction()
|
/// runOnMachineFunction - This uses the printMachineInstruction()
|
||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
@ -138,7 +130,7 @@ bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
EmitConstantPool(MF.getConstantPool());
|
EmitConstantPool(MF.getConstantPool());
|
||||||
|
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
|
|
||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
EmitAlignment(5);
|
EmitAlignment(5);
|
||||||
|
@ -59,7 +59,6 @@ namespace {
|
|||||||
return "Mips Assembly Printer";
|
return "Mips Assembly Printer";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
unsigned AsmVariant, const char *ExtraCode);
|
unsigned AsmVariant, const char *ExtraCode);
|
||||||
void printOperand(const MachineInstr *MI, int opNum);
|
void printOperand(const MachineInstr *MI, int opNum);
|
||||||
@ -219,11 +218,6 @@ emitCurrentABIString(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Substitute old hook with new one temporary
|
|
||||||
std::string MipsAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Emit the directives used by GAS on the start of functions
|
/// Emit the directives used by GAS on the start of functions
|
||||||
void MipsAsmPrinter::
|
void MipsAsmPrinter::
|
||||||
emitFunctionStart(MachineFunction &MF)
|
emitFunctionStart(MachineFunction &MF)
|
||||||
|
@ -315,9 +315,6 @@ namespace {
|
|||||||
PPCAsmPrinter::getAnalysisUsage(AU);
|
PPCAsmPrinter::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
void printModuleLevelGV(const GlobalVariable* GVar);
|
void printModuleLevelGV(const GlobalVariable* GVar);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -347,9 +344,6 @@ namespace {
|
|||||||
PPCAsmPrinter::getAnalysisUsage(AU);
|
PPCAsmPrinter::getAnalysisUsage(AU);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
void printModuleLevelGV(const GlobalVariable* GVar);
|
void printModuleLevelGV(const GlobalVariable* GVar);
|
||||||
};
|
};
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
@ -577,7 +571,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
|
|
||||||
switch (F->getLinkage()) {
|
switch (F->getLinkage()) {
|
||||||
default: assert(0 && "Unknown linkage type!");
|
default: assert(0 && "Unknown linkage type!");
|
||||||
@ -753,14 +747,6 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
|
|||||||
return AsmPrinter::doFinalization(M);
|
return AsmPrinter::doFinalization(M);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string PPCLinuxAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string PPCDarwinAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printMachineInstruction()
|
/// runOnMachineFunction - This uses the printMachineInstruction()
|
||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
@ -773,7 +759,7 @@ bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
|
|
||||||
switch (F->getLinkage()) {
|
switch (F->getLinkage()) {
|
||||||
default: assert(0 && "Unknown linkage type!");
|
default: assert(0 && "Unknown linkage type!");
|
||||||
|
@ -63,7 +63,6 @@ namespace {
|
|||||||
|
|
||||||
bool printInstruction(const MachineInstr *MI); // autogenerated.
|
bool printInstruction(const MachineInstr *MI); // autogenerated.
|
||||||
bool runOnMachineFunction(MachineFunction &F);
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
std::string getSectionForFunction(const Function &F) const;
|
|
||||||
bool doInitialization(Module &M);
|
bool doInitialization(Module &M);
|
||||||
bool doFinalization(Module &M);
|
bool doFinalization(Module &M);
|
||||||
};
|
};
|
||||||
@ -81,11 +80,6 @@ FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o,
|
|||||||
return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
|
return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Substitute old hook with new one temporary
|
|
||||||
std::string SparcAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printInstruction()
|
/// runOnMachineFunction - This uses the printInstruction()
|
||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
@ -105,7 +99,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Print out the label for the function.
|
// Print out the label for the function.
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
|
||||||
EmitAlignment(4, F);
|
EmitAlignment(4, F);
|
||||||
O << "\t.globl\t" << CurrentFnName << '\n';
|
O << "\t.globl\t" << CurrentFnName << '\n';
|
||||||
|
|
||||||
|
@ -146,11 +146,6 @@ void X86ATTAsmPrinter::decorateName(std::string &Name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Substitute old hook with new one temporary
|
|
||||||
std::string X86ATTAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
return TAI->SectionForGlobal(&F);
|
|
||||||
}
|
|
||||||
|
|
||||||
void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
|
void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
std::string SectionName = TAI->SectionForGlobal(F);
|
std::string SectionName = TAI->SectionForGlobal(F);
|
||||||
|
@ -124,10 +124,6 @@ struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
|
|||||||
|
|
||||||
bool runOnMachineFunction(MachineFunction &F);
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
|
|
||||||
void emitFunctionHeader(const MachineFunction &MF);
|
void emitFunctionHeader(const MachineFunction &MF);
|
||||||
|
|
||||||
// Necessary for Darwin to print out the apprioriate types of linker stubs
|
// Necessary for Darwin to print out the apprioriate types of linker stubs
|
||||||
|
@ -117,12 +117,6 @@ void X86IntelAsmPrinter::decorateName(std::string &Name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string X86IntelAsmPrinter::getSectionForFunction(const Function &F) const {
|
|
||||||
// Intel asm always emits functions to _text.
|
|
||||||
return "_text";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnMachineFunction - This uses the printMachineInstruction()
|
/// runOnMachineFunction - This uses the printMachineInstruction()
|
||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
@ -144,7 +138,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
decorateName(CurrentFnName, F);
|
decorateName(CurrentFnName, F);
|
||||||
|
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection("_text", F);
|
||||||
|
|
||||||
unsigned FnAlign = OptimizeForSize ? 1 : 4;
|
unsigned FnAlign = OptimizeForSize ? 1 : 4;
|
||||||
if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
|
if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
|
||||||
|
@ -131,10 +131,6 @@ struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
|
|||||||
|
|
||||||
void decorateName(std::string& Name, const GlobalValue* GV);
|
void decorateName(std::string& Name, const GlobalValue* GV);
|
||||||
|
|
||||||
/// getSectionForFunction - Return the section that we should emit the
|
|
||||||
/// specified function body into.
|
|
||||||
virtual std::string getSectionForFunction(const Function &F) const;
|
|
||||||
|
|
||||||
virtual void EmitString(const ConstantArray *CVA) const;
|
virtual void EmitString(const ConstantArray *CVA) const;
|
||||||
|
|
||||||
// Necessary for dllexport support
|
// Necessary for dllexport support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user