clang-tools  16.0.0git
YAMLGenerator.cpp
Go to the documentation of this file.
1 //===-- YAMLGenerator.cpp - ClangDoc YAML -----------------------*- 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 // Implementation of the YAML generator, converting decl info into YAML output.
9 //===----------------------------------------------------------------------===//
10 
11 #include "Generators.h"
12 #include "llvm/Support/YAMLTraits.h"
13 #include "llvm/Support/raw_ostream.h"
14 
15 using namespace clang::doc;
16 
17 // These define YAML traits for decoding the listed values within a vector.
18 LLVM_YAML_IS_SEQUENCE_VECTOR(FieldTypeInfo)
19 LLVM_YAML_IS_SEQUENCE_VECTOR(MemberTypeInfo)
20 LLVM_YAML_IS_SEQUENCE_VECTOR(Reference)
21 LLVM_YAML_IS_SEQUENCE_VECTOR(Location)
22 LLVM_YAML_IS_SEQUENCE_VECTOR(CommentInfo)
23 LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionInfo)
24 LLVM_YAML_IS_SEQUENCE_VECTOR(EnumInfo)
25 LLVM_YAML_IS_SEQUENCE_VECTOR(EnumValueInfo)
26 LLVM_YAML_IS_SEQUENCE_VECTOR(BaseRecordInfo)
27 LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr<CommentInfo>)
28 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::SmallString<16>)
29 
30 namespace llvm {
31 namespace yaml {
32 
33 // Enumerations to YAML output.
34 
35 template <> struct ScalarEnumerationTraits<clang::AccessSpecifier> {
36  static void enumeration(IO &IO, clang::AccessSpecifier &Value) {
37  IO.enumCase(Value, "Public", clang::AccessSpecifier::AS_public);
38  IO.enumCase(Value, "Protected", clang::AccessSpecifier::AS_protected);
39  IO.enumCase(Value, "Private", clang::AccessSpecifier::AS_private);
40  IO.enumCase(Value, "None", clang::AccessSpecifier::AS_none);
41  }
42 };
43 
44 template <> struct ScalarEnumerationTraits<clang::TagTypeKind> {
45  static void enumeration(IO &IO, clang::TagTypeKind &Value) {
46  IO.enumCase(Value, "Struct", clang::TagTypeKind::TTK_Struct);
47  IO.enumCase(Value, "Interface", clang::TagTypeKind::TTK_Interface);
48  IO.enumCase(Value, "Union", clang::TagTypeKind::TTK_Union);
49  IO.enumCase(Value, "Class", clang::TagTypeKind::TTK_Class);
50  IO.enumCase(Value, "Enum", clang::TagTypeKind::TTK_Enum);
51  }
52 };
53 
54 template <> struct ScalarEnumerationTraits<InfoType> {
55  static void enumeration(IO &IO, InfoType &Value) {
56  IO.enumCase(Value, "Namespace", InfoType::IT_namespace);
57  IO.enumCase(Value, "Record", InfoType::IT_record);
58  IO.enumCase(Value, "Function", InfoType::IT_function);
59  IO.enumCase(Value, "Enum", InfoType::IT_enum);
60  IO.enumCase(Value, "Default", InfoType::IT_default);
61  }
62 };
63 
64 // Scalars to YAML output.
65 template <unsigned U> struct ScalarTraits<SmallString<U>> {
66 
67  static void output(const SmallString<U> &S, void *, llvm::raw_ostream &OS) {
68  for (const auto &C : S)
69  OS << C;
70  }
71 
72  static StringRef input(StringRef Scalar, void *, SmallString<U> &Value) {
73  Value.assign(Scalar.begin(), Scalar.end());
74  return StringRef();
75  }
76 
77  static QuotingType mustQuote(StringRef) { return QuotingType::Single; }
78 };
79 
80 template <> struct ScalarTraits<std::array<unsigned char, 20>> {
81 
82  static void output(const std::array<unsigned char, 20> &S, void *,
83  llvm::raw_ostream &OS) {
84  OS << toHex(toStringRef(S));
85  }
86 
87  static StringRef input(StringRef Scalar, void *,
88  std::array<unsigned char, 20> &Value) {
89  if (Scalar.size() != 40)
90  return "Error: Incorrect scalar size for USR.";
91  Value = StringToSymbol(Scalar);
92  return StringRef();
93  }
94 
95  static SymbolID StringToSymbol(llvm::StringRef Value) {
96  SymbolID USR;
97  std::string HexString = fromHex(Value);
98  std::copy(HexString.begin(), HexString.end(), USR.begin());
99  return SymbolID(USR);
100  }
101 
102  static QuotingType mustQuote(StringRef) { return QuotingType::Single; }
103 };
104 
105 // Helper functions to map infos to YAML.
106 
107 static void TypeInfoMapping(IO &IO, TypeInfo &I) {
108  IO.mapOptional("Type", I.Type, Reference());
109 }
110 
111 static void FieldTypeInfoMapping(IO &IO, FieldTypeInfo &I) {
112  TypeInfoMapping(IO, I);
113  IO.mapOptional("Name", I.Name, SmallString<16>());
114  IO.mapOptional("DefaultValue", I.DefaultValue, SmallString<16>());
115 }
116 
117 static void InfoMapping(IO &IO, Info &I) {
118  IO.mapRequired("USR", I.USR);
119  IO.mapOptional("Name", I.Name, SmallString<16>());
120  IO.mapOptional("Path", I.Path, SmallString<128>());
121  IO.mapOptional("Namespace", I.Namespace, llvm::SmallVector<Reference, 4>());
122  IO.mapOptional("Description", I.Description);
123 }
124 
125 static void SymbolInfoMapping(IO &IO, SymbolInfo &I) {
126  InfoMapping(IO, I);
127  IO.mapOptional("DefLocation", I.DefLoc, Optional<Location>());
128  IO.mapOptional("Location", I.Loc, llvm::SmallVector<Location, 2>());
129 }
130 
131 static void RecordInfoMapping(IO &IO, RecordInfo &I) {
132  SymbolInfoMapping(IO, I);
133  IO.mapOptional("TagType", I.TagType);
134  IO.mapOptional("IsTypeDef", I.IsTypeDef, false);
135  IO.mapOptional("Members", I.Members);
136  IO.mapOptional("Bases", I.Bases);
137  IO.mapOptional("Parents", I.Parents, llvm::SmallVector<Reference, 4>());
138  IO.mapOptional("VirtualParents", I.VirtualParents,
139  llvm::SmallVector<Reference, 4>());
140  IO.mapOptional("ChildRecords", I.ChildRecords, std::vector<Reference>());
141  IO.mapOptional("ChildFunctions", I.ChildFunctions);
142  IO.mapOptional("ChildEnums", I.ChildEnums);
143 }
144 
145 static void CommentInfoMapping(IO &IO, CommentInfo &I) {
146  IO.mapOptional("Kind", I.Kind, SmallString<16>());
147  IO.mapOptional("Text", I.Text, SmallString<64>());
148  IO.mapOptional("Name", I.Name, SmallString<16>());
149  IO.mapOptional("Direction", I.Direction, SmallString<8>());
150  IO.mapOptional("ParamName", I.ParamName, SmallString<16>());
151  IO.mapOptional("CloseName", I.CloseName, SmallString<16>());
152  IO.mapOptional("SelfClosing", I.SelfClosing, false);
153  IO.mapOptional("Explicit", I.Explicit, false);
154  IO.mapOptional("Args", I.Args, llvm::SmallVector<SmallString<16>, 4>());
155  IO.mapOptional("AttrKeys", I.AttrKeys,
156  llvm::SmallVector<SmallString<16>, 4>());
157  IO.mapOptional("AttrValues", I.AttrValues,
158  llvm::SmallVector<SmallString<16>, 4>());
159  IO.mapOptional("Children", I.Children);
160 }
161 
162 // Template specialization to YAML traits for Infos.
163 
164 template <> struct MappingTraits<Location> {
165  static void mapping(IO &IO, Location &Loc) {
166  IO.mapOptional("LineNumber", Loc.LineNumber, 0);
167  IO.mapOptional("Filename", Loc.Filename, SmallString<32>());
168  }
169 };
170 
171 template <> struct MappingTraits<Reference> {
172  static void mapping(IO &IO, Reference &Ref) {
173  IO.mapOptional("Type", Ref.RefType, InfoType::IT_default);
174  IO.mapOptional("Name", Ref.Name, SmallString<16>());
175  IO.mapOptional("USR", Ref.USR, SymbolID());
176  IO.mapOptional("Path", Ref.Path, SmallString<128>());
177  IO.mapOptional("IsInGlobalNamespace", Ref.IsInGlobalNamespace, false);
178  }
179 };
180 
181 template <> struct MappingTraits<TypeInfo> {
182  static void mapping(IO &IO, TypeInfo &I) { TypeInfoMapping(IO, I); }
183 };
184 
185 template <> struct MappingTraits<FieldTypeInfo> {
186  static void mapping(IO &IO, FieldTypeInfo &I) {
187  TypeInfoMapping(IO, I);
188  IO.mapOptional("Name", I.Name, SmallString<16>());
189  IO.mapOptional("DefaultValue", I.DefaultValue, SmallString<16>());
190  }
191 };
192 
193 template <> struct MappingTraits<MemberTypeInfo> {
194  static void mapping(IO &IO, MemberTypeInfo &I) {
195  FieldTypeInfoMapping(IO, I);
196  // clang::AccessSpecifier::AS_none is used as the default here because it's
197  // the AS that shouldn't be part of the output. Even though AS_public is the
198  // default in the struct, it should be displayed in the YAML output.
199  IO.mapOptional("Access", I.Access, clang::AccessSpecifier::AS_none);
200  IO.mapOptional("Description", I.Description);
201  }
202 };
203 
204 template <> struct MappingTraits<NamespaceInfo> {
205  static void mapping(IO &IO, NamespaceInfo &I) {
206  InfoMapping(IO, I);
207  IO.mapOptional("ChildNamespaces", I.ChildNamespaces,
208  std::vector<Reference>());
209  IO.mapOptional("ChildRecords", I.ChildRecords, std::vector<Reference>());
210  IO.mapOptional("ChildFunctions", I.ChildFunctions);
211  IO.mapOptional("ChildEnums", I.ChildEnums);
212  }
213 };
214 
215 template <> struct MappingTraits<RecordInfo> {
216  static void mapping(IO &IO, RecordInfo &I) { RecordInfoMapping(IO, I); }
217 };
218 
219 template <> struct MappingTraits<BaseRecordInfo> {
220  static void mapping(IO &IO, BaseRecordInfo &I) {
221  RecordInfoMapping(IO, I);
222  IO.mapOptional("IsVirtual", I.IsVirtual, false);
223  // clang::AccessSpecifier::AS_none is used as the default here because it's
224  // the AS that shouldn't be part of the output. Even though AS_public is the
225  // default in the struct, it should be displayed in the YAML output.
226  IO.mapOptional("Access", I.Access, clang::AccessSpecifier::AS_none);
227  IO.mapOptional("IsParent", I.IsParent, false);
228  }
229 };
230 
231 template <> struct MappingTraits<EnumValueInfo> {
232  static void mapping(IO &IO, EnumValueInfo &I) {
233  IO.mapOptional("Name", I.Name);
234  IO.mapOptional("Value", I.Value);
235  IO.mapOptional("Expr", I.ValueExpr, SmallString<16>());
236  }
237 };
238 
239 template <> struct MappingTraits<EnumInfo> {
240  static void mapping(IO &IO, EnumInfo &I) {
241  SymbolInfoMapping(IO, I);
242  IO.mapOptional("Scoped", I.Scoped, false);
243  IO.mapOptional("BaseType", I.BaseType);
244  IO.mapOptional("Members", I.Members);
245  }
246 };
247 
248 template <> struct MappingTraits<FunctionInfo> {
249  static void mapping(IO &IO, FunctionInfo &I) {
250  SymbolInfoMapping(IO, I);
251  IO.mapOptional("IsMethod", I.IsMethod, false);
252  IO.mapOptional("Parent", I.Parent, Reference());
253  IO.mapOptional("Params", I.Params);
254  IO.mapOptional("ReturnType", I.ReturnType);
255  // clang::AccessSpecifier::AS_none is used as the default here because it's
256  // the AS that shouldn't be part of the output. Even though AS_public is the
257  // default in the struct, it should be displayed in the YAML output.
258  IO.mapOptional("Access", I.Access, clang::AccessSpecifier::AS_none);
259  }
260 };
261 
262 template <> struct MappingTraits<CommentInfo> {
263  static void mapping(IO &IO, CommentInfo &I) { CommentInfoMapping(IO, I); }
264 };
265 
266 template <> struct MappingTraits<std::unique_ptr<CommentInfo>> {
267  static void mapping(IO &IO, std::unique_ptr<CommentInfo> &I) {
268  if (I)
269  CommentInfoMapping(IO, *I);
270  }
271 };
272 
273 } // end namespace yaml
274 } // end namespace llvm
275 
276 namespace clang {
277 namespace doc {
278 
279 /// Generator for YAML documentation.
280 class YAMLGenerator : public Generator {
281 public:
282  static const char *Format;
283 
284  llvm::Error generateDocForInfo(Info *I, llvm::raw_ostream &OS,
285  const ClangDocContext &CDCtx) override;
286 };
287 
288 const char *YAMLGenerator::Format = "yaml";
289 
290 llvm::Error YAMLGenerator::generateDocForInfo(Info *I, llvm::raw_ostream &OS,
291  const ClangDocContext &CDCtx) {
292  llvm::yaml::Output InfoYAML(OS);
293  switch (I->IT) {
295  InfoYAML << *static_cast<clang::doc::NamespaceInfo *>(I);
296  break;
297  case InfoType::IT_record:
298  InfoYAML << *static_cast<clang::doc::RecordInfo *>(I);
299  break;
300  case InfoType::IT_enum:
301  InfoYAML << *static_cast<clang::doc::EnumInfo *>(I);
302  break;
304  InfoYAML << *static_cast<clang::doc::FunctionInfo *>(I);
305  break;
307  return llvm::createStringError(llvm::inconvertibleErrorCode(),
308  "unexpected InfoType");
309  }
310  return llvm::Error::success();
311 }
312 
313 static GeneratorRegistry::Add<YAMLGenerator> YAML(YAMLGenerator::Format,
314  "Generator for YAML output.");
315 
316 // This anchor is used to force the linker to link in the generated object file
317 // and thus register the generator.
318 volatile int YAMLGeneratorAnchorSource = 0;
319 
320 } // namespace doc
321 } // namespace clang
llvm::yaml::RecordInfoMapping
static void RecordInfoMapping(IO &IO, RecordInfo &I)
Definition: YAMLGenerator.cpp:131
clang::doc::EnumValueInfo
Definition: Representation.h:402
clang::doc::YAML
static GeneratorRegistry::Add< YAMLGenerator > YAML(YAMLGenerator::Format, "Generator for YAML output.")
clang::doc::BaseRecordInfo::Access
AccessSpecifier Access
Definition: Representation.h:397
Loc
SourceLocation Loc
Definition: KernelNameRestrictionCheck.cpp:45
clang::doc::MemberTypeInfo::Description
std::vector< CommentInfo > Description
Definition: Representation.h:220
clang::doc
Definition: BitcodeReader.cpp:16
llvm
Some operations such as code completion produce a set of candidates.
Definition: YAMLGenerator.cpp:30
clang::doc::EnumInfo::Members
llvm::SmallVector< EnumValueInfo, 4 > Members
Definition: Representation.h:441
clang::doc::RecordInfo::IsTypeDef
bool IsTypeDef
Definition: Representation.h:364
clang::doc::Info::Description
std::vector< CommentInfo > Description
Definition: Representation.h:270
clang::doc::NamespaceInfo::ChildEnums
std::vector< EnumInfo > ChildEnums
Definition: Representation.h:308
clang::doc::YAMLGenerator::generateDocForInfo
llvm::Error generateDocForInfo(Info *I, llvm::raw_ostream &OS, const ClangDocContext &CDCtx) override
Definition: YAMLGenerator.cpp:290
llvm::yaml::ScalarTraits< std::array< unsigned char, 20 > >::mustQuote
static QuotingType mustQuote(StringRef)
Definition: YAMLGenerator.cpp:102
clang::doc::InfoType::IT_enum
@ IT_enum
clang::doc::NamespaceInfo::ChildFunctions
std::vector< FunctionInfo > ChildFunctions
Definition: Representation.h:307
clang::doc::Info::Name
SmallString< 16 > Name
Definition: Representation.h:267
llvm::yaml::MappingTraits< MemberTypeInfo >::mapping
static void mapping(IO &IO, MemberTypeInfo &I)
Definition: YAMLGenerator.cpp:194
llvm::yaml::ScalarTraits< std::array< unsigned char, 20 > >::output
static void output(const std::array< unsigned char, 20 > &S, void *, llvm::raw_ostream &OS)
Definition: YAMLGenerator.cpp:82
clang::doc::InfoType::IT_namespace
@ IT_namespace
llvm::yaml::MappingTraits< EnumValueInfo >::mapping
static void mapping(IO &IO, EnumValueInfo &I)
Definition: YAMLGenerator.cpp:232
USR
std::string USR
Definition: SymbolInfoTests.cpp:25
clang::doc::FunctionInfo
Definition: Representation.h:327
clang::doc::YAMLGeneratorAnchorSource
volatile int YAMLGeneratorAnchorSource
Definition: YAMLGenerator.cpp:318
clang::doc::FieldTypeInfo::Name
SmallString< 16 > Name
Definition: Representation.h:189
llvm::yaml::SymbolInfoMapping
static void SymbolInfoMapping(IO &IO, SymbolInfo &I)
Definition: YAMLGenerator.cpp:125
clang::doc::InfoType
InfoType
Definition: Representation.h:38
clang::doc::NamespaceInfo::ChildNamespaces
std::vector< Reference > ChildNamespaces
Definition: Representation.h:305
clang::doc::CommentInfo
Definition: Representation.h:47
clang::doc::YAMLGenerator
Generator for YAML documentation.
Definition: YAMLGenerator.cpp:280
clang::doc::InfoType::IT_function
@ IT_function
clang::doc::EnumInfo
Definition: Representation.h:427
clang::doc::CommentInfo::CloseName
SmallString< 16 > CloseName
Definition: Representation.h:102
llvm::yaml::InfoMapping
static void InfoMapping(IO &IO, Info &I)
Definition: YAMLGenerator.cpp:117
clang::doc::CommentInfo::Kind
SmallString< 16 > Kind
Definition: Representation.h:93
clang::doc::CommentInfo::Direction
SmallString< 8 > Direction
Definition: Representation.h:100
clang::doc::CommentInfo::Explicit
bool Explicit
Definition: Representation.h:104
clang::doc::RecordInfo::VirtualParents
llvm::SmallVector< Reference, 4 > VirtualParents
Definition: Representation.h:372
llvm::yaml::ScalarEnumerationTraits< clang::AccessSpecifier >::enumeration
static void enumeration(IO &IO, clang::AccessSpecifier &Value)
Definition: YAMLGenerator.cpp:36
llvm::yaml::ScalarTraits< SmallString< U > >::output
static void output(const SmallString< U > &S, void *, llvm::raw_ostream &OS)
Definition: YAMLGenerator.cpp:67
clang::doc::CommentInfo::Name
SmallString< 16 > Name
Definition: Representation.h:99
llvm::yaml::ScalarTraits< SmallString< U > >::mustQuote
static QuotingType mustQuote(StringRef)
Definition: YAMLGenerator.cpp:77
clang::doc::BaseRecordInfo
Definition: Representation.h:386
clang::doc::RecordInfo::Members
llvm::SmallVector< MemberTypeInfo, 4 > Members
Definition: Representation.h:367
clang::doc::Location
Definition: Representation.h:223
clang::doc::RecordInfo::Bases
std::vector< BaseRecordInfo > Bases
Definition: Representation.h:375
clang::doc::CommentInfo::ParamName
SmallString< 16 > ParamName
Definition: Representation.h:101
clang::doc::Info::Path
llvm::SmallString< 128 > Path
Definition: Representation.h:271
clang::doc::CommentInfo::Children
std::vector< std::unique_ptr< CommentInfo > > Children
Definition: Representation.h:113
clang::doc::InfoType::IT_record
@ IT_record
clang::doc::CommentInfo::AttrKeys
llvm::SmallVector< SmallString< 16 >, 4 > AttrKeys
Definition: Representation.h:107
clang::doc::FunctionInfo::Parent
Reference Parent
Definition: Representation.h:334
clang::doc::EnumValueInfo::ValueExpr
SmallString< 16 > ValueExpr
Definition: Representation.h:422
clang::doc::EnumValueInfo::Value
SmallString< 16 > Value
Definition: Representation.h:418
clang::doc::CommentInfo::Text
SmallString< 64 > Text
Definition: Representation.h:98
clang::doc::ClangDocContext
Definition: Representation.h:469
llvm::yaml::MappingTraits< NamespaceInfo >::mapping
static void mapping(IO &IO, NamespaceInfo &I)
Definition: YAMLGenerator.cpp:205
clang::doc::RecordInfo::Parents
llvm::SmallVector< Reference, 4 > Parents
Definition: Representation.h:368
llvm::yaml::MappingTraits< RecordInfo >::mapping
static void mapping(IO &IO, RecordInfo &I)
Definition: YAMLGenerator.cpp:216
clang::doc::MemberTypeInfo::Access
AccessSpecifier Access
Definition: Representation.h:218
clang::doc::BaseRecordInfo::IsVirtual
bool IsVirtual
Definition: Representation.h:394
clang::doc::Info::USR
SymbolID USR
Definition: Representation.h:264
llvm::yaml::TypeInfoMapping
static void TypeInfoMapping(IO &IO, TypeInfo &I)
Definition: YAMLGenerator.cpp:107
clang::doc::FunctionInfo::Access
AccessSpecifier Access
Definition: Representation.h:341
clang::doc::FunctionInfo::Params
llvm::SmallVector< FieldTypeInfo, 4 > Params
Definition: Representation.h:336
clang::doc::InfoType::IT_default
@ IT_default
clang::doc::SymbolID
std::array< uint8_t, 20 > SymbolID
Definition: Representation.h:31
clang::doc::RecordInfo
Definition: Representation.h:347
llvm::yaml::MappingTraits< CommentInfo >::mapping
static void mapping(IO &IO, CommentInfo &I)
Definition: YAMLGenerator.cpp:263
llvm::yaml::MappingTraits< EnumInfo >::mapping
static void mapping(IO &IO, EnumInfo &I)
Definition: YAMLGenerator.cpp:240
Output
std::string Output
Definition: TraceTests.cpp:159
clang::doc::BaseRecordInfo::IsParent
bool IsParent
Definition: Representation.h:398
clang::doc::TypeInfo::Type
Reference Type
Definition: Representation.h:170
llvm::yaml::ScalarEnumerationTraits< clang::TagTypeKind >::enumeration
static void enumeration(IO &IO, clang::TagTypeKind &Value)
Definition: YAMLGenerator.cpp:45
clang::doc::RecordInfo::ChildRecords
std::vector< Reference > ChildRecords
Definition: Representation.h:381
clang::doc::Info
A base struct for Infos.
Definition: Representation.h:251
llvm::yaml::MappingTraits< FieldTypeInfo >::mapping
static void mapping(IO &IO, FieldTypeInfo &I)
Definition: YAMLGenerator.cpp:186
clang::doc::Generator
Definition: Generators.h:24
clang::doc::Reference
Definition: Representation.h:116
clang::doc::FieldTypeInfo::DefaultValue
SmallString< 16 > DefaultValue
Definition: Representation.h:193
llvm::yaml::MappingTraits< TypeInfo >::mapping
static void mapping(IO &IO, TypeInfo &I)
Definition: YAMLGenerator.cpp:182
clang::doc::Info::IT
const InfoType IT
Definition: Representation.h:266
clang::clangd::Ref
Represents a symbol occurrence in the source file.
Definition: Ref.h:85
llvm::yaml::MappingTraits< BaseRecordInfo >::mapping
static void mapping(IO &IO, BaseRecordInfo &I)
Definition: YAMLGenerator.cpp:220
llvm::yaml::FieldTypeInfoMapping
static void FieldTypeInfoMapping(IO &IO, FieldTypeInfo &I)
Definition: YAMLGenerator.cpp:111
llvm::yaml::ScalarTraits< SmallString< U > >::input
static StringRef input(StringRef Scalar, void *, SmallString< U > &Value)
Definition: YAMLGenerator.cpp:72
clang::doc::CommentInfo::SelfClosing
bool SelfClosing
Definition: Representation.h:103
clang::doc::RecordInfo::ChildFunctions
std::vector< FunctionInfo > ChildFunctions
Definition: Representation.h:382
C
const Criteria C
Definition: FunctionCognitiveComplexityCheck.cpp:93
clang::doc::FunctionInfo::ReturnType
TypeInfo ReturnType
Definition: Representation.h:335
llvm::yaml::MappingTraits< FunctionInfo >::mapping
static void mapping(IO &IO, FunctionInfo &I)
Definition: YAMLGenerator.cpp:249
clang::doc::YAMLGenerator::Format
static const char * Format
Definition: YAMLGenerator.cpp:282
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::doc::NamespaceInfo
Definition: Representation.h:291
OS
llvm::raw_string_ostream OS
Definition: TraceTests.cpp:160
llvm::yaml::MappingTraits< Reference >::mapping
static void mapping(IO &IO, Reference &Ref)
Definition: YAMLGenerator.cpp:172
clang::doc::NamespaceInfo::ChildRecords
std::vector< Reference > ChildRecords
Definition: Representation.h:306
clang::doc::EnumValueInfo::Name
SmallString< 16 > Name
Definition: Representation.h:413
llvm::yaml::CommentInfoMapping
static void CommentInfoMapping(IO &IO, CommentInfo &I)
Definition: YAMLGenerator.cpp:145
clang::doc::RecordInfo::TagType
TagTypeKind TagType
Definition: Representation.h:358
clang::doc::TypeInfo
Definition: Representation.h:159
SymbolInfo
clang::find_all_symbols::SymbolInfo SymbolInfo
Definition: FindAllSymbolsMain.cpp:38
clang::doc::CommentInfo::AttrValues
llvm::SmallVector< SmallString< 16 >, 4 > AttrValues
Definition: Representation.h:109
Generators.h
clang::doc::EnumInfo::BaseType
llvm::Optional< TypeInfo > BaseType
Definition: Representation.h:439
clang::doc::CommentInfo::Args
llvm::SmallVector< SmallString< 16 >, 4 > Args
Definition: Representation.h:111
clang::clangd::SymbolID
Definition: SymbolID.h:32
clang::doc::RecordInfo::ChildEnums
std::vector< EnumInfo > ChildEnums
Definition: Representation.h:383
llvm::yaml::ScalarTraits< std::array< unsigned char, 20 > >::StringToSymbol
static SymbolID StringToSymbol(llvm::StringRef Value)
Definition: YAMLGenerator.cpp:95
clang::doc::FieldTypeInfo
Definition: Representation.h:174
clang::doc::MemberTypeInfo
Definition: Representation.h:197
clang::doc::Info::Namespace
llvm::SmallVector< Reference, 4 > Namespace
Definition: Representation.h:269
llvm::yaml::MappingTraits< Location >::mapping
static void mapping(IO &IO, Location &Loc)
Definition: YAMLGenerator.cpp:165
llvm::yaml::ScalarEnumerationTraits< InfoType >::enumeration
static void enumeration(IO &IO, InfoType &Value)
Definition: YAMLGenerator.cpp:55
clang::doc::EnumInfo::Scoped
bool Scoped
Definition: Representation.h:434
llvm::yaml::MappingTraits< std::unique_ptr< CommentInfo > >::mapping
static void mapping(IO &IO, std::unique_ptr< CommentInfo > &I)
Definition: YAMLGenerator.cpp:267
yaml
@ yaml
Definition: ClangDocMain.cpp:92
llvm::yaml::ScalarTraits< std::array< unsigned char, 20 > >::input
static StringRef input(StringRef Scalar, void *, std::array< unsigned char, 20 > &Value)
Definition: YAMLGenerator.cpp:87
clang::doc::FunctionInfo::IsMethod
bool IsMethod
Definition: Representation.h:333