#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.
///
EmitConstantPool(MF.getConstantPool());
// Print out labels for the function.
- const Function* F = MF.getFunction();
+ const Function *F = MF.getFunction();
unsigned CC = F->getCallingConv();
// Populate function information map. Actually, We don't want to populate
// non-stdcall or non-fastcall functions' information right now.
- if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall) {
- FunctionInfoMap[F] = *(MF.getInfo<X86FunctionInfo>());
- }
+ if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall)
+ FunctionInfoMap[F] = *MF.getInfo<X86FunctionInfo>();
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:
//FALLS THROUGH
case Function::ExternalLinkage:
O << "\tpublic " << CurrentFnName << "\n";
- SwitchToTextSection("_text", F);
EmitAlignment(4);
break;
}
}
}
+ // Print out jump tables referenced by the function.
+ EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
+
O << CurrentFnName << "\tendp\n";
// We didn't modify anything.