mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user