/// method to print assembly for each instruction.
///
bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
- this->MF = &MF;
-
AFI = MF.getInfo<ARMFunctionInfo>();
MCP = MF.getConstantPool();
printVisibility(CurrentFnSym, F->getVisibility());
- unsigned FnAlign = 1 << MF.getAlignment(); // MF alignment is log2.
+ EmitAlignment(1 << MF.getAlignment(), F);
if (AFI->isThumbFunction()) {
- EmitAlignment(FnAlign, F, AFI->getAlign());
O << "\t.code\t16\n";
O << "\t.thumb_func";
if (Subtarget->isTargetDarwin())
O << "\t" << *CurrentFnSym;
O << "\n";
- } else {
- EmitAlignment(FnAlign, F);
}
O << *CurrentFnSym << ":\n";
break;
}
case MachineOperand::MO_MachineBasicBlock:
- O << *GetMBBSymbol(MO.getMBB()->getNumber());
+ O << *MO.getMBB()->getSymbol(OutContext);
return;
case MachineOperand::MO_GlobalAddress: {
bool isCallOp = Modifier && !strcmp(Modifier, "call");
const char *JTEntryDirective = MAI->getData32bitsDirective();
- const MachineFunction *MF = MI->getParent()->getParent();
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
- bool UseSet= MAI->getSetDirective() && TM.getRelocationModel() == Reloc::PIC_;
+ bool UseSet= MAI->hasSetDirective() && TM.getRelocationModel() == Reloc::PIC_;
SmallPtrSet<MachineBasicBlock*, 8> JTSets;
for (unsigned i = 0, e = JTBBs.size(); i != e; ++i) {
MachineBasicBlock *MBB = JTBBs[i];
bool isNew = JTSets.insert(MBB);
if (UseSet && isNew) {
- O << MAI->getSetDirective() << ' '
+ O << "\t.set\t"
<< *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB) << ','
- << *GetMBBSymbol(MBB->getNumber()) << '-' << *JTISymbol << '\n';
+ << *MBB->getSymbol(OutContext) << '-' << *JTISymbol << '\n';
}
O << JTEntryDirective << ' ';
if (UseSet)
O << *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB);
else if (TM.getRelocationModel() == Reloc::PIC_)
- O << *GetMBBSymbol(MBB->getNumber()) << '-' << *JTISymbol;
+ O << *MBB->getSymbol(OutContext) << '-' << *JTISymbol;
else
- O << *GetMBBSymbol(MBB->getNumber());
+ O << *MBB->getSymbol(OutContext);
if (i != e-1)
O << '\n';
MCSymbol *JTISymbol = GetARMJTIPICJumpTableLabel2(JTI, MO2.getImm());
OutStreamer.EmitLabel(JTISymbol);
- const MachineFunction *MF = MI->getParent()->getParent();
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
O << MAI->getData16bitsDirective();
if (ByteOffset || HalfWordOffset)
- O << '(' << *GetMBBSymbol(MBB->getNumber()) << "-" << *JTISymbol << ")/2";
+ O << '(' << *MBB->getSymbol(OutContext) << "-" << *JTISymbol << ")/2";
else
- O << "\tb.w " << *GetMBBSymbol(MBB->getNumber());
+ O << "\tb.w " << *MBB->getSymbol(OutContext);
if (i != e-1)
O << '\n';