llvm.org GIT mirror llvm / fc16a89
trailing whitespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113768 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Grosbach 9 years ago
2 changed file(s) with 17 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
3333
3434 MachineModuleInfoMachO &ARMMCInstLower::getMachOMMI() const {
3535 assert(getSubtarget().isTargetDarwin() &&"Can only get MachO info on darwin");
36 return AsmPrinter.MMI->getObjFileInfo();
36 return AsmPrinter.MMI->getObjFileInfo();
3737 }
3838 #endif
3939
4444 default: assert(0 && "Unknown target flag on GV operand");
4545 case 0: break;
4646 }
47
47
4848 return Printer.Mang->getSymbol(MO.getGlobal());
4949 }
5050
5555 default: assert(0 && "Unknown target flag on GV operand");
5656 case 0: break;
5757 }
58
58
5959 return Printer.GetExternalSymbolSymbol(MO.getSymbolName());
6060 }
6161
6666 SmallString<256> Name;
6767 raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "JTI"
6868 << Printer.getFunctionNumber() << '_' << MO.getIndex();
69
69
7070 #if 0
7171 switch (MO.getTargetFlags()) {
7272 default: llvm_unreachable("Unknown target flag on GV operand");
7373 }
7474 #endif
75
75
7676 // Create a symbol for the name.
7777 return Ctx.GetOrCreateSymbol(Name.str());
7878 }
8282 SmallString<256> Name;
8383 raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "CPI"
8484 << Printer.getFunctionNumber() << '_' << MO.getIndex();
85
85
8686 #if 0
8787 switch (MO.getTargetFlags()) {
8888 default: llvm_unreachable("Unknown target flag on GV operand");
8989 }
9090 #endif
91
91
9292 // Create a symbol for the name.
9393 return Ctx.GetOrCreateSymbol(Name.str());
9494 }
95
95
9696 MCOperand ARMMCInstLower::
9797 LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const {
9898 // FIXME: We would like an efficient form for this, so we don't have to do a
9999 // lot of extra uniquing.
100100 const MCExpr *Expr = MCSymbolRefExpr::Create(Sym, Ctx);
101
101
102102 #if 0
103103 switch (MO.getTargetFlags()) {
104104 default: llvm_unreachable("Unknown target flag on GV operand");
105105 }
106106 #endif
107
107
108108 if (!MO.isJTI() && MO.getOffset())
109109 Expr = MCBinaryExpr::CreateAdd(Expr,
110110 MCConstantExpr::Create(MO.getOffset(), Ctx),
115115
116116 void ARMMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
117117 OutMI.setOpcode(MI->getOpcode());
118
118
119119 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
120120 const MachineOperand &MO = MI->getOperand(i);
121
121
122122 MCOperand MCOp;
123123 switch (MO.getType()) {
124124 default:
154154 MO.getBlockAddress()));
155155 break;
156156 }
157
157
158158 OutMI.addOperand(MCOp);
159159 }
160
160
161161 }
2323 class MachineOperand;
2424 class Mangler;
2525 //class ARMSubtarget;
26
26
2727 /// ARMMCInstLower - This class is used to lower an MachineInstr into an MCInst.
2828 class LLVM_LIBRARY_VISIBILITY ARMMCInstLower {
2929 MCContext &Ctx;
3434 public:
3535 ARMMCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer)
3636 : Ctx(ctx), Mang(mang), Printer(printer) {}
37
37
3838 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
3939
4040 //MCSymbol *GetPICBaseSymbol() const;
4343 MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
4444 MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
4545 MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
46
46
4747 /*
4848 private:
4949 MachineModuleInfoMachO &getMachOMMI() const;