LLVM: include/llvm/Bitstream/BitCodes.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17#ifndef LLVM_BITSTREAM_BITCODES_H

18#define LLVM_BITSTREAM_BITCODES_H

19

25#include

26

27namespace llvm {

28

29

30

31

32

34 uint64_t Val;

35 bool IsLiteral : 1;

36 unsigned Enc : 3;

37public:

39 Fixed = 1,

40 VBR = 2,

41 Array = 3,

42 Char6 = 4,

43 Blob = 5

45

47 return E >= 1 && E <= 5;

48 }

49

52 : Val(Data), IsLiteral(false), Enc(E) {}

53

54 bool isLiteral() const { return IsLiteral; }

55 bool isEncoding() const { return !IsLiteral; }

56

57

59

60

64 return Val;

65 }

66

69 switch (E) {

72 return true;

76 return false;

77 }

79 }

80

81

82 static bool isChar6(char C) { return isAlnum(C) || C == '.' || C == '_'; }

84 if (C >= 'a' && C <= 'z') return C-'a';

85 if (C >= 'A' && C <= 'Z') return C-'A'+26;

86 if (C >= '0' && C <= '9') return C-'0'+26+26;

87 if (C == '.') return 62;

88 if (C == '_') return 63;

90 }

91

93 assert((V & ~63) == 0 && "Not a Char6 encoded character!");

94 return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._"

95 [V];

96 }

97

98};

99

100

101

102

105

106public:

108

109 explicit BitCodeAbbrev(std::initializer_list OperandList)

110 : OperandList(OperandList) {}

111

113 return static_cast<unsigned>(OperandList.size());

114 }

116 return OperandList[N];

117 }

118

121 }

122};

123}

124

125#endif

static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

This file defines the SmallVector class.

BitCodeAbbrevOp - This describes one or more operands in an abbreviation.

static bool isChar6(char C)

isChar6 - Return true if this character is legal in the Char6 encoding.

uint64_t getLiteralValue() const

static bool isValidEncoding(uint64_t E)

BitCodeAbbrevOp(uint64_t V)

static unsigned EncodeChar6(char C)

bool hasEncodingData() const

static bool hasEncodingData(Encoding E)

BitCodeAbbrevOp(Encoding E, uint64_t Data=0)

Encoding getEncoding() const

static char DecodeChar6(unsigned V)

uint64_t getEncodingData() const

BitCodeAbbrev - This class represents an abbreviation record.

BitCodeAbbrev(std::initializer_list< BitCodeAbbrevOp > OperandList)

unsigned getNumOperandInfos() const

void Add(const BitCodeAbbrevOp &OpInfo)

const BitCodeAbbrevOp & getOperandInfo(unsigned N) const

void push_back(const T &Elt)

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

@ C

The default llvm calling convention, compatible with C.

This is an optimization pass for GlobalISel generic memory operations.

void report_fatal_error(Error Err, bool gen_crash_diag=true)

Report a serious error, calling any installed error handler.