llvm.org GIT mirror llvm / 96bc217
get fancy: support basic block operands. Yay for jumps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84579 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
3 changed file(s) with 12 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
13101310 //===----------------------------------------------------------------------===//
13111311
13121312 void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
1313 ARMMCInstLower MCInstLowering(OutContext, *Mang, getFunctionNumber(), *MAI);
1313 ARMMCInstLower MCInstLowering(OutContext, *Mang, *this);
13141314 switch (MI->getOpcode()) {
13151315 default: break;
13161316 case TargetInstrInfo::DBG_LABEL:
1313
1414 #include "ARMMCInstLower.h"
1515 //#include "llvm/CodeGen/MachineModuleInfoImpls.h"
16 #include "llvm/CodeGen/MachineInstr.h"
16 #include "llvm/CodeGen/AsmPrinter.h"
17 #include "llvm/CodeGen/MachineBasicBlock.h"
1718 #include "llvm/MC/MCAsmInfo.h"
1819 #include "llvm/MC/MCContext.h"
1920 #include "llvm/MC/MCExpr.h"
5657 MCSymbol *ARMMCInstLower::
5758 GetJumpTableSymbol(const MachineOperand &MO) const {
5859 SmallString<256> Name;
59 raw_svector_ostream(Name) << MAI.getPrivateGlobalPrefix() << "JTI"
60 << CurFunctionNumber << '_' << MO.getIndex();
60 raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "JTI"
61 << Printer.getFunctionNumber() << '_' << MO.getIndex();
6162
6263 #if 0
6364 switch (MO.getTargetFlags()) {
7273 MCSymbol *ARMMCInstLower::
7374 GetConstantPoolIndexSymbol(const MachineOperand &MO) const {
7475 SmallString<256> Name;
75 raw_svector_ostream(Name) << MAI.getPrivateGlobalPrefix() << "CPI"
76 << CurFunctionNumber << '_' << MO.getIndex();
76 raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "CPI"
77 << Printer.getFunctionNumber() << '_' << MO.getIndex();
7778
7879 #if 0
7980 switch (MO.getTargetFlags()) {
124125 case MachineOperand::MO_Immediate:
125126 MCOp = MCOperand::CreateImm(MO.getImm());
126127 break;
127 #if 0
128128 case MachineOperand::MO_MachineBasicBlock:
129129 MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
130 AsmPrinter.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
130 Printer.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
131131 break;
132 #endif
133132 case MachineOperand::MO_GlobalAddress:
134133 MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
135134 break;
1212 #include "llvm/Support/Compiler.h"
1313
1414 namespace llvm {
15 class AsmPrinter;
1516 class MCAsmInfo;
1617 class MCContext;
1718 class MCInst;
2728 class VISIBILITY_HIDDEN ARMMCInstLower {
2829 MCContext &Ctx;
2930 Mangler &Mang;
30
31 const unsigned CurFunctionNumber;
32 const MCAsmInfo &MAI;
31 AsmPrinter &Printer;
3332
3433 //const ARMSubtarget &getSubtarget() const;
3534 public:
36 ARMMCInstLower(MCContext &ctx, Mangler &mang, unsigned FuncNum,
37 const MCAsmInfo &mai)
38 : Ctx(ctx), Mang(mang), CurFunctionNumber(FuncNum), MAI(mai) {}
35 ARMMCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer)
36 : Ctx(ctx), Mang(mang), Printer(printer) {}
3937
4038 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
4139