diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-05 02:43:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-05 02:43:52 +0000 |
commit | afbfdeddffc673f367d63319c95bcd7e1a58c16c (patch) | |
tree | 2f574c607df92df16bb241408f4748ba1d6e42fa /lib/Target/X86/X86IntelAsmPrinter.cpp | |
parent | 52f0670470020d7672f9b0669c07324814e84a07 (diff) |
Implement getSectionForFunction, use it when printing function body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86IntelAsmPrinter.cpp')
-rwxr-xr-x | lib/Target/X86/X86IntelAsmPrinter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/X86/X86IntelAsmPrinter.cpp b/lib/Target/X86/X86IntelAsmPrinter.cpp index 705488a6c2..4e833bdd3d 100755 --- a/lib/Target/X86/X86IntelAsmPrinter.cpp +++ b/lib/Target/X86/X86IntelAsmPrinter.cpp @@ -25,6 +25,11 @@ #include "llvm/Target/TargetOptions.h" using namespace llvm; +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. /// @@ -46,10 +51,11 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) { X86SharedAsmPrinter::decorateName(CurrentFnName, F); + SwitchToTextSection(getSectionForFunction(*F).c_str(), F); + switch (F->getLinkage()) { default: assert(0 && "Unsupported linkage type!"); case Function::InternalLinkage: - SwitchToTextSection("_text", F); EmitAlignment(4); break; case Function::DLLExportLinkage: @@ -57,7 +63,6 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) { //FALLS THROUGH case Function::ExternalLinkage: O << "\tpublic " << CurrentFnName << "\n"; - SwitchToTextSection("_text", F); EmitAlignment(4); break; } |