LLVM: lib/Target/SystemZ/SystemZAsmPrinter.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZASMPRINTER_H

10#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZASMPRINTER_H

11

19

20namespace llvm {

25

27public:

28 static char ID;

29

30private:

31 MCSymbol *CurrentFnPPA1Sym;

32 MCSymbol *CurrentFnEPMarkerSym;

34

37 assert(TS && "do not have a target streamer");

39 }

40

41

42 enum class CallType {

43 BASR76 = 0,

44 BRAS7 = 1,

45 RESVD_2 = 2,

46 BRASL7 = 3,

47 RESVD_4 = 4,

48 RESVD_5 = 5,

49 BALR1415 = 6,

50 BASR33 = 7,

51 };

52

53

54

55

56 class AssociatedDataAreaTable {

57 public:

58 using DisplacementTable =

59 MapVector<std::pair<const MCSymbol *, unsigned>, uint32_t>;

60

61 private:

63

64

65 DisplacementTable Displacements;

66

67

68

69 uint32_t NextDisplacement = 0;

70

71 public:

72 AssociatedDataAreaTable(uint64_t PointerSize) : PointerSize(PointerSize) {}

73

74

75

76

77 uint32_t insert(const MachineOperand MO);

78

79

80

81

82

83

84

85 uint32_t insert(const MCSymbol *Sym, unsigned SlotKind);

86

87

88

89 const DisplacementTable &getTable() const { return Displacements; }

90

91 uint32_t getNextDisplacement() const { return NextDisplacement; }

92 };

93

94 AssociatedDataAreaTable ADATable;

95

96 void emitPPA1(MCSymbol *FnEndSym);

97 void emitPPA2(Module &M);

98 void emitADASection();

99 void emitIDRLSection(Module &M);

100

101public:

104 CurrentFnEPMarkerSym(nullptr), PPA2Sym(nullptr),

106

107

109 void emitInstruction(const MachineInstr *MI) override;

111 void emitEndOfAsmFile(Module &M) override;

112 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,

113 const char *ExtraCode, raw_ostream &OS) override;

114 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,

115 const char *ExtraCode, raw_ostream &OS) override;

116

119

120

122

123 return false;

124 }

125

130 void emitFunctionEntryLabel() override;

131 void emitFunctionBodyEnd() override;

132 void emitStartOfAsmFile(Module &M) override;

133

134private:

135 void emitCallInformation(CallType CT);

139 void LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI,

142 void emitAttributes(Module &M);

143};

144}

145

146#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

#define LLVM_LIBRARY_VISIBILITY

Machine Check Debug Module

TargetMachine & TM

Target machine description.

void emitXRayTable()

Emit a table with all XRay instrumentation points.

MachineFunction * MF

The current machine function.

bool doInitialization(Module &M) override

Set up the AsmPrinter when we are working on a new module.

AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer, char &ID=AsmPrinter::ID)

bool runOnMachineFunction(MachineFunction &MF) override

Emit the specified function out to the OutStreamer.

std::unique_ptr< MCStreamer > OutStreamer

This is the MCStreamer object for the file we are generating.

unsigned getPointerSize() const

Return the pointer size from the TargetMachine.

Streaming machine code generation interface.

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

Target specific streamer interface.

Abstract base class for all machine specific constantpool value subclasses.

Representation of each machine instruction.

A Module instance is used to store all the information related to an LLVM module.

StringRef - Represent a constant reference to a string, i.e.

static char ID

Definition SystemZAsmPrinter.h:28

StringRef getPassName() const override

getPassName - Return a nice clean name for a pass.

Definition SystemZAsmPrinter.h:108

bool runOnMachineFunction(MachineFunction &MF) override

Emit the specified function out to the OutStreamer.

Definition SystemZAsmPrinter.h:117

SystemZAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)

Definition SystemZAsmPrinter.h:102

bool doInitialization(Module &M) override

Set up the AsmPrinter when we are working on a new module.

Definition SystemZAsmPrinter.h:126

Primary interface to the complete machine description for the target machine.

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

Implement std::hash so that hash_code can be used in STL containers.