use getSectionForFunction to decide which section to emit code into
authorChris Lattner <sabre@nondot.org>
Thu, 5 Oct 2006 02:47:13 +0000 (02:47 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 5 Oct 2006 02:47:13 +0000 (02:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30738 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaAsmPrinter.cpp

index 92d6c25809ee7fec825af627daa52d143aa0c280..265f8ae4a21e660be2ddc606c3bf95a76eb233c6 100644 (file)
@@ -58,7 +58,7 @@ namespace {
     bool runOnMachineFunction(MachineFunction &F);
     bool doInitialization(Module &M);
     bool doFinalization(Module &M);
-
+    
     bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
                          unsigned AsmVariant, const char *ExtraCode);
     bool PrintAsmMemoryOperand(const MachineInstr *MI, 
@@ -73,8 +73,8 @@ namespace {
 /// using the given target machine description.  This should work
 /// regardless of whether the function is in SSA form.
 ///
-FunctionPass *llvm::createAlphaCodePrinterPass (std::ostream &o,
-                                                  TargetMachine &tm) {
+FunctionPass *llvm::createAlphaCodePrinterPass(std::ostream &o,
+                                               TargetMachine &tm) {
   return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo());
 }
 
@@ -166,7 +166,8 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 
   // Print out labels for the function.
   const Function *F = MF.getFunction();
-  SwitchToTextSection(".text", F);
+  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  
   EmitAlignment(4, F);
   switch (F->getLinkage()) {
   default: assert(0 && "Unknown linkage type!");