unsigned AsmVariant,
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
/// is being processed from runOnMachineFunction.
void SetupMachineFunction(MachineFunction &MF);
E = GCMetadataPrinters.end(); I != E; ++I)
delete I->second;
}
-
-std::string AsmPrinter::getSectionForFunction(const Function &F) const {
- return TAI->getTextSection();
-}
-
/// SwitchToTextSection - Switch to the specified text section of the executable
/// if we are not already in it!
// 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
// discardable section.
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
} else {
SwitchToDataSection(JumpTableDataSection);
}
bool doInitialization(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
/// the .s file.
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
#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()
/// method to print assembly for each instruction.
///
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
EmitAlignment(4, F);
switch (F->getLinkage()) {
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
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()
/// method to print assembly for each instruction.
///
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
EmitAlignment(3, F);
switch (F->getLinkage()) {
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
}
- std::string getSectionForFunction(const Function &F) const;
-
void printMachineInstruction(const MachineInstr *MI);
void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
void printModuleLevelGV(const GlobalVariable* GVar);
// Include the auto-generated portion of the assembly writer.
#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()
/// method to print assembly for each instruction.
///
EmitConstantPool(MF.getConstantPool());
const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
// Print out labels for the function.
EmitAlignment(5);
return "Mips Assembly Printer";
}
- virtual std::string getSectionForFunction(const Function &F) const;
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
void printOperand(const MachineInstr *MI, int opNum);
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
void MipsAsmPrinter::
emitFunctionStart(MachineFunction &MF)
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);
};
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);
};
} // end of anonymous namespace
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
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()
/// method to print assembly for each instruction.
///
// Print out labels for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
bool printInstruction(const MachineInstr *MI); // autogenerated.
bool runOnMachineFunction(MachineFunction &F);
- std::string getSectionForFunction(const Function &F) const;
bool doInitialization(Module &M);
bool doFinalization(Module &M);
};
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()
/// method to print assembly for each instruction.
///
// Print out the label for the function.
const Function *F = MF.getFunction();
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
EmitAlignment(4, F);
O << "\t.globl\t" << CurrentFnName << '\n';
}
}
-// 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) {
const Function *F = MF.getFunction();
std::string SectionName = TAI->SectionForGlobal(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);
// Necessary for Darwin to print out the apprioriate types of linker stubs
}
}
-
-std::string X86IntelAsmPrinter::getSectionForFunction(const Function &F) const {
- // Intel asm always emits functions to _text.
- return "_text";
-}
-
/// runOnMachineFunction - This uses the printMachineInstruction()
/// method to print assembly for each instruction.
///
decorateName(CurrentFnName, F);
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+ SwitchToTextSection("_text", F);
unsigned FnAlign = OptimizeForSize ? 1 : 4;
if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
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;
// Necessary for dllexport support