mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 03:30:37 +00:00
[X86MCInst] Move LowerSTATEPOINT to inside X86AsmPrinter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236676 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a46db689a
commit
d9fd44e97a
@ -82,6 +82,7 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
|
||||
void InsertStackMapShadows(MachineFunction &MF);
|
||||
void LowerSTACKMAP(const MachineInstr &MI);
|
||||
void LowerPATCHPOINT(const MachineInstr &MI, X86MCInstLower &MCIL);
|
||||
void LowerSTATEPOINT(const MachineInstr &MI, X86MCInstLower &MCIL);
|
||||
|
||||
void LowerTlsAddr(X86MCInstLower &MCInstLowering, const MachineInstr &MI);
|
||||
|
||||
|
@ -808,12 +808,9 @@ static void EmitNops(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSu
|
||||
} // while (NumBytes)
|
||||
}
|
||||
|
||||
static void LowerSTATEPOINT(MCStreamer &OS, StackMaps &SM,
|
||||
const MachineInstr &MI, bool Is64Bit,
|
||||
const TargetMachine& TM,
|
||||
const MCSubtargetInfo& STI,
|
||||
X86MCInstLower &MCInstLowering) {
|
||||
assert(Is64Bit && "Statepoint currently only supports X86-64");
|
||||
void X86AsmPrinter::LowerSTATEPOINT(const MachineInstr &MI,
|
||||
X86MCInstLower &MCIL) {
|
||||
assert(Subtarget->is64Bit() && "Statepoint currently only supports X86-64");
|
||||
|
||||
// Lower call target and choose correct opcode
|
||||
const MachineOperand &CallTarget = StatepointOpers(&MI).getCallTarget();
|
||||
@ -822,8 +819,8 @@ static void LowerSTATEPOINT(MCStreamer &OS, StackMaps &SM,
|
||||
switch (CallTarget.getType()) {
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
CallTargetMCOp = MCInstLowering.LowerSymbolOperand(
|
||||
CallTarget, MCInstLowering.GetSymbolFromOperand(CallTarget));
|
||||
CallTargetMCOp = MCIL.LowerSymbolOperand(
|
||||
CallTarget, MCIL.GetSymbolFromOperand(CallTarget));
|
||||
CallOpcode = X86::CALL64pcrel32;
|
||||
// Currently, we only support relative addressing with statepoints.
|
||||
// Otherwise, we'll need a scratch register to hold the target
|
||||
@ -851,7 +848,7 @@ static void LowerSTATEPOINT(MCStreamer &OS, StackMaps &SM,
|
||||
MCInst CallInst;
|
||||
CallInst.setOpcode(CallOpcode);
|
||||
CallInst.addOperand(CallTargetMCOp);
|
||||
OS.EmitInstruction(CallInst, STI);
|
||||
OutStreamer->EmitInstruction(CallInst, getSubtargetInfo());
|
||||
|
||||
// Record our statepoint node in the same section used by STACKMAP
|
||||
// and PATCHPOINT
|
||||
@ -1111,8 +1108,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
return;
|
||||
}
|
||||
case TargetOpcode::STATEPOINT:
|
||||
return LowerSTATEPOINT(*OutStreamer, SM, *MI, Subtarget->is64Bit(), TM,
|
||||
getSubtargetInfo(), MCInstLowering);
|
||||
return LowerSTATEPOINT(*MI, MCInstLowering);
|
||||
|
||||
case TargetOpcode::STACKMAP:
|
||||
return LowerSTACKMAP(*MI);
|
||||
|
Loading…
x
Reference in New Issue
Block a user