[llvm] r236676 - [X86MCInst] Move LowerSTATEPOINT to inside X86AsmPrinter. NFC.

Sanjoy Das sanjoy at playingwithpointers.com
Wed May 6 16:53:26 PDT 2015


Author: sanjoy
Date: Wed May  6 18:53:26 2015
New Revision: 236676

URL: http://llvm.org/viewvc/llvm-project?rev=236676&view=rev
Log:
[X86MCInst] Move LowerSTATEPOINT to inside X86AsmPrinter.  NFC.

Modified:
    llvm/trunk/lib/Target/X86/X86AsmPrinter.h
    llvm/trunk/lib/Target/X86/X86MCInstLower.cpp

Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.h?rev=236676&r1=236675&r2=236676&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.h Wed May  6 18:53:26 2015
@@ -82,6 +82,7 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrin
   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);
 

Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=236676&r1=236675&r2=236676&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Wed May  6 18:53:26 2015
@@ -808,12 +808,9 @@ static void EmitNops(MCStreamer &OS, uns
   } // 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 &
   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 &
   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(cons
     return;
   }
   case TargetOpcode::STATEPOINT:
-    return LowerSTATEPOINT(*OutStreamer, SM, *MI, Subtarget->is64Bit(), TM,
-                           getSubtargetInfo(), MCInstLowering);
+    return LowerSTATEPOINT(*MI, MCInstLowering);
 
   case TargetOpcode::STACKMAP:
     return LowerSTACKMAP(*MI);





More information about the llvm-commits mailing list