#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86Subtarget.h"
#include "llvm/CodeGen/IndirectThunks.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
usingnamespacellvm;
#define DEBUG_TYPE …
static const char RetpolineNamePrefix[] = …;
static const char R11RetpolineName[] = …;
static const char EAXRetpolineName[] = …;
static const char ECXRetpolineName[] = …;
static const char EDXRetpolineName[] = …;
static const char EDIRetpolineName[] = …;
static const char LVIThunkNamePrefix[] = …;
static const char R11LVIThunkName[] = …;
namespace {
struct RetpolineThunkInserter : ThunkInserter<RetpolineThunkInserter> { … };
struct LVIThunkInserter : ThunkInserter<LVIThunkInserter> { … };
class X86IndirectThunks
: public ThunkInserterPass<RetpolineThunkInserter, LVIThunkInserter> { … };
}
bool RetpolineThunkInserter::insertThunks(MachineModuleInfo &MMI,
MachineFunction &MF,
bool ExistingThunks) { … }
void RetpolineThunkInserter::populateThunk(MachineFunction &MF) { … }
FunctionPass *llvm::createX86IndirectThunksPass() { … }
char X86IndirectThunks::ID = …;