use getSectionForFunction to decide which section to emit code into

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30738 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-10-05 02:47:13 +00:00
parent afbfdeddff
commit 6e79629dab

View File

@ -73,7 +73,7 @@ namespace {
/// using the given target machine description. This should work /// using the given target machine description. This should work
/// regardless of whether the function is in SSA form. /// regardless of whether the function is in SSA form.
/// ///
FunctionPass *llvm::createAlphaCodePrinterPass (std::ostream &o, FunctionPass *llvm::createAlphaCodePrinterPass(std::ostream &o,
TargetMachine &tm) { TargetMachine &tm) {
return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo()); return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo());
} }
@ -166,7 +166,8 @@ 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(".text", F); SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
EmitAlignment(4, F); EmitAlignment(4, F);
switch (F->getLinkage()) { switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!"); default: assert(0 && "Unknown linkage type!");