forked from OSchip/llvm-project
Add parameter Offset to MipsMCInstLower::LowerSymbolOperand.
llvm-svn: 137706
This commit is contained in:
parent
667417ef9c
commit
6520b9857f
|
@ -29,10 +29,10 @@ MipsMCInstLower::MipsMCInstLower(Mangler *mang, const MachineFunction &mf,
|
||||||
: Ctx(mf.getContext()), Mang(mang), AsmPrinter(asmprinter) {}
|
: Ctx(mf.getContext()), Mang(mang), AsmPrinter(asmprinter) {}
|
||||||
|
|
||||||
MCOperand MipsMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
MCOperand MipsMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
||||||
MachineOperandType MOTy) const {
|
MachineOperandType MOTy,
|
||||||
|
unsigned Offset) const {
|
||||||
MipsMCSymbolRefExpr::VariantKind Kind;
|
MipsMCSymbolRefExpr::VariantKind Kind;
|
||||||
const MCSymbol *Symbol;
|
const MCSymbol *Symbol;
|
||||||
int Offset = 0;
|
|
||||||
|
|
||||||
switch(MO.getTargetFlags()) {
|
switch(MO.getTargetFlags()) {
|
||||||
default: assert(0 && "Invalid target flag!");
|
default: assert(0 && "Invalid target flag!");
|
||||||
|
@ -72,7 +72,7 @@ MCOperand MipsMCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
||||||
case MachineOperand::MO_ConstantPoolIndex:
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
Symbol = AsmPrinter.GetCPISymbol(MO.getIndex());
|
Symbol = AsmPrinter.GetCPISymbol(MO.getIndex());
|
||||||
if (MO.getOffset())
|
if (MO.getOffset())
|
||||||
Offset = MO.getOffset();
|
Offset += MO.getOffset();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -109,7 +109,7 @@ void MipsMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
||||||
case MachineOperand::MO_JumpTableIndex:
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
case MachineOperand::MO_ConstantPoolIndex:
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
case MachineOperand::MO_BlockAddress:
|
case MachineOperand::MO_BlockAddress:
|
||||||
MCOp = LowerSymbolOperand(MO, MOTy);
|
MCOp = LowerSymbolOperand(MO, MOTy, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
||||||
private:
|
private:
|
||||||
MCOperand LowerSymbolOperand(const MachineOperand &MO,
|
MCOperand LowerSymbolOperand(const MachineOperand &MO,
|
||||||
MachineOperandType MOTy) const;
|
MachineOperandType MOTy, unsigned Offset) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue