mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
[X86MCInst] Clean up LowerSTATEPOINT: variable names. NFC.
llvm-svn: 236675
This commit is contained in:
parent
a21256f2f4
commit
c17aa0b859
@ -816,32 +816,31 @@ static void LowerSTATEPOINT(MCStreamer &OS, StackMaps &SM,
|
||||
assert(Is64Bit && "Statepoint currently only supports X86-64");
|
||||
|
||||
// Lower call target and choose correct opcode
|
||||
const MachineOperand &call_target = StatepointOpers(&MI).getCallTarget();
|
||||
MCOperand call_target_mcop;
|
||||
unsigned call_opcode;
|
||||
switch (call_target.getType()) {
|
||||
const MachineOperand &CallTarget = StatepointOpers(&MI).getCallTarget();
|
||||
MCOperand CallTargetMCOp;
|
||||
unsigned CallOpcode;
|
||||
switch (CallTarget.getType()) {
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
call_target_mcop = MCInstLowering.LowerSymbolOperand(
|
||||
call_target,
|
||||
MCInstLowering.GetSymbolFromOperand(call_target));
|
||||
call_opcode = X86::CALL64pcrel32;
|
||||
CallTargetMCOp = MCInstLowering.LowerSymbolOperand(
|
||||
CallTarget, MCInstLowering.GetSymbolFromOperand(CallTarget));
|
||||
CallOpcode = X86::CALL64pcrel32;
|
||||
// Currently, we only support relative addressing with statepoints.
|
||||
// Otherwise, we'll need a scratch register to hold the target
|
||||
// address. You'll fail asserts during load & relocation if this
|
||||
// symbol is to far away. (TODO: support non-relative addressing)
|
||||
break;
|
||||
case MachineOperand::MO_Immediate:
|
||||
call_target_mcop = MCOperand::CreateImm(call_target.getImm());
|
||||
call_opcode = X86::CALL64pcrel32;
|
||||
CallTargetMCOp = MCOperand::CreateImm(CallTarget.getImm());
|
||||
CallOpcode = X86::CALL64pcrel32;
|
||||
// Currently, we only support relative addressing with statepoints.
|
||||
// Otherwise, we'll need a scratch register to hold the target
|
||||
// immediate. You'll fail asserts during load & relocation if this
|
||||
// address is to far away. (TODO: support non-relative addressing)
|
||||
break;
|
||||
case MachineOperand::MO_Register:
|
||||
call_target_mcop = MCOperand::CreateReg(call_target.getReg());
|
||||
call_opcode = X86::CALL64r;
|
||||
CallTargetMCOp = MCOperand::CreateReg(CallTarget.getReg());
|
||||
CallOpcode = X86::CALL64r;
|
||||
break;
|
||||
default:
|
||||
llvm_unreachable("Unsupported operand type in statepoint call target");
|
||||
@ -849,10 +848,10 @@ static void LowerSTATEPOINT(MCStreamer &OS, StackMaps &SM,
|
||||
}
|
||||
|
||||
// Emit call
|
||||
MCInst call_inst;
|
||||
call_inst.setOpcode(call_opcode);
|
||||
call_inst.addOperand(call_target_mcop);
|
||||
OS.EmitInstruction(call_inst, STI);
|
||||
MCInst CallInst;
|
||||
CallInst.setOpcode(CallOpcode);
|
||||
CallInst.addOperand(CallTargetMCOp);
|
||||
OS.EmitInstruction(CallInst, STI);
|
||||
|
||||
// Record our statepoint node in the same section used by STACKMAP
|
||||
// and PATCHPOINT
|
||||
|
Loading…
Reference in New Issue
Block a user