Go to the documentation of this file.
43 #define PASS_KEY "x86-return-thunks"
44 #define DEBUG_TYPE PASS_KEY
50 StringRef getPassName()
const override {
return "X86 Return Thunks"; }
65 StringRef ThunkName =
"__x86_return_thunk";
71 const unsigned RetOpc = Is64Bit ? X86::RET64 : X86::RET32;
76 if (
Term.getOpcode() == RetOpc)
77 Rets.push_back(&
Term);
80 MF.getMMI().getModule()->getModuleFlag(
"indirect_branch_cs_prefix");
81 const MCInstrDesc &CS =
ST.getInstrInfo()->get(X86::CS_PREFIX);
82 const MCInstrDesc &JMP =
ST.getInstrInfo()->get(X86::TAILJMPd);
89 Ret->eraseFromParent();
99 return new X86ReturnThunks();
This is an optimization pass for GlobalISel generic memory operations.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
iterator_range< iterator > terminators()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Describe properties that are true of each instruction in the target description file.
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
const MachineInstrBuilder & addExternalSymbol(const char *FnName, unsigned TargetFlags=0) const
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Representation of each machine instruction.
FunctionPass * createX86ReturnThunksPass()
This pass replaces ret instructions with jmp's to __x86_return thunk.
StringRef - Represent a constant reference to a string, i.e.
StringRef getName() const
Return a constant reference to the value's name.
Function & getFunction()
Return the LLVM function that this machine code represents.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass class - This class is used to implement most global optimizations.