LLVM: include/llvm/MC/MCInstrInfo.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_MC_MCINSTRINFO_H

14#define LLVM_MC_MCINSTRINFO_H

15

19#include

20

21namespace llvm {

22

24

25

26

28public:

31 std::string &);

32

33private:

34 const MCInstrDesc *LastDesc;

35 const unsigned *InstrNameIndices;

36 const char *InstrNameData;

37

38

39

40 const uint8_t *DeprecatedFeatures;

41

42

44 unsigned NumOpcodes;

45

46protected:

47

50

51public:

52

53

57 const int16_t *RCHWTables = nullptr,

58 int16_t NumRegClassByHwMode = 0) {

59 LastDesc = D + NO - 1;

60 InstrNameIndices = NI;

61 InstrNameData = ND;

62 DeprecatedFeatures = DF;

63 ComplexDeprecationInfos = CDI;

64 NumOpcodes = NO;

67 }

68

70

73 "MCInstrInfo not properly initialized");

75 }

76

77

78

79

81 unsigned HwModeId) const {

82 int16_t RegClass = OpInfo.RegClass;

83 if (OpInfo.isLookupRegClassByHwMode())

85 return RegClass;

86 }

87

88

89

91 assert(Opcode < NumOpcodes && "Invalid opcode!");

92

93 return *(LastDesc - Opcode);

94 }

95

96

98 assert(Opcode < NumOpcodes && "Invalid opcode!");

99 return StringRef(&InstrNameData[InstrNameIndices[Opcode]]);

100 }

101

102

103

105 std::string &Info) const;

106};

107

108}

109

110#endif

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

static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")

Analysis containing CSE Info

static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")

Instances of this class represent a single low-level machine instruction.

Describe properties that are true of each instruction in the target description file.

Interface to description of machine instruction set.

Definition MCInstrInfo.h:27

const MCInstrDesc & get(unsigned Opcode) const

Return the machine instruction descriptor that corresponds to the specified instruction opcode.

Definition MCInstrInfo.h:90

void InitMCInstrInfo(const MCInstrDesc *D, const unsigned *NI, const char *ND, const uint8_t *DF, const ComplexDeprecationPredicate *CDI, unsigned NO, const int16_t *RCHWTables=nullptr, int16_t NumRegClassByHwMode=0)

Initialize MCInstrInfo, called by TableGen auto-generated routines.

Definition MCInstrInfo.h:54

const int16_t * getRegClassByHwModeTable(unsigned ModeId) const

Definition MCInstrInfo.h:71

bool(*)(MCInst &, const MCSubtargetInfo &, std::string &) ComplexDeprecationPredicate

Definition MCInstrInfo.h:29

const int16_t * RegClassByHwModeTables

Definition MCInstrInfo.h:48

int16_t NumRegClassByHwModes

Definition MCInstrInfo.h:49

LLVM_ABI bool getDeprecatedInfo(MCInst &MI, const MCSubtargetInfo &STI, std::string &Info) const

Returns true if a certain instruction is deprecated and if so returns the reason in Info.

unsigned getNumOpcodes() const

Definition MCInstrInfo.h:69

int16_t getOpRegClassID(const MCOperandInfo &OpInfo, unsigned HwModeId) const

Return the ID of the register class to use for OpInfo, for the active HwMode HwModeId.

Definition MCInstrInfo.h:80

StringRef getName(unsigned Opcode) const

Returns the name for the instructions with the given opcode.

Definition MCInstrInfo.h:97

This holds information about one operand of a machine instruction, indicating the register class for ...

Generic base class for all target subtargets.

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

This is an optimization pass for GlobalISel generic memory operations.