LLVM: lib/Remarks/BitstreamRemarkSerializer.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

16#include

17

18using namespace llvm;

20

23 : Bitstream(Encoded), ContainerType(ContainerType) {}

24

27}

28

31 R.clear();

32 R.push_back(RecordID);

35}

36

39 R.clear();

40 R.push_back(BlockID);

42

43 R.clear();

46}

47

49

51

52

55

56 auto Abbrev = std::make_shared();

62}

63

67

68 auto Abbrev = std::make_shared();

73}

74

77

82}

83

86

87 auto Abbrev = std::make_shared();

92}

93

96

99

100

101 std::string Buf;

106}

107

110

111 auto Abbrev = std::make_shared();

116}

117

119

123}

124

126

128

129

130 {

132

133 auto Abbrev = std::make_shared();

141 }

142

143

144 {

146

147 auto Abbrev = std::make_shared();

154 }

155

156

157 {

159

160 auto Abbrev = std::make_shared();

165 }

166

167

168 {

171

172 auto Abbrev = std::make_shared();

181 }

182

183

184 {

187

188 auto Abbrev = std::make_shared();

194 }

195}

196

198

201

203

204

205

207

210

212

214 break;

216

218

220 break;

222

224

226

228 break;

229 }

230

232}

233

235 uint64_t ContainerVersion, std::optional<uint64_t> RemarkVersion,

236 std::optional<const StringTable *> StrTab,

237 std::optional Filename) {

238

240

241

247

250 assert(StrTab != std::nullopt && *StrTab != nullptr);

252 assert(Filename != std::nullopt);

254 break;

256 assert(RemarkVersion != std::nullopt);

258 break;

260 assert(RemarkVersion != std::nullopt);

262 assert(StrTab != std::nullopt && *StrTab != nullptr);

264 break;

265 }

266

268}

269

273

281

282 if (const std::optional &Loc = Remark.Loc) {

285 R.push_back(StrTab.add(Loc->SourceFilePath).first);

289 }

290

291 if (std::optional<uint64_t> Hotness = Remark.Hotness) {

296 }

297

300 unsigned Key = StrTab.add(Arg.Key).first;

301 unsigned Val = StrTab.add(Arg.Val).first;

302 bool HasDebugLoc = Arg.Loc != std::nullopt;

307 if (HasDebugLoc) {

311 }

315 R);

316 }

318}

319

323}

324

327}

328

334 "For SerializerMode::Standalone, a pre-filled string table needs to "

335 "be provided.");

336

338}

339

347 StrTab = std::move(StrTabIn);

348}

349

352

353

354 bool IsStandalone =

358 IsStandalone ? &*StrTab

359 : std::optional<const StringTable *>(std::nullopt));

362 }

363

365 "The Block info block and the meta block were not emitted yet.");

367

369}

370

372 raw_ostream &OS, std::optional ExternalFilename) {

375 bool IsStandalone =

377 return std::make_unique(

381 &*StrTab, ExternalFilename);

382}

383

389}

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

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

void Emit(uint32_t Val, unsigned NumBits)

void EmitRecordWithBlob(unsigned Abbrev, const Container &Vals, StringRef Blob)

EmitRecordWithBlob - Emit the specified record to the stream, using an abbrev that includes a blob at...

unsigned EmitBlockInfoAbbrev(unsigned BlockID, std::shared_ptr< BitCodeAbbrev > Abbv)

EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified BlockID.

void EnterBlockInfoBlock()

EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK.

void EnterSubblock(unsigned BlockID, unsigned CodeLen)

void EmitRecordWithAbbrev(unsigned Abbrev, const Container &Vals)

EmitRecordWithAbbrev - Emit a record with the specified abbreviation.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

void push_back(const T &Elt)

pointer data()

Return a pointer to the vector's buffer, even if empty().

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

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

raw_ostream & write(unsigned char C)

A raw_ostream that writes to an std::string.

@ C

The default llvm calling convention, compatible with C.

@ BLOCKINFO_CODE_BLOCKNAME

@ BLOCKINFO_CODE_SETRECORDNAME

This is an optimization pass for GlobalISel generic memory operations.

void append_range(Container &C, Range &&R)

Wrapper function to append range R to container C.