clang-tools  17.0.0git
BitcodeWriter.cpp
Go to the documentation of this file.
1 //===-- BitcodeWriter.cpp - ClangDoc Bitcode Writer ------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "BitcodeWriter.h"
10 #include "llvm/ADT/IndexedMap.h"
11 #include <initializer_list>
12 
13 namespace clang {
14 namespace doc {
15 
16 // Empty SymbolID for comparison, so we don't have to construct one every time.
17 static const SymbolID EmptySID = SymbolID();
18 
19 // Since id enums are not zero-indexed, we need to transform the given id into
20 // its associated index.
22  using argument_type = unsigned;
23  unsigned operator()(unsigned ID) const { return ID - BI_FIRST; }
24 };
25 
27  using argument_type = unsigned;
28  unsigned operator()(unsigned ID) const { return ID - RI_FIRST; }
29 };
30 
31 using AbbrevDsc = void (*)(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev);
32 
33 static void AbbrevGen(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev,
34  const std::initializer_list<llvm::BitCodeAbbrevOp> Ops) {
35  for (const auto &Op : Ops)
36  Abbrev->Add(Op);
37 }
38 
39 static void BoolAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
40  AbbrevGen(Abbrev,
41  {// 0. Boolean
42  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
44 }
45 
46 static void IntAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
47  AbbrevGen(Abbrev,
48  {// 0. Fixed-size integer
49  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
51 }
52 
53 static void SymbolIDAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
54  AbbrevGen(Abbrev,
55  {// 0. Fixed-size integer (length of the sha1'd USR)
56  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
58  // 1. Fixed-size array of Char6 (USR)
59  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Array),
60  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
62 }
63 
64 static void StringAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
65  AbbrevGen(Abbrev,
66  {// 0. Fixed-size integer (length of the following string)
67  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
69  // 1. The string blob
70  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob)});
71 }
72 
73 // Assumes that the file will not have more than 65535 lines.
74 static void LocationAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
75  AbbrevGen(
76  Abbrev,
77  {// 0. Fixed-size integer (line number)
78  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
80  // 1. Boolean (IsFileInRootDir)
81  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
83  // 2. Fixed-size integer (length of the following string (filename))
84  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
86  // 3. The string blob
87  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob)});
88 }
89 
90 struct RecordIdDsc {
91  llvm::StringRef Name;
92  AbbrevDsc Abbrev = nullptr;
93 
94  RecordIdDsc() = default;
95  RecordIdDsc(llvm::StringRef Name, AbbrevDsc Abbrev)
96  : Name(Name), Abbrev(Abbrev) {}
97 
98  // Is this 'description' valid?
99  operator bool() const {
100  return Abbrev != nullptr && Name.data() != nullptr && !Name.empty();
101  }
102 };
103 
104 static const llvm::IndexedMap<llvm::StringRef, BlockIdToIndexFunctor>
105  BlockIdNameMap = []() {
106  llvm::IndexedMap<llvm::StringRef, BlockIdToIndexFunctor> BlockIdNameMap;
108 
109  // There is no init-list constructor for the IndexedMap, so have to
110  // improvise
111  static const std::vector<std::pair<BlockId, const char *const>> Inits = {
112  {BI_VERSION_BLOCK_ID, "VersionBlock"},
113  {BI_NAMESPACE_BLOCK_ID, "NamespaceBlock"},
114  {BI_ENUM_BLOCK_ID, "EnumBlock"},
115  {BI_ENUM_VALUE_BLOCK_ID, "EnumValueBlock"},
116  {BI_TYPEDEF_BLOCK_ID, "TypedefBlock"},
117  {BI_TYPE_BLOCK_ID, "TypeBlock"},
118  {BI_FIELD_TYPE_BLOCK_ID, "FieldTypeBlock"},
119  {BI_MEMBER_TYPE_BLOCK_ID, "MemberTypeBlock"},
120  {BI_RECORD_BLOCK_ID, "RecordBlock"},
121  {BI_BASE_RECORD_BLOCK_ID, "BaseRecordBlock"},
122  {BI_FUNCTION_BLOCK_ID, "FunctionBlock"},
123  {BI_COMMENT_BLOCK_ID, "CommentBlock"},
124  {BI_REFERENCE_BLOCK_ID, "ReferenceBlock"},
125  {BI_TEMPLATE_BLOCK_ID, "TemplateBlock"},
126  {BI_TEMPLATE_SPECIALIZATION_BLOCK_ID, "TemplateSpecializationBlock"},
127  {BI_TEMPLATE_PARAM_BLOCK_ID, "TemplateParamBlock"}};
128  assert(Inits.size() == BlockIdCount);
129  for (const auto &Init : Inits)
130  BlockIdNameMap[Init.first] = Init.second;
131  assert(BlockIdNameMap.size() == BlockIdCount);
132  return BlockIdNameMap;
133  }();
134 
135 static const llvm::IndexedMap<RecordIdDsc, RecordIdToIndexFunctor>
137  llvm::IndexedMap<RecordIdDsc, RecordIdToIndexFunctor> RecordIdNameMap;
139 
140  // There is no init-list constructor for the IndexedMap, so have to
141  // improvise
142  static const std::vector<std::pair<RecordId, RecordIdDsc>> Inits = {
143  {VERSION, {"Version", &IntAbbrev}},
144  {COMMENT_KIND, {"Kind", &StringAbbrev}},
145  {COMMENT_TEXT, {"Text", &StringAbbrev}},
146  {COMMENT_NAME, {"Name", &StringAbbrev}},
147  {COMMENT_DIRECTION, {"Direction", &StringAbbrev}},
148  {COMMENT_PARAMNAME, {"ParamName", &StringAbbrev}},
149  {COMMENT_CLOSENAME, {"CloseName", &StringAbbrev}},
150  {COMMENT_SELFCLOSING, {"SelfClosing", &BoolAbbrev}},
151  {COMMENT_EXPLICIT, {"Explicit", &BoolAbbrev}},
152  {COMMENT_ATTRKEY, {"AttrKey", &StringAbbrev}},
153  {COMMENT_ATTRVAL, {"AttrVal", &StringAbbrev}},
154  {COMMENT_ARG, {"Arg", &StringAbbrev}},
155  {FIELD_TYPE_NAME, {"Name", &StringAbbrev}},
156  {FIELD_DEFAULT_VALUE, {"DefaultValue", &StringAbbrev}},
157  {MEMBER_TYPE_NAME, {"Name", &StringAbbrev}},
158  {MEMBER_TYPE_ACCESS, {"Access", &IntAbbrev}},
159  {NAMESPACE_USR, {"USR", &SymbolIDAbbrev}},
160  {NAMESPACE_NAME, {"Name", &StringAbbrev}},
161  {NAMESPACE_PATH, {"Path", &StringAbbrev}},
162  {ENUM_USR, {"USR", &SymbolIDAbbrev}},
163  {ENUM_NAME, {"Name", &StringAbbrev}},
164  {ENUM_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
165  {ENUM_LOCATION, {"Location", &LocationAbbrev}},
166  {ENUM_SCOPED, {"Scoped", &BoolAbbrev}},
167  {ENUM_VALUE_NAME, {"Name", &StringAbbrev}},
168  {ENUM_VALUE_VALUE, {"Value", &StringAbbrev}},
169  {ENUM_VALUE_EXPR, {"Expr", &StringAbbrev}},
170  {RECORD_USR, {"USR", &SymbolIDAbbrev}},
171  {RECORD_NAME, {"Name", &StringAbbrev}},
172  {RECORD_PATH, {"Path", &StringAbbrev}},
173  {RECORD_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
174  {RECORD_LOCATION, {"Location", &LocationAbbrev}},
175  {RECORD_TAG_TYPE, {"TagType", &IntAbbrev}},
176  {RECORD_IS_TYPE_DEF, {"IsTypeDef", &BoolAbbrev}},
177  {BASE_RECORD_USR, {"USR", &SymbolIDAbbrev}},
178  {BASE_RECORD_NAME, {"Name", &StringAbbrev}},
179  {BASE_RECORD_PATH, {"Path", &StringAbbrev}},
180  {BASE_RECORD_TAG_TYPE, {"TagType", &IntAbbrev}},
181  {BASE_RECORD_IS_VIRTUAL, {"IsVirtual", &BoolAbbrev}},
182  {BASE_RECORD_ACCESS, {"Access", &IntAbbrev}},
183  {BASE_RECORD_IS_PARENT, {"IsParent", &BoolAbbrev}},
184  {FUNCTION_USR, {"USR", &SymbolIDAbbrev}},
185  {FUNCTION_NAME, {"Name", &StringAbbrev}},
186  {FUNCTION_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
187  {FUNCTION_LOCATION, {"Location", &LocationAbbrev}},
188  {FUNCTION_ACCESS, {"Access", &IntAbbrev}},
189  {FUNCTION_IS_METHOD, {"IsMethod", &BoolAbbrev}},
190  {REFERENCE_USR, {"USR", &SymbolIDAbbrev}},
191  {REFERENCE_NAME, {"Name", &StringAbbrev}},
192  {REFERENCE_QUAL_NAME, {"QualName", &StringAbbrev}},
193  {REFERENCE_TYPE, {"RefType", &IntAbbrev}},
194  {REFERENCE_PATH, {"Path", &StringAbbrev}},
195  {REFERENCE_FIELD, {"Field", &IntAbbrev}},
196  {TEMPLATE_PARAM_CONTENTS, {"Contents", &StringAbbrev}},
197  {TEMPLATE_SPECIALIZATION_OF, {"SpecializationOf", &SymbolIDAbbrev}},
198  {TYPEDEF_USR, {"USR", &SymbolIDAbbrev}},
199  {TYPEDEF_NAME, {"Name", &StringAbbrev}},
200  {TYPEDEF_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
201  {TYPEDEF_IS_USING, {"IsUsing", &BoolAbbrev}}};
202  assert(Inits.size() == RecordIdCount);
203  for (const auto &Init : Inits) {
204  RecordIdNameMap[Init.first] = Init.second;
205  assert((Init.second.Name.size() + 1) <= BitCodeConstants::RecordSize);
206  }
207  assert(RecordIdNameMap.size() == RecordIdCount);
208  return RecordIdNameMap;
209  }();
210 
211 static const std::vector<std::pair<BlockId, std::vector<RecordId>>>
213  // Version Block
215  // Comment Block
220  // Type Block
221  {BI_TYPE_BLOCK_ID, {}},
222  // FieldType Block
224  // MemberType Block
226  // Enum Block
229  // Enum Value Block
232  // Typedef Block
235  // Namespace Block
238  // Record Block
242  // BaseRecord Block
247  // Function Block
251  // Reference Block
255  // Template Blocks.
256  {BI_TEMPLATE_BLOCK_ID, {}},
259 
260 // AbbreviationMap
261 
262 constexpr unsigned char BitCodeConstants::Signature[];
263 
264 void ClangDocBitcodeWriter::AbbreviationMap::add(RecordId RID,
265  unsigned AbbrevID) {
266  assert(RecordIdNameMap[RID] && "Unknown RecordId.");
267  assert(Abbrevs.find(RID) == Abbrevs.end() && "Abbreviation already added.");
268  Abbrevs[RID] = AbbrevID;
269 }
270 
271 unsigned ClangDocBitcodeWriter::AbbreviationMap::get(RecordId RID) const {
272  assert(RecordIdNameMap[RID] && "Unknown RecordId.");
273  assert(Abbrevs.find(RID) != Abbrevs.end() && "Unknown abbreviation.");
274  return Abbrevs.lookup(RID);
275 }
276 
277 // Validation and Overview Blocks
278 
279 /// Emits the magic number header to check that its the right format,
280 /// in this case, 'DOCS'.
281 void ClangDocBitcodeWriter::emitHeader() {
282  for (char C : BitCodeConstants::Signature)
283  Stream.Emit((unsigned)C, BitCodeConstants::SignatureBitSize);
284 }
285 
286 void ClangDocBitcodeWriter::emitVersionBlock() {
287  StreamSubBlockGuard Block(Stream, BI_VERSION_BLOCK_ID);
288  emitRecord(VersionNumber, VERSION);
289 }
290 
291 /// Emits a block ID and the block name to the BLOCKINFO block.
292 void ClangDocBitcodeWriter::emitBlockID(BlockId BID) {
293  const auto &BlockIdName = BlockIdNameMap[BID];
294  assert(BlockIdName.data() && BlockIdName.size() && "Unknown BlockId.");
295 
296  Record.clear();
297  Record.push_back(BID);
298  Stream.EmitRecord(llvm::bitc::BLOCKINFO_CODE_SETBID, Record);
299  Stream.EmitRecord(llvm::bitc::BLOCKINFO_CODE_BLOCKNAME,
300  ArrayRef<unsigned char>(BlockIdName.bytes_begin(),
301  BlockIdName.bytes_end()));
302 }
303 
304 /// Emits a record name to the BLOCKINFO block.
305 void ClangDocBitcodeWriter::emitRecordID(RecordId ID) {
306  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
307  prepRecordData(ID);
308  Record.append(RecordIdNameMap[ID].Name.begin(),
309  RecordIdNameMap[ID].Name.end());
310  Stream.EmitRecord(llvm::bitc::BLOCKINFO_CODE_SETRECORDNAME, Record);
311 }
312 
313 // Abbreviations
314 
315 void ClangDocBitcodeWriter::emitAbbrev(RecordId ID, BlockId Block) {
316  assert(RecordIdNameMap[ID] && "Unknown abbreviation.");
317  auto Abbrev = std::make_shared<llvm::BitCodeAbbrev>();
318  Abbrev->Add(llvm::BitCodeAbbrevOp(ID));
319  RecordIdNameMap[ID].Abbrev(Abbrev);
320  Abbrevs.add(ID, Stream.EmitBlockInfoAbbrev(Block, std::move(Abbrev)));
321 }
322 
323 // Records
324 
325 void ClangDocBitcodeWriter::emitRecord(const SymbolID &Sym, RecordId ID) {
326  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
327  assert(RecordIdNameMap[ID].Abbrev == &SymbolIDAbbrev &&
328  "Abbrev type mismatch.");
329  if (!prepRecordData(ID, Sym != EmptySID))
330  return;
331  assert(Sym.size() == 20);
332  Record.push_back(Sym.size());
333  Record.append(Sym.begin(), Sym.end());
334  Stream.EmitRecordWithAbbrev(Abbrevs.get(ID), Record);
335 }
336 
337 void ClangDocBitcodeWriter::emitRecord(llvm::StringRef Str, RecordId ID) {
338  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
339  assert(RecordIdNameMap[ID].Abbrev == &StringAbbrev &&
340  "Abbrev type mismatch.");
341  if (!prepRecordData(ID, !Str.empty()))
342  return;
343  assert(Str.size() < (1U << BitCodeConstants::StringLengthSize));
344  Record.push_back(Str.size());
345  Stream.EmitRecordWithBlob(Abbrevs.get(ID), Record, Str);
346 }
347 
348 void ClangDocBitcodeWriter::emitRecord(const Location &Loc, RecordId ID) {
349  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
350  assert(RecordIdNameMap[ID].Abbrev == &LocationAbbrev &&
351  "Abbrev type mismatch.");
352  if (!prepRecordData(ID, true))
353  return;
354  // FIXME: Assert that the line number is of the appropriate size.
355  Record.push_back(Loc.LineNumber);
356  assert(Loc.Filename.size() < (1U << BitCodeConstants::StringLengthSize));
357  Record.push_back(Loc.IsFileInRootDir);
358  Record.push_back(Loc.Filename.size());
359  Stream.EmitRecordWithBlob(Abbrevs.get(ID), Record, Loc.Filename);
360 }
361 
362 void ClangDocBitcodeWriter::emitRecord(bool Val, RecordId ID) {
363  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
364  assert(RecordIdNameMap[ID].Abbrev == &BoolAbbrev && "Abbrev type mismatch.");
365  if (!prepRecordData(ID, Val))
366  return;
367  Record.push_back(Val);
368  Stream.EmitRecordWithAbbrev(Abbrevs.get(ID), Record);
369 }
370 
371 void ClangDocBitcodeWriter::emitRecord(int Val, RecordId ID) {
372  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
373  assert(RecordIdNameMap[ID].Abbrev == &IntAbbrev && "Abbrev type mismatch.");
374  if (!prepRecordData(ID, Val))
375  return;
376  // FIXME: Assert that the integer is of the appropriate size.
377  Record.push_back(Val);
378  Stream.EmitRecordWithAbbrev(Abbrevs.get(ID), Record);
379 }
380 
381 void ClangDocBitcodeWriter::emitRecord(unsigned Val, RecordId ID) {
382  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
383  assert(RecordIdNameMap[ID].Abbrev == &IntAbbrev && "Abbrev type mismatch.");
384  if (!prepRecordData(ID, Val))
385  return;
386  assert(Val < (1U << BitCodeConstants::IntSize));
387  Record.push_back(Val);
388  Stream.EmitRecordWithAbbrev(Abbrevs.get(ID), Record);
389 }
390 
391 void ClangDocBitcodeWriter::emitRecord(const TemplateInfo &Templ) {}
392 
393 bool ClangDocBitcodeWriter::prepRecordData(RecordId ID, bool ShouldEmit) {
394  assert(RecordIdNameMap[ID] && "Unknown RecordId.");
395  if (!ShouldEmit)
396  return false;
397  Record.clear();
398  Record.push_back(ID);
399  return true;
400 }
401 
402 // BlockInfo Block
403 
404 void ClangDocBitcodeWriter::emitBlockInfoBlock() {
405  Stream.EnterBlockInfoBlock();
406  for (const auto &Block : RecordsByBlock) {
407  assert(Block.second.size() < (1U << BitCodeConstants::SubblockIDSize));
408  emitBlockInfo(Block.first, Block.second);
409  }
410  Stream.ExitBlock();
411 }
412 
413 void ClangDocBitcodeWriter::emitBlockInfo(BlockId BID,
414  const std::vector<RecordId> &RIDs) {
415  assert(RIDs.size() < (1U << BitCodeConstants::SubblockIDSize));
416  emitBlockID(BID);
417  for (RecordId RID : RIDs) {
418  emitRecordID(RID);
419  emitAbbrev(RID, BID);
420  }
421 }
422 
423 // Block emission
424 
426  if (R.USR == EmptySID && R.Name.empty())
427  return;
428  StreamSubBlockGuard Block(Stream, BI_REFERENCE_BLOCK_ID);
429  emitRecord(R.USR, REFERENCE_USR);
430  emitRecord(R.Name, REFERENCE_NAME);
431  emitRecord(R.QualName, REFERENCE_QUAL_NAME);
432  emitRecord((unsigned)R.RefType, REFERENCE_TYPE);
433  emitRecord(R.Path, REFERENCE_PATH);
434  emitRecord((unsigned)Field, REFERENCE_FIELD);
435 }
436 
438  StreamSubBlockGuard Block(Stream, BI_TYPE_BLOCK_ID);
439  emitBlock(T.Type, FieldId::F_type);
440 }
441 
443  StreamSubBlockGuard Block(Stream, BI_TYPEDEF_BLOCK_ID);
444  emitRecord(T.USR, TYPEDEF_USR);
445  emitRecord(T.Name, TYPEDEF_NAME);
446  for (const auto &N : T.Namespace)
448  for (const auto &CI : T.Description)
449  emitBlock(CI);
450  if (T.DefLoc)
451  emitRecord(*T.DefLoc, TYPEDEF_DEFLOCATION);
452  emitRecord(T.IsUsing, TYPEDEF_IS_USING);
453  emitBlock(T.Underlying);
454 }
455 
457  StreamSubBlockGuard Block(Stream, BI_FIELD_TYPE_BLOCK_ID);
458  emitBlock(T.Type, FieldId::F_type);
459  emitRecord(T.Name, FIELD_TYPE_NAME);
460  emitRecord(T.DefaultValue, FIELD_DEFAULT_VALUE);
461 }
462 
464  StreamSubBlockGuard Block(Stream, BI_MEMBER_TYPE_BLOCK_ID);
465  emitBlock(T.Type, FieldId::F_type);
466  emitRecord(T.Name, MEMBER_TYPE_NAME);
467  emitRecord(T.Access, MEMBER_TYPE_ACCESS);
468  for (const auto &CI : T.Description)
469  emitBlock(CI);
470 }
471 
473  StreamSubBlockGuard Block(Stream, BI_COMMENT_BLOCK_ID);
474  for (const auto &L : std::vector<std::pair<llvm::StringRef, RecordId>>{
475  {I.Kind, COMMENT_KIND},
476  {I.Text, COMMENT_TEXT},
477  {I.Name, COMMENT_NAME},
481  emitRecord(L.first, L.second);
482  emitRecord(I.SelfClosing, COMMENT_SELFCLOSING);
483  emitRecord(I.Explicit, COMMENT_EXPLICIT);
484  for (const auto &A : I.AttrKeys)
485  emitRecord(A, COMMENT_ATTRKEY);
486  for (const auto &A : I.AttrValues)
487  emitRecord(A, COMMENT_ATTRVAL);
488  for (const auto &A : I.Args)
489  emitRecord(A, COMMENT_ARG);
490  for (const auto &C : I.Children)
491  emitBlock(*C);
492 }
493 
495  StreamSubBlockGuard Block(Stream, BI_NAMESPACE_BLOCK_ID);
496  emitRecord(I.USR, NAMESPACE_USR);
497  emitRecord(I.Name, NAMESPACE_NAME);
498  emitRecord(I.Path, NAMESPACE_PATH);
499  for (const auto &N : I.Namespace)
501  for (const auto &CI : I.Description)
502  emitBlock(CI);
503  for (const auto &C : I.Children.Namespaces)
505  for (const auto &C : I.Children.Records)
507  for (const auto &C : I.Children.Functions)
508  emitBlock(C);
509  for (const auto &C : I.Children.Enums)
510  emitBlock(C);
511  for (const auto &C : I.Children.Typedefs)
512  emitBlock(C);
513 }
514 
516  StreamSubBlockGuard Block(Stream, BI_ENUM_BLOCK_ID);
517  emitRecord(I.USR, ENUM_USR);
518  emitRecord(I.Name, ENUM_NAME);
519  for (const auto &N : I.Namespace)
521  for (const auto &CI : I.Description)
522  emitBlock(CI);
523  if (I.DefLoc)
524  emitRecord(*I.DefLoc, ENUM_DEFLOCATION);
525  for (const auto &L : I.Loc)
526  emitRecord(L, ENUM_LOCATION);
527  emitRecord(I.Scoped, ENUM_SCOPED);
528  if (I.BaseType)
529  emitBlock(*I.BaseType);
530  for (const auto &N : I.Members)
531  emitBlock(N);
532 }
533 
535  StreamSubBlockGuard Block(Stream, BI_ENUM_VALUE_BLOCK_ID);
536  emitRecord(I.Name, ENUM_VALUE_NAME);
537  emitRecord(I.Value, ENUM_VALUE_VALUE);
538  emitRecord(I.ValueExpr, ENUM_VALUE_EXPR);
539 }
540 
542  StreamSubBlockGuard Block(Stream, BI_RECORD_BLOCK_ID);
543  emitRecord(I.USR, RECORD_USR);
544  emitRecord(I.Name, RECORD_NAME);
545  emitRecord(I.Path, RECORD_PATH);
546  for (const auto &N : I.Namespace)
548  for (const auto &CI : I.Description)
549  emitBlock(CI);
550  if (I.DefLoc)
551  emitRecord(*I.DefLoc, RECORD_DEFLOCATION);
552  for (const auto &L : I.Loc)
553  emitRecord(L, RECORD_LOCATION);
554  emitRecord(I.TagType, RECORD_TAG_TYPE);
555  emitRecord(I.IsTypeDef, RECORD_IS_TYPE_DEF);
556  for (const auto &N : I.Members)
557  emitBlock(N);
558  for (const auto &P : I.Parents)
560  for (const auto &P : I.VirtualParents)
562  for (const auto &PB : I.Bases)
563  emitBlock(PB);
564  for (const auto &C : I.Children.Records)
566  for (const auto &C : I.Children.Functions)
567  emitBlock(C);
568  for (const auto &C : I.Children.Enums)
569  emitBlock(C);
570  for (const auto &C : I.Children.Typedefs)
571  emitBlock(C);
572  if (I.Template)
573  emitBlock(*I.Template);
574 }
575 
577  StreamSubBlockGuard Block(Stream, BI_BASE_RECORD_BLOCK_ID);
578  emitRecord(I.USR, BASE_RECORD_USR);
579  emitRecord(I.Name, BASE_RECORD_NAME);
580  emitRecord(I.Path, BASE_RECORD_PATH);
581  emitRecord(I.TagType, BASE_RECORD_TAG_TYPE);
582  emitRecord(I.IsVirtual, BASE_RECORD_IS_VIRTUAL);
583  emitRecord(I.Access, BASE_RECORD_ACCESS);
584  emitRecord(I.IsParent, BASE_RECORD_IS_PARENT);
585  for (const auto &M : I.Members)
586  emitBlock(M);
587  for (const auto &C : I.Children.Functions)
588  emitBlock(C);
589 }
590 
592  StreamSubBlockGuard Block(Stream, BI_FUNCTION_BLOCK_ID);
593  emitRecord(I.USR, FUNCTION_USR);
594  emitRecord(I.Name, FUNCTION_NAME);
595  for (const auto &N : I.Namespace)
597  for (const auto &CI : I.Description)
598  emitBlock(CI);
599  emitRecord(I.Access, FUNCTION_ACCESS);
600  emitRecord(I.IsMethod, FUNCTION_IS_METHOD);
601  if (I.DefLoc)
602  emitRecord(*I.DefLoc, FUNCTION_DEFLOCATION);
603  for (const auto &L : I.Loc)
604  emitRecord(L, FUNCTION_LOCATION);
607  for (const auto &N : I.Params)
608  emitBlock(N);
609  if (I.Template)
610  emitBlock(*I.Template);
611 }
612 
614  StreamSubBlockGuard Block(Stream, BI_TEMPLATE_BLOCK_ID);
615  for (const auto &P : T.Params)
616  emitBlock(P);
617  if (T.Specialization)
618  emitBlock(*T.Specialization);
619 }
620 
622  StreamSubBlockGuard Block(Stream, BI_TEMPLATE_SPECIALIZATION_BLOCK_ID);
623  emitRecord(T.SpecializationOf, TEMPLATE_SPECIALIZATION_OF);
624  for (const auto &P : T.Params)
625  emitBlock(P);
626 }
627 
629  StreamSubBlockGuard Block(Stream, BI_TEMPLATE_PARAM_BLOCK_ID);
630  emitRecord(T.Contents, TEMPLATE_PARAM_CONTENTS);
631 }
632 
634  switch (I->IT) {
636  emitBlock(*static_cast<clang::doc::NamespaceInfo *>(I));
637  break;
638  case InfoType::IT_record:
639  emitBlock(*static_cast<clang::doc::RecordInfo *>(I));
640  break;
641  case InfoType::IT_enum:
642  emitBlock(*static_cast<clang::doc::EnumInfo *>(I));
643  break;
645  emitBlock(*static_cast<clang::doc::FunctionInfo *>(I));
646  break;
648  emitBlock(*static_cast<clang::doc::TypedefInfo *>(I));
649  break;
650  default:
651  llvm::errs() << "Unexpected info, unable to write.\n";
652  return true;
653  }
654  return false;
655 }
656 
657 } // namespace doc
658 } // namespace clang
clang::doc::ClangDocBitcodeWriter::dispatchInfoForWrite
bool dispatchInfoForWrite(Info *I)
Definition: BitcodeWriter.cpp:633
clang::doc::EnumValueInfo
Definition: Representation.h:413
clang::doc::FieldId::F_type
@ F_type
clang::doc::BI_VERSION_BLOCK_ID
@ BI_VERSION_BLOCK_ID
Definition: BitcodeWriter.h:54
clang::doc::FieldId::F_child_record
@ F_child_record
clang::doc::BaseRecordInfo::Access
AccessSpecifier Access
Definition: Representation.h:408
Loc
SourceLocation Loc
Definition: KernelNameRestrictionCheck.cpp:43
clang::doc::RecordIdToIndexFunctor
Definition: BitcodeWriter.cpp:26
clang::doc::BitCodeConstants::IntSize
static constexpr unsigned IntSize
Definition: BitcodeWriter.h:40
clang::doc::TypedefInfo
Definition: Representation.h:384
clang::doc::EnumInfo::Members
llvm::SmallVector< EnumValueInfo, 4 > Members
Definition: Representation.h:452
clang::doc::RecordInfo::IsTypeDef
bool IsTypeDef
Definition: Representation.h:366
clang::doc::BitCodeConstants::LineNumberSize
static constexpr unsigned LineNumberSize
Definition: BitcodeWriter.h:43
clang::doc::Info::Description
std::vector< CommentInfo > Description
Definition: Representation.h:279
clang::doc::RecordIdDsc::Abbrev
AbbrevDsc Abbrev
Definition: BitcodeWriter.cpp:92
clang::doc::RecordIdDsc::RecordIdDsc
RecordIdDsc()=default
clang::doc::BI_FUNCTION_BLOCK_ID
@ BI_FUNCTION_BLOCK_ID
Definition: BitcodeWriter.h:63
clang::doc::FIELD_DEFAULT_VALUE
@ FIELD_DEFAULT_VALUE
Definition: BitcodeWriter.h:96
clang::doc::BlockIdToIndexFunctor::operator()
unsigned operator()(unsigned ID) const
Definition: BitcodeWriter.cpp:23
clang::doc::InfoType::IT_enum
@ IT_enum
clang::doc::BlockId
BlockId
Definition: BitcodeWriter.h:53
clang::doc::BitCodeConstants::StringLengthSize
static constexpr unsigned StringLengthSize
Definition: BitcodeWriter.h:41
clang::doc::FUNCTION_DEFLOCATION
@ FUNCTION_DEFLOCATION
Definition: BitcodeWriter.h:80
clang::doc::Info::Name
SmallString< 16 > Name
Definition: Representation.h:276
clang::doc::AbbrevDsc
void(*)(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev) AbbrevDsc
Definition: BitcodeWriter.cpp:31
clang::doc::RECORD_IS_TYPE_DEF
@ RECORD_IS_TYPE_DEF
Definition: BitcodeWriter.h:116
clang::doc::InfoType::IT_namespace
@ IT_namespace
Location
Definition: Modularize.cpp:381
clang::doc::COMMENT_CLOSENAME
@ COMMENT_CLOSENAME
Definition: BitcodeWriter.h:89
clang::doc::ENUM_VALUE_NAME
@ ENUM_VALUE_NAME
Definition: BitcodeWriter.h:107
clang::doc::FunctionInfo
Definition: Representation.h:319
clang::doc::COMMENT_NAME
@ COMMENT_NAME
Definition: BitcodeWriter.h:86
clang::doc::Reference::Path
llvm::SmallString< 128 > Path
Definition: Representation.h:131
clang::doc::RECORD_LOCATION
@ RECORD_LOCATION
Definition: BitcodeWriter.h:114
CI
std::unique_ptr< CompilerInvocation > CI
Definition: TUScheduler.cpp:548
clang::doc::COMMENT_PARAMNAME
@ COMMENT_PARAMNAME
Definition: BitcodeWriter.h:88
clang::doc::CommentInfo
Definition: Representation.h:49
clang::doc::FieldId::F_child_namespace
@ F_child_namespace
clang::doc::BI_BASE_RECORD_BLOCK_ID
@ BI_BASE_RECORD_BLOCK_ID
Definition: BitcodeWriter.h:62
clang::doc::Reference::Name
SmallString< 16 > Name
Definition: Representation.h:119
clang::doc::ENUM_NAME
@ ENUM_NAME
Definition: BitcodeWriter.h:103
clang::doc::BlockIdToIndexFunctor::argument_type
unsigned argument_type
Definition: BitcodeWriter.cpp:22
clang::doc::COMMENT_EXPLICIT
@ COMMENT_EXPLICIT
Definition: BitcodeWriter.h:91
clang::doc::BI_MEMBER_TYPE_BLOCK_ID
@ BI_MEMBER_TYPE_BLOCK_ID
Definition: BitcodeWriter.h:60
clang::doc::InfoType::IT_function
@ IT_function
clang::doc::RecordId
RecordId
Definition: BitcodeWriter.h:76
clang::doc::InfoType::IT_typedef
@ IT_typedef
clang::doc::EnumInfo
Definition: Representation.h:438
clang::doc::CommentInfo::CloseName
SmallString< 16 > CloseName
Definition: Representation.h:73
clang::doc::ScopeChildren::Typedefs
std::vector< TypedefInfo > Typedefs
Definition: Representation.h:147
clang::doc::CommentInfo::Kind
SmallString< 16 > Kind
Definition: Representation.h:64
clang::doc::ScopeChildren::Functions
std::vector< FunctionInfo > Functions
Definition: Representation.h:145
clang::doc::ENUM_USR
@ ENUM_USR
Definition: BitcodeWriter.h:102
clang::doc::BlockIdNameMap
static const llvm::IndexedMap< llvm::StringRef, BlockIdToIndexFunctor > BlockIdNameMap
Definition: BitcodeWriter.cpp:105
clang::doc::BASE_RECORD_PATH
@ BASE_RECORD_PATH
Definition: BitcodeWriter.h:119
clang::doc::CommentInfo::Direction
SmallString< 8 > Direction
Definition: Representation.h:71
clang::doc::CommentInfo::Explicit
bool Explicit
Definition: Representation.h:75
clang::doc::BI_FIRST
@ BI_FIRST
Definition: BitcodeWriter.h:71
clang::doc::RecordInfo::VirtualParents
llvm::SmallVector< Reference, 4 > VirtualParents
Definition: Representation.h:374
clang::doc::RecordIdDsc
Definition: BitcodeWriter.cpp:90
clang::doc::BI_ENUM_VALUE_BLOCK_ID
@ BI_ENUM_VALUE_BLOCK_ID
Definition: BitcodeWriter.h:57
clang::doc::RECORD_PATH
@ RECORD_PATH
Definition: BitcodeWriter.h:112
clang::doc::CommentInfo::Name
SmallString< 16 > Name
Definition: Representation.h:70
clang::doc::NAMESPACE_USR
@ NAMESPACE_USR
Definition: BitcodeWriter.h:99
clang::doc::RI_FIRST
@ RI_FIRST
Definition: BitcodeWriter.h:137
clang::doc::BaseRecordInfo
Definition: Representation.h:399
clang::doc::LocationAbbrev
static void LocationAbbrev(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev)
Definition: BitcodeWriter.cpp:74
clang::doc::RecordInfo::Members
llvm::SmallVector< MemberTypeInfo, 4 > Members
Definition: Representation.h:369
clang::doc::ENUM_SCOPED
@ ENUM_SCOPED
Definition: BitcodeWriter.h:106
clang::doc::Reference::QualName
SmallString< 16 > QualName
Definition: Representation.h:124
clang::doc::REFERENCE_PATH
@ REFERENCE_PATH
Definition: BitcodeWriter.h:128
clang::doc::RecordIdCount
static constexpr unsigned RecordIdCount
Definition: BitcodeWriter.h:141
clang::doc::FieldId::F_namespace
@ F_namespace
clang::doc::SymbolInfo::DefLoc
std::optional< Location > DefLoc
Definition: Representation.h:313
clang::doc::RecordInfo::Bases
std::vector< BaseRecordInfo > Bases
Definition: Representation.h:377
clang::doc::CommentInfo::ParamName
SmallString< 16 > ParamName
Definition: Representation.h:72
clang::doc::BitCodeConstants::SignatureBitSize
static constexpr unsigned SignatureBitSize
Definition: BitcodeWriter.h:37
BitcodeWriter.h
clang::doc::TYPEDEF_NAME
@ TYPEDEF_NAME
Definition: BitcodeWriter.h:133
clang::doc::TEMPLATE_SPECIALIZATION_OF
@ TEMPLATE_SPECIALIZATION_OF
Definition: BitcodeWriter.h:131
clang::doc::MEMBER_TYPE_ACCESS
@ MEMBER_TYPE_ACCESS
Definition: BitcodeWriter.h:98
clang::doc::Info::Path
llvm::SmallString< 128 > Path
Definition: Representation.h:280
clang::doc::TEMPLATE_PARAM_CONTENTS
@ TEMPLATE_PARAM_CONTENTS
Definition: BitcodeWriter.h:130
clang::doc::CommentInfo::Children
std::vector< std::unique_ptr< CommentInfo > > Children
Definition: Representation.h:84
clang::doc::ScopeChildren::Namespaces
std::vector< Reference > Namespaces
Definition: Representation.h:143
M
const google::protobuf::Message & M
Definition: Server.cpp:309
clang::doc::InfoType::IT_record
@ IT_record
clang::doc::CommentInfo::AttrKeys
llvm::SmallVector< SmallString< 16 >, 4 > AttrKeys
Definition: Representation.h:78
clang::doc::FunctionInfo::Parent
Reference Parent
Definition: Representation.h:326
clang::doc::BitCodeConstants::SubblockIDSize
static constexpr unsigned SubblockIDSize
Definition: BitcodeWriter.h:38
clang::doc::TYPEDEF_IS_USING
@ TYPEDEF_IS_USING
Definition: BitcodeWriter.h:135
clang::doc::EnumValueInfo::ValueExpr
SmallString< 16 > ValueExpr
Definition: Representation.h:433
clang::doc::StringAbbrev
static void StringAbbrev(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev)
Definition: BitcodeWriter.cpp:64
ns1::ns2::A
@ A
Definition: CategoricalFeature.h:3
clang::doc::RecordIdToIndexFunctor::operator()
unsigned operator()(unsigned ID) const
Definition: BitcodeWriter.cpp:28
clang::doc::EnumValueInfo::Value
SmallString< 16 > Value
Definition: Representation.h:429
clang::doc::BASE_RECORD_IS_PARENT
@ BASE_RECORD_IS_PARENT
Definition: BitcodeWriter.h:123
clang::doc::FUNCTION_USR
@ FUNCTION_USR
Definition: BitcodeWriter.h:78
clang::doc::NAMESPACE_PATH
@ NAMESPACE_PATH
Definition: BitcodeWriter.h:101
clang::doc::TYPEDEF_DEFLOCATION
@ TYPEDEF_DEFLOCATION
Definition: BitcodeWriter.h:134
clang::doc::FieldId::F_vparent
@ F_vparent
clang::doc::CommentInfo::Text
SmallString< 64 > Text
Definition: Representation.h:69
clang::doc::RecordInfo::Children
ScopeChildren Children
Definition: Representation.h:380
clang::doc::BASE_RECORD_USR
@ BASE_RECORD_USR
Definition: BitcodeWriter.h:117
clang::doc::RecordInfo::Template
std::optional< TemplateInfo > Template
Definition: Representation.h:360
clang::doc::SymbolInfo::Loc
llvm::SmallVector< Location, 2 > Loc
Definition: Representation.h:314
clang::doc::TYPEDEF_USR
@ TYPEDEF_USR
Definition: BitcodeWriter.h:132
clang::doc::COMMENT_DIRECTION
@ COMMENT_DIRECTION
Definition: BitcodeWriter.h:87
clang::doc::BitCodeConstants::BoolSize
static constexpr unsigned BoolSize
Definition: BitcodeWriter.h:39
clang::doc::BitCodeConstants::USRBitLengthSize
static constexpr unsigned USRBitLengthSize
Definition: BitcodeWriter.h:46
clang::doc::BlockIdCount
static constexpr unsigned BlockIdCount
Definition: BitcodeWriter.h:140
clang::doc::RecordInfo::Parents
llvm::SmallVector< Reference, 4 > Parents
Definition: Representation.h:370
clang::doc::RECORD_USR
@ RECORD_USR
Definition: BitcodeWriter.h:110
clang::doc::AbbrevGen
static void AbbrevGen(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev, const std::initializer_list< llvm::BitCodeAbbrevOp > Ops)
Definition: BitcodeWriter.cpp:33
clang::doc::BaseRecordInfo::IsVirtual
bool IsVirtual
Definition: Representation.h:405
clang::doc::REFERENCE_FIELD
@ REFERENCE_FIELD
Definition: BitcodeWriter.h:129
clang::doc::REFERENCE_NAME
@ REFERENCE_NAME
Definition: BitcodeWriter.h:125
clang::doc::Info::USR
SymbolID USR
Definition: Representation.h:273
clang::doc::FunctionInfo::Access
AccessSpecifier Access
Definition: Representation.h:333
clang::doc::BitCodeConstants::USRLengthSize
static constexpr unsigned USRLengthSize
Definition: BitcodeWriter.h:45
clang::doc::FunctionInfo::Params
llvm::SmallVector< FieldTypeInfo, 4 > Params
Definition: Representation.h:328
clang::doc::RECORD_NAME
@ RECORD_NAME
Definition: BitcodeWriter.h:111
clang::doc::SymbolID
std::array< uint8_t, 20 > SymbolID
Definition: Representation.h:31
Name
Token Name
Definition: MacroToEnumCheck.cpp:87
clang::doc::ScopeChildren::Enums
std::vector< EnumInfo > Enums
Definition: Representation.h:146
clang::doc::REFERENCE_USR
@ REFERENCE_USR
Definition: BitcodeWriter.h:124
clang::doc::TemplateParamInfo
Definition: Representation.h:170
clang::doc::RecordInfo
Definition: Representation.h:346
clang::doc::EmptySID
static const SymbolID EmptySID
Definition: BitcodeWriter.cpp:17
clang::doc::BitCodeConstants::Signature
static constexpr unsigned char Signature[4]
Definition: BitcodeWriter.h:47
clang::doc::ENUM_VALUE_VALUE
@ ENUM_VALUE_VALUE
Definition: BitcodeWriter.h:108
clang::doc::ENUM_LOCATION
@ ENUM_LOCATION
Definition: BitcodeWriter.h:105
clang::doc::TemplateInfo
Definition: Representation.h:190
clang::doc::BASE_RECORD_IS_VIRTUAL
@ BASE_RECORD_IS_VIRTUAL
Definition: BitcodeWriter.h:121
clang::doc::BaseRecordInfo::IsParent
bool IsParent
Definition: Representation.h:409
clang::doc::BASE_RECORD_TAG_TYPE
@ BASE_RECORD_TAG_TYPE
Definition: BitcodeWriter.h:120
clang::doc::TemplateSpecializationInfo
Definition: Representation.h:180
clang::doc::BI_COMMENT_BLOCK_ID
@ BI_COMMENT_BLOCK_ID
Definition: BitcodeWriter.h:64
clang::doc::BASE_RECORD_ACCESS
@ BASE_RECORD_ACCESS
Definition: BitcodeWriter.h:122
clang::doc::Info
A base struct for Infos.
Definition: Representation.h:263
clang::doc::COMMENT_SELFCLOSING
@ COMMENT_SELFCLOSING
Definition: BitcodeWriter.h:90
clang::doc::Reference::USR
SymbolID USR
Definition: Representation.h:114
clang::doc::Reference
Definition: Representation.h:87
clang::doc::BI_RECORD_BLOCK_ID
@ BI_RECORD_BLOCK_ID
Definition: BitcodeWriter.h:61
clang::doc::BI_REFERENCE_BLOCK_ID
@ BI_REFERENCE_BLOCK_ID
Definition: BitcodeWriter.h:65
clang::doc::BlockIdToIndexFunctor
Definition: BitcodeWriter.cpp:21
clang::doc::REFERENCE_TYPE
@ REFERENCE_TYPE
Definition: BitcodeWriter.h:127
clang::doc::FIELD_TYPE_NAME
@ FIELD_TYPE_NAME
Definition: BitcodeWriter.h:95
clang::doc::ENUM_DEFLOCATION
@ ENUM_DEFLOCATION
Definition: BitcodeWriter.h:104
clang::doc::Info::IT
const InfoType IT
Definition: Representation.h:275
clang::doc::ScopeChildren::Records
std::vector< Reference > Records
Definition: Representation.h:144
clang::doc::VERSION
@ VERSION
Definition: BitcodeWriter.h:77
clang::doc::BI_TEMPLATE_PARAM_BLOCK_ID
@ BI_TEMPLATE_PARAM_BLOCK_ID
Definition: BitcodeWriter.h:68
ID
static char ID
Definition: Logger.cpp:74
clang::doc::NamespaceInfo::Children
ScopeChildren Children
Definition: Representation.h:302
clang::doc::RecordIdDsc::RecordIdDsc
RecordIdDsc(llvm::StringRef Name, AbbrevDsc Abbrev)
Definition: BitcodeWriter.cpp:95
clang::doc::BoolAbbrev
static void BoolAbbrev(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev)
Definition: BitcodeWriter.cpp:39
clang::doc::Reference::RefType
InfoType RefType
Definition: Representation.h:126
clang::doc::RecordsByBlock
static const std::vector< std::pair< BlockId, std::vector< RecordId > > > RecordsByBlock
Definition: BitcodeWriter.cpp:212
clang::doc::RecordIdToIndexFunctor::argument_type
unsigned argument_type
Definition: BitcodeWriter.cpp:27
clang::doc::RecordIdNameMap
static const llvm::IndexedMap< RecordIdDsc, RecordIdToIndexFunctor > RecordIdNameMap
Definition: BitcodeWriter.cpp:136
clang::doc::VersionNumber
static const unsigned VersionNumber
Definition: BitcodeWriter.h:33
clang::doc::FUNCTION_LOCATION
@ FUNCTION_LOCATION
Definition: BitcodeWriter.h:81
clang::doc::BI_FIELD_TYPE_BLOCK_ID
@ BI_FIELD_TYPE_BLOCK_ID
Definition: BitcodeWriter.h:59
clang::doc::COMMENT_ATTRVAL
@ COMMENT_ATTRVAL
Definition: BitcodeWriter.h:93
clang::doc::CommentInfo::SelfClosing
bool SelfClosing
Definition: Representation.h:74
C
const Criteria C
Definition: FunctionCognitiveComplexityCheck.cpp:91
clang::doc::MEMBER_TYPE_NAME
@ MEMBER_TYPE_NAME
Definition: BitcodeWriter.h:97
clang::doc::FunctionInfo::ReturnType
TypeInfo ReturnType
Definition: Representation.h:327
clang::doc::BASE_RECORD_NAME
@ BASE_RECORD_NAME
Definition: BitcodeWriter.h:118
clang::doc::EnumInfo::BaseType
std::optional< TypeInfo > BaseType
Definition: Representation.h:450
clang::doc::COMMENT_TEXT
@ COMMENT_TEXT
Definition: BitcodeWriter.h:85
clang::doc::BitCodeConstants::RecordSize
static constexpr unsigned RecordSize
Definition: BitcodeWriter.h:36
clang::doc::BI_TEMPLATE_BLOCK_ID
@ BI_TEMPLATE_BLOCK_ID
Definition: BitcodeWriter.h:66
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::doc::NamespaceInfo
Definition: Representation.h:296
clang::doc::FieldId::F_parent
@ F_parent
clang::doc::RECORD_TAG_TYPE
@ RECORD_TAG_TYPE
Definition: BitcodeWriter.h:115
clang::doc::FUNCTION_NAME
@ FUNCTION_NAME
Definition: BitcodeWriter.h:79
clang::doc::COMMENT_ATTRKEY
@ COMMENT_ATTRKEY
Definition: BitcodeWriter.h:92
clang::doc::EnumValueInfo::Name
SmallString< 16 > Name
Definition: Representation.h:424
clang::doc::BI_TEMPLATE_SPECIALIZATION_BLOCK_ID
@ BI_TEMPLATE_SPECIALIZATION_BLOCK_ID
Definition: BitcodeWriter.h:67
clang::doc::RecordInfo::TagType
TagTypeKind TagType
Definition: Representation.h:353
clang::doc::TypeInfo
Definition: Representation.h:151
clang::doc::CommentInfo::AttrValues
llvm::SmallVector< SmallString< 16 >, 4 > AttrValues
Definition: Representation.h:80
clang::doc::ClangDocBitcodeWriter::emitBlock
void emitBlock(const NamespaceInfo &I)
Definition: BitcodeWriter.cpp:494
clang::doc::FunctionInfo::Template
std::optional< TemplateInfo > Template
Definition: Representation.h:340
clang::doc::BI_NAMESPACE_BLOCK_ID
@ BI_NAMESPACE_BLOCK_ID
Definition: BitcodeWriter.h:55
clang::doc::RECORD_DEFLOCATION
@ RECORD_DEFLOCATION
Definition: BitcodeWriter.h:113
clang::doc::RecordIdDsc::Name
llvm::StringRef Name
Definition: BitcodeWriter.cpp:91
Field
const FieldDecl * Field
Definition: MemberwiseConstructor.cpp:260
clang::doc::CommentInfo::Args
llvm::SmallVector< SmallString< 16 >, 4 > Args
Definition: Representation.h:82
clang::doc::COMMENT_KIND
@ COMMENT_KIND
Definition: BitcodeWriter.h:84
clang::doc::COMMENT_ARG
@ COMMENT_ARG
Definition: BitcodeWriter.h:94
clang::doc::ENUM_VALUE_EXPR
@ ENUM_VALUE_EXPR
Definition: BitcodeWriter.h:109
clang::doc::IntAbbrev
static void IntAbbrev(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev)
Definition: BitcodeWriter.cpp:46
clang::doc::FieldTypeInfo
Definition: Representation.h:199
clang::doc::FUNCTION_IS_METHOD
@ FUNCTION_IS_METHOD
Definition: BitcodeWriter.h:83
clang::doc::BI_TYPEDEF_BLOCK_ID
@ BI_TYPEDEF_BLOCK_ID
Definition: BitcodeWriter.h:69
clang::doc::MemberTypeInfo
Definition: Representation.h:218
clang::doc::REFERENCE_QUAL_NAME
@ REFERENCE_QUAL_NAME
Definition: BitcodeWriter.h:126
clang::doc::BI_TYPE_BLOCK_ID
@ BI_TYPE_BLOCK_ID
Definition: BitcodeWriter.h:58
clang::doc::Info::Namespace
llvm::SmallVector< Reference, 4 > Namespace
Definition: Representation.h:278
clang::doc::BI_ENUM_BLOCK_ID
@ BI_ENUM_BLOCK_ID
Definition: BitcodeWriter.h:56
clang::doc::FieldId
FieldId
Definition: BitcodeWriter.h:144
clang::doc::EnumInfo::Scoped
bool Scoped
Definition: Representation.h:445
clang::doc::FUNCTION_ACCESS
@ FUNCTION_ACCESS
Definition: BitcodeWriter.h:82
clang::doc::FunctionInfo::IsMethod
bool IsMethod
Definition: Representation.h:325
clang::doc::SymbolIDAbbrev
static void SymbolIDAbbrev(std::shared_ptr< llvm::BitCodeAbbrev > &Abbrev)
Definition: BitcodeWriter.cpp:53
clang::doc::NAMESPACE_NAME
@ NAMESPACE_NAME
Definition: BitcodeWriter.h:100