summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86MCInstLower.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-05-06 23:53:26 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-05-06 23:53:26 +0000
commitd9fd44e97ae91e8499cebb0d841fd1e9080227a6 (patch)
tree8f59951bfd4bee2914ca3e14a535bd66608c86cc /lib/Target/X86/X86MCInstLower.cpp
parent9a46db689afdceee943faf9c7bb9df4bb0f135ad (diff)
[X86MCInst] Move LowerSTATEPOINT to inside X86AsmPrinter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86MCInstLower.cpp')
-rw-r--r--lib/Target/X86/X86MCInstLower.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Target/X86/X86MCInstLower.cpp b/lib/Target/X86/X86MCInstLower.cpp
index b98e4879de3..273444cccc0 100644
--- a/lib/Target/X86/X86MCInstLower.cpp
+++ b/lib/Target/X86/X86MCInstLower.cpp
@@ -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);