LLVM: lib/CodeGen/FEntryInserter.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

22

23using namespace llvm;

24

25namespace {

26struct FEntryInserter {

27 bool run(MachineFunction &MF);

28};

29

31 static char ID;

32 FEntryInserterLegacy() : MachineFunctionPass(ID) {

34 }

35

36 bool runOnMachineFunction(MachineFunction &F) override {

37 return FEntryInserter().run(F);

38 }

39};

40}

41

44 if (!FEntryInserter().run(MF))

47}

48

50 const std::string FEntryName = std::string(

52 if (FEntryName != "true")

53 return false;

54

55 auto &FirstMBB = *MF.begin();

58 TII->get(TargetOpcode::FENTRY_CALL));

59 return true;

60}

61

62char FEntryInserterLegacy::ID = 0;

64INITIALIZE_PASS(FEntryInserterLegacy, "fentry-insert", "Insert fentry calls",

65 false, false)

const TargetInstrInfo & TII

#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)

LLVM_ABI StringRef getValueAsString() const

Return the attribute's value as a string.

PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)

Definition FEntryInserter.cpp:42

Attribute getFnAttribute(Attribute::AttrKind Kind) const

Return the attribute for the given attribute kind.

MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...

const TargetSubtargetInfo & getSubtarget() const

getSubtarget - Return the subtarget for which this machine code is being compiled.

Function & getFunction()

Return the LLVM function that this machine code represents.

static LLVM_ABI PassRegistry * getPassRegistry()

getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...

A set of analyses that are preserved following a run of a transformation pass.

static PreservedAnalyses all()

Construct a special preserved set that preserves all passes.

virtual const TargetInstrInfo * getInstrInfo() const

PointerTypeMap run(const Module &M)

Compute the PointerTypeMap for the module M.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI char & FEntryInserterID

This pass inserts FEntry calls.

Definition FEntryInserter.cpp:63

MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)

Builder interface. Specify how to create the initial instruction itself.

AnalysisManager< MachineFunction > MachineFunctionAnalysisManager

LLVM_ABI void initializeFEntryInserterLegacyPass(PassRegistry &)

LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()

Returns the minimum set of Analyses that all machine function passes must preserve.