clang-tools 23.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 "Representation.h"
13#include "llvm/Support/YAMLTraits.h"
14#include "llvm/Support/raw_ostream.h"
15#include <optional>
16
17using namespace clang::doc;
18
19// These define YAML traits for decoding the listed values within a vector.
20LLVM_YAML_IS_SEQUENCE_VECTOR(FieldTypeInfo)
21LLVM_YAML_IS_SEQUENCE_VECTOR(MemberTypeInfo)
22LLVM_YAML_IS_SEQUENCE_VECTOR(Reference)
23LLVM_YAML_IS_SEQUENCE_VECTOR(Location)
24LLVM_YAML_IS_SEQUENCE_VECTOR(CommentInfo)
25LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionInfo)
26LLVM_YAML_IS_SEQUENCE_VECTOR(EnumInfo)
27LLVM_YAML_IS_SEQUENCE_VECTOR(EnumValueInfo)
28LLVM_YAML_IS_SEQUENCE_VECTOR(TemplateParamInfo)
29LLVM_YAML_IS_SEQUENCE_VECTOR(TypedefInfo)
30LLVM_YAML_IS_SEQUENCE_VECTOR(BaseRecordInfo)
31LLVM_YAML_IS_SEQUENCE_VECTOR(OwnedPtr<CommentInfo>)
32
33namespace llvm {
34namespace yaml {
35
36template <typename T> struct SequenceTraits<llvm::ArrayRef<T>> {
37 static size_t size(IO &io, llvm::ArrayRef<T> &seq) { return seq.size(); }
38 static T &element(IO &io, llvm::ArrayRef<T> &seq, size_t index) {
39 return const_cast<T &>(seq[index]);
40 }
41};
42
43// Enumerations to YAML output.
44
45template <> struct ScalarEnumerationTraits<clang::AccessSpecifier> {
46 static void enumeration(IO &IO, clang::AccessSpecifier &Value) {
47 IO.enumCase(Value, "Public", clang::AccessSpecifier::AS_public);
48 IO.enumCase(Value, "Protected", clang::AccessSpecifier::AS_protected);
49 IO.enumCase(Value, "Private", clang::AccessSpecifier::AS_private);
50 IO.enumCase(Value, "None", clang::AccessSpecifier::AS_none);
51 }
52};
53
54template <> struct ScalarEnumerationTraits<clang::TagTypeKind> {
55 static void enumeration(IO &IO, clang::TagTypeKind &Value) {
56 IO.enumCase(Value, "Struct", clang::TagTypeKind::Struct);
57 IO.enumCase(Value, "Interface", clang::TagTypeKind::Interface);
58 IO.enumCase(Value, "Union", clang::TagTypeKind::Union);
59 IO.enumCase(Value, "Class", clang::TagTypeKind::Class);
60 IO.enumCase(Value, "Enum", clang::TagTypeKind::Enum);
61 }
62};
63
64template <> struct ScalarEnumerationTraits<InfoType> {
65 static void enumeration(IO &IO, InfoType &Value) {
66 IO.enumCase(Value, "Namespace", InfoType::IT_namespace);
67 IO.enumCase(Value, "Record", InfoType::IT_record);
68 IO.enumCase(Value, "Function", InfoType::IT_function);
69 IO.enumCase(Value, "Enum", InfoType::IT_enum);
70 IO.enumCase(Value, "Default", InfoType::IT_default);
71 }
72};
73
74template <> struct ScalarEnumerationTraits<clang::doc::CommentKind> {
75 static void enumeration(IO &IO, clang::doc::CommentKind &Value) {
76 IO.enumCase(Value, "FullComment", clang::doc::CommentKind::CK_FullComment);
77 IO.enumCase(Value, "ParagraphComment",
79 IO.enumCase(Value, "TextComment", clang::doc::CommentKind::CK_TextComment);
80 IO.enumCase(Value, "InlineCommandComment",
82 IO.enumCase(Value, "HTMLStartTagComment",
84 IO.enumCase(Value, "HTMLEndTagComment",
86 IO.enumCase(Value, "BlockCommandComment",
88 IO.enumCase(Value, "ParamCommandComment",
90 IO.enumCase(Value, "TParamCommandComment",
92 IO.enumCase(Value, "VerbatimBlockComment",
94 IO.enumCase(Value, "VerbatimBlockLineComment",
96 IO.enumCase(Value, "VerbatimLineComment",
98 IO.enumCase(Value, "Unknown", clang::doc::CommentKind::CK_Unknown);
99 }
100};
101
102// Scalars to YAML output.
103
104template <> struct ScalarTraits<SymbolID> {
105
106 static void output(const SymbolID &S, void *, llvm::raw_ostream &OS) {
107 OS << toHex(toStringRef(S));
108 }
109
110 static StringRef input(StringRef Scalar, void *, SymbolID &Value) {
111 if (Scalar.size() != 40)
112 return "Error: Incorrect scalar size for USR.";
113 Value = stringToSymbol(Scalar);
114 return StringRef();
115 }
116
117 static SymbolID stringToSymbol(llvm::StringRef Value) {
118 SymbolID USR;
119 std::string HexString = fromHex(Value);
120 std::copy(HexString.begin(), HexString.end(), USR.begin());
121 return SymbolID(USR);
122 }
123
124 static QuotingType mustQuote(StringRef) { return QuotingType::Single; }
125};
126
127/// A wrapper for StringRef to force YAML traits to single-quote the string.
129 StringRef Ref;
130 QuotedString() = default;
131 QuotedString(StringRef R) : Ref(R) {}
132 operator StringRef() const { return Ref; }
133 bool operator==(const QuotedString &Other) const { return Ref == Other.Ref; }
134};
135
136template <> struct ScalarTraits<QuotedString> {
137 static void output(const QuotedString &S, void *, llvm::raw_ostream &OS) {
138 OS << S.Ref;
139 }
140 static StringRef input(StringRef Scalar, void *, QuotedString &Value) {
141 Value.Ref = Scalar;
142 return StringRef();
143 }
144 static QuotingType mustQuote(StringRef) { return QuotingType::Single; }
145};
146} // end namespace yaml
147} // end namespace llvm
148
149LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::QuotedString)
150
151namespace llvm {
152namespace yaml {
153
154// Helper functions to map infos to YAML.
155
156static void typeInfoMapping(IO &IO, TypeInfo &I) {
157 IO.mapOptional("Type", I.Type, Reference());
158}
159
160static void fieldTypeInfoMapping(IO &IO, FieldTypeInfo &I) {
161 typeInfoMapping(IO, I);
162
163 QuotedString QName(I.Name);
164 IO.mapOptional("Name", QName, QuotedString(StringRef()));
165 if (!IO.outputting())
166 I.Name = QName.Ref;
167
168 QuotedString QDefault(I.DefaultValue);
169 IO.mapOptional("DefaultValue", QDefault, QuotedString(StringRef()));
170 if (!IO.outputting())
171 I.DefaultValue = QDefault.Ref;
172}
173
174static void infoMapping(IO &IO, Info &I) {
175 IO.mapRequired("USR", I.USR);
176
177 QuotedString QName(I.Name);
178 IO.mapOptional("Name", QName, QuotedString(StringRef()));
179 if (!IO.outputting())
180 I.Name = QName.Ref;
181
182 QuotedString QPath(I.Path);
183 IO.mapOptional("Path", QPath, QuotedString(StringRef()));
184 if (!IO.outputting())
185 I.Path = QPath.Ref;
186
187 IO.mapOptional("Namespace", I.Namespace, llvm::SmallVector<Reference, 4>());
188 IO.mapOptional("Description", I.Description);
189}
190
191static void symbolInfoMapping(IO &IO, SymbolInfo &I) {
192 infoMapping(IO, I);
193 IO.mapOptional("DefLocation", I.DefLoc, std::optional<Location>());
194 IO.mapOptional("Location", I.Loc, llvm::SmallVector<Location, 2>());
195}
196
197static void recordInfoMapping(IO &IO, RecordInfo &I) {
198 symbolInfoMapping(IO, I);
199 IO.mapOptional("TagType", I.TagType);
200 IO.mapOptional("IsTypeDef", I.IsTypeDef, false);
201 IO.mapOptional("Members", I.Members);
202 IO.mapOptional("Bases", I.Bases);
203 IO.mapOptional("Parents", I.Parents, llvm::SmallVector<Reference, 4>());
204 IO.mapOptional("VirtualParents", I.VirtualParents,
205 llvm::SmallVector<Reference, 4>());
206 IO.mapOptional("ChildRecords", I.Children.Records, OwningVec<Reference>());
207 IO.mapOptional("ChildFunctions", I.Children.Functions);
208 IO.mapOptional("ChildEnums", I.Children.Enums);
209 IO.mapOptional("ChildTypedefs", I.Children.Typedefs);
210 IO.mapOptional("Template", I.Template);
211}
212
213static void commentInfoMapping(IO &IO, CommentInfo &I) {
214 IO.mapOptional("Kind", I.Kind, CommentKind::CK_Unknown);
215
216 QuotedString QText(I.Text);
217 IO.mapOptional("Text", QText, QuotedString(StringRef()));
218 if (!IO.outputting())
219 I.Text = QText.Ref;
220
221 QuotedString QName(I.Name);
222 IO.mapOptional("Name", QName, QuotedString(StringRef()));
223 if (!IO.outputting())
224 I.Name = QName.Ref;
225
226 QuotedString QDirection(I.Direction);
227 IO.mapOptional("Direction", QDirection, QuotedString(StringRef()));
228 if (!IO.outputting())
229 I.Direction = QDirection.Ref;
230
231 QuotedString QParamName(I.ParamName);
232 IO.mapOptional("ParamName", QParamName, QuotedString(StringRef()));
233 if (!IO.outputting())
234 I.ParamName = QParamName.Ref;
235
236 QuotedString QCloseName(I.CloseName);
237 IO.mapOptional("CloseName", QCloseName, QuotedString(StringRef()));
238 if (!IO.outputting())
239 I.CloseName = QCloseName.Ref;
240
241 IO.mapOptional("SelfClosing", I.SelfClosing, false);
242 IO.mapOptional("Explicit", I.Explicit, false);
243
244 std::vector<QuotedString> QArgs;
245 if (IO.outputting()) {
246 for (auto &S : I.Args)
247 QArgs.push_back(QuotedString(S));
248 }
249 IO.mapOptional("Args", QArgs, std::vector<QuotedString>());
250
251 std::vector<QuotedString> QAttrKeys;
252 if (IO.outputting()) {
253 for (auto &S : I.AttrKeys)
254 QAttrKeys.push_back(QuotedString(S));
255 }
256 IO.mapOptional("AttrKeys", QAttrKeys, std::vector<QuotedString>());
257
258 std::vector<QuotedString> QAttrValues;
259 if (IO.outputting()) {
260 for (auto &S : I.AttrValues)
261 QAttrValues.push_back(QuotedString(S));
262 }
263 IO.mapOptional("AttrValues", QAttrValues, std::vector<QuotedString>());
264
265 IO.mapOptional("Children", I.Children);
266}
267
268// Template specialization to YAML traits for Infos.
269
270template <> struct MappingTraits<Location> {
271 static void mapping(IO &IO, Location &Loc) {
272 IO.mapOptional("LineNumber", Loc.StartLineNumber, 0);
273
274 QuotedString QFilename(Loc.Filename);
275 IO.mapOptional("Filename", QFilename, QuotedString(StringRef()));
276 if (!IO.outputting())
277 Loc.Filename = QFilename.Ref;
278 }
279};
280
281template <> struct MappingTraits<Reference> {
282 static void mapping(IO &IO, Reference &Ref) {
283 IO.mapOptional("Type", Ref.RefType, InfoType::IT_default);
284
285 QuotedString QName(Ref.Name);
286 IO.mapOptional("Name", QName, QuotedString(StringRef()));
287 if (!IO.outputting())
288 Ref.Name = QName.Ref;
289
290 QuotedString QQualName(Ref.QualName);
291 IO.mapOptional("QualName", QQualName, QuotedString(StringRef()));
292 if (!IO.outputting())
293 Ref.QualName = QQualName.Ref;
294
295 IO.mapOptional("USR", Ref.USR, SymbolID());
296
297 QuotedString QPath(Ref.Path);
298 IO.mapOptional("Path", QPath, QuotedString(StringRef()));
299 if (!IO.outputting())
300 Ref.Path = QPath.Ref;
301 }
302};
303
304template <> struct MappingTraits<TypeInfo> {
305 static void mapping(IO &IO, TypeInfo &I) { typeInfoMapping(IO, I); }
306};
307
308template <> struct MappingTraits<FieldTypeInfo> {
309 static void mapping(IO &IO, FieldTypeInfo &I) {
310 typeInfoMapping(IO, I);
311
312 QuotedString QName(I.Name);
313 IO.mapOptional("Name", QName, QuotedString(StringRef()));
314 if (!IO.outputting())
315 I.Name = QName.Ref;
316
317 QuotedString QDefault(I.DefaultValue);
318 IO.mapOptional("DefaultValue", QDefault, QuotedString(StringRef()));
319 if (!IO.outputting())
320 I.DefaultValue = QDefault.Ref;
321 }
322};
323
324template <> struct MappingTraits<MemberTypeInfo> {
325 static void mapping(IO &IO, MemberTypeInfo &I) {
327 // clang::AccessSpecifier::AS_none is used as the default here because it's
328 // the AS that shouldn't be part of the output. Even though AS_public is the
329 // default in the struct, it should be displayed in the YAML output.
330 IO.mapOptional("Access", I.Access, clang::AccessSpecifier::AS_none);
331 IO.mapOptional("Description", I.Description);
332 }
333};
334
335template <> struct MappingTraits<NamespaceInfo> {
336 static void mapping(IO &IO, NamespaceInfo &I) {
337 infoMapping(IO, I);
338 std::vector<Reference> TempNamespaces;
339 for (const auto &N : I.Children.Namespaces)
340 TempNamespaces.push_back(N);
341 IO.mapOptional("ChildNamespaces", TempNamespaces, std::vector<Reference>());
342 IO.mapOptional("ChildRecords", I.Children.Records, OwningVec<Reference>());
343 IO.mapOptional("ChildFunctions", I.Children.Functions);
344 IO.mapOptional("ChildEnums", I.Children.Enums);
345 IO.mapOptional("ChildTypedefs", I.Children.Typedefs);
346 }
347};
348
349template <> struct MappingTraits<RecordInfo> {
350 static void mapping(IO &IO, RecordInfo &I) { recordInfoMapping(IO, I); }
351};
352
353template <> struct MappingTraits<BaseRecordInfo> {
354 static void mapping(IO &IO, BaseRecordInfo &I) {
355 recordInfoMapping(IO, I);
356 IO.mapOptional("IsVirtual", I.IsVirtual, false);
357 // clang::AccessSpecifier::AS_none is used as the default here because it's
358 // the AS that shouldn't be part of the output. Even though AS_public is the
359 // default in the struct, it should be displayed in the YAML output.
360 IO.mapOptional("Access", I.Access, clang::AccessSpecifier::AS_none);
361 IO.mapOptional("IsParent", I.IsParent, false);
362 }
363};
364
365template <> struct MappingTraits<EnumValueInfo> {
366 static void mapping(IO &IO, EnumValueInfo &I) {
367 QuotedString QName(I.Name);
368 IO.mapOptional("Name", QName, QuotedString(StringRef()));
369 if (!IO.outputting())
370 I.Name = QName.Ref;
371
372 QuotedString QValue(I.Value);
373 IO.mapOptional("Value", QValue, QuotedString(StringRef()));
374 if (!IO.outputting())
375 I.Value = QValue.Ref;
376
377 QuotedString QExpr(I.ValueExpr);
378 IO.mapOptional("Expr", QExpr, QuotedString(StringRef()));
379 if (!IO.outputting())
380 I.ValueExpr = QExpr.Ref;
381 }
382};
383
384template <> struct MappingTraits<EnumInfo> {
385 static void mapping(IO &IO, EnumInfo &I) {
386 symbolInfoMapping(IO, I);
387 IO.mapOptional("Scoped", I.Scoped, false);
388 IO.mapOptional("BaseType", I.BaseType);
389 IO.mapOptional("Members", I.Members);
390 }
391};
392
393template <> struct MappingTraits<TypedefInfo> {
394 static void mapping(IO &IO, TypedefInfo &I) {
395 symbolInfoMapping(IO, I);
396 IO.mapOptional("Underlying", I.Underlying.Type);
397 IO.mapOptional("IsUsing", I.IsUsing, false);
398 }
399};
400
401template <> struct MappingTraits<FunctionInfo> {
402 static void mapping(IO &IO, FunctionInfo &I) {
403 symbolInfoMapping(IO, I);
404 IO.mapOptional("IsMethod", I.IsMethod, false);
405 IO.mapOptional("Parent", I.Parent, Reference());
406 IO.mapOptional("Params", I.Params);
407 IO.mapOptional("ReturnType", I.ReturnType);
408 // clang::AccessSpecifier::AS_none is used as the default here because it's
409 // the AS that shouldn't be part of the output. Even though AS_public is the
410 // default in the struct, it should be displayed in the YAML output.
411 IO.mapOptional("Access", I.Access, clang::AccessSpecifier::AS_none);
412 IO.mapOptional("Template", I.Template);
413 }
414};
415
416template <> struct MappingTraits<TemplateParamInfo> {
417 static void mapping(IO &IO, TemplateParamInfo &I) {
418 QuotedString QContents(I.Contents);
419 IO.mapOptional("Contents", QContents, QuotedString(StringRef()));
420 if (!IO.outputting())
421 I.Contents = QContents.Ref;
422 }
423};
424
425template <> struct MappingTraits<TemplateSpecializationInfo> {
426 static void mapping(IO &IO, TemplateSpecializationInfo &I) {
427 IO.mapOptional("SpecializationOf", I.SpecializationOf);
428 IO.mapOptional("Params", I.Params);
429 }
430};
431
432template <> struct MappingTraits<TemplateInfo> {
433 static void mapping(IO &IO, TemplateInfo &I) {
434 IO.mapOptional("Params", I.Params);
435 IO.mapOptional("Specialization", I.Specialization,
436 std::optional<TemplateSpecializationInfo>());
437 }
438};
439
440template <> struct MappingTraits<CommentInfo> {
441 static void mapping(IO &IO, CommentInfo &I) { commentInfoMapping(IO, I); }
442};
443
444template <> struct MappingTraits<OwnedPtr<CommentInfo>> {
445 static void mapping(IO &IO, OwnedPtr<CommentInfo> &I) {
446 if (I)
447 commentInfoMapping(IO, *I);
448 }
449};
450
451} // end namespace yaml
452} // end namespace llvm
453
454namespace clang {
455namespace doc {
456
457/// Generator for YAML documentation.
458class YAMLGenerator : public Generator {
459public:
460 static const char *Format;
461
462 llvm::Error generateDocumentation(
463 StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
464 const ClangDocContext &CDCtx, std::string DirName) override;
465 llvm::Error generateDocForInfo(Info *I, llvm::raw_ostream &OS,
466 const ClangDocContext &CDCtx) override;
467};
468
469const char *YAMLGenerator::Format = "yaml";
470
472 StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
473 const ClangDocContext &CDCtx, std::string DirName) {
474 for (const auto &Group : Infos) {
475 doc::Info *Info = getPtr(Group.getValue());
476
477 // Output file names according to the USR except the global namesapce.
478 // Anonymous namespaces are taken care of in serialization, so here we can
479 // safely assume an unnamed namespace is the global one.
480 llvm::SmallString<128> Path;
481 llvm::sys::path::native(RootDir, Path);
482 if (Info->IT == InfoType::IT_namespace && Info->Name.empty()) {
483 llvm::sys::path::append(Path, "index.yaml");
484 } else {
485 llvm::sys::path::append(Path, Group.getKey() + ".yaml");
486 }
487
488 std::error_code FileErr;
489 llvm::raw_fd_ostream InfoOS(Path, FileErr, llvm::sys::fs::OF_Text);
490 if (FileErr) {
491 return llvm::createStringError(FileErr, "Error opening file '%s'",
492 Path.c_str());
493 }
494
495 if (llvm::Error Err = generateDocForInfo(Info, InfoOS, CDCtx)) {
496 return Err;
497 }
498 }
499
500 return llvm::Error::success();
501}
502
503llvm::Error YAMLGenerator::generateDocForInfo(Info *I, llvm::raw_ostream &OS,
504 const ClangDocContext &CDCtx) {
505 llvm::yaml::Output InfoYAML(OS);
506 switch (I->IT) {
508 InfoYAML << *static_cast<clang::doc::NamespaceInfo *>(I);
509 break;
511 InfoYAML << *static_cast<clang::doc::RecordInfo *>(I);
512 break;
514 InfoYAML << *static_cast<clang::doc::EnumInfo *>(I);
515 break;
517 InfoYAML << *static_cast<clang::doc::FunctionInfo *>(I);
518 break;
520 InfoYAML << *static_cast<clang::doc::TypedefInfo *>(I);
521 break;
525 break;
527 return llvm::createStringError(llvm::inconvertibleErrorCode(),
528 "unexpected InfoType");
529 }
530 return llvm::Error::success();
531}
532
533static GeneratorRegistry::Add<YAMLGenerator> YAML(YAMLGenerator::Format,
534 "Generator for YAML output.");
535
536// This anchor is used to force the linker to link in the generated object file
537// and thus register the generator.
539
540} // namespace doc
541} // namespace clang
Generator for YAML documentation.
llvm::Error generateDocumentation(StringRef RootDir, llvm::StringMap< doc::OwnedPtr< doc::Info > > Infos, const ClangDocContext &CDCtx, std::string DirName) override
static const char * Format
llvm::Error generateDocForInfo(Info *I, llvm::raw_ostream &OS, const ClangDocContext &CDCtx) override
std::unique_ptr< T > OwnedPtr
T * getPtr(const OwnedPtr< T > &O)
static GeneratorRegistry::Add< YAMLGenerator > YAML(YAMLGenerator::Format, "Generator for YAML output.")
volatile int YAMLGeneratorAnchorSource
std::vector< T > OwningVec
std::array< uint8_t, 20 > SymbolID
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static void infoMapping(IO &IO, Info &I)
static void commentInfoMapping(IO &IO, CommentInfo &I)
static void fieldTypeInfoMapping(IO &IO, FieldTypeInfo &I)
static void symbolInfoMapping(IO &IO, SymbolInfo &I)
static void typeInfoMapping(IO &IO, TypeInfo &I)
static void recordInfoMapping(IO &IO, RecordInfo &I)
Some operations such as code completion produce a set of candidates.
Definition Generators.h:150
Represents a symbol occurrence in the source file.
Definition Ref.h:88
llvm::ArrayRef< StringRef > Args
llvm::ArrayRef< StringRef > AttrValues
llvm::ArrayRef< CommentInfo > Children
llvm::ArrayRef< StringRef > AttrKeys
llvm::SmallVector< EnumValueInfo, 4 > Members
std::optional< TypeInfo > BaseType
llvm::SmallVector< FieldTypeInfo, 4 > Params
std::optional< TemplateInfo > Template
A base struct for Infos.
OwningVec< CommentInfo > Description
llvm::SmallVector< Reference, 4 > Namespace
OwningVec< CommentInfo > Description
OwningVec< BaseRecordInfo > Bases
llvm::SmallVector< MemberTypeInfo, 4 > Members
std::optional< TemplateInfo > Template
llvm::SmallVector< Reference, 4 > VirtualParents
llvm::SmallVector< Reference, 4 > Parents
OwningVec< FunctionInfo > Functions
OwningVec< TypedefInfo > Typedefs
OwningVec< EnumInfo > Enums
OwningVec< Reference > Records
llvm::simple_ilist< Reference > Namespaces
llvm::SmallVector< Location, 2 > Loc
std::optional< Location > DefLoc
OwningVec< TemplateParamInfo > Params
std::optional< TemplateSpecializationInfo > Specialization
OwningVec< TemplateParamInfo > Params
static void mapping(IO &IO, BaseRecordInfo &I)
static void mapping(IO &IO, CommentInfo &I)
static void mapping(IO &IO, EnumInfo &I)
static void mapping(IO &IO, EnumValueInfo &I)
static void mapping(IO &IO, FieldTypeInfo &I)
static void mapping(IO &IO, FunctionInfo &I)
static void mapping(IO &IO, Location &Loc)
static void mapping(IO &IO, MemberTypeInfo &I)
static void mapping(IO &IO, NamespaceInfo &I)
static void mapping(IO &IO, OwnedPtr< CommentInfo > &I)
static void mapping(IO &IO, RecordInfo &I)
static void mapping(IO &IO, Reference &Ref)
static void mapping(IO &IO, TemplateInfo &I)
static void mapping(IO &IO, TemplateParamInfo &I)
static void mapping(IO &IO, TemplateSpecializationInfo &I)
static void mapping(IO &IO, TypeInfo &I)
static void mapping(IO &IO, TypedefInfo &I)
A wrapper for StringRef to force YAML traits to single-quote the string.
bool operator==(const QuotedString &Other) const
static void enumeration(IO &IO, InfoType &Value)
static void enumeration(IO &IO, clang::AccessSpecifier &Value)
static void enumeration(IO &IO, clang::TagTypeKind &Value)
static void enumeration(IO &IO, clang::doc::CommentKind &Value)
static StringRef input(StringRef Scalar, void *, QuotedString &Value)
static QuotingType mustQuote(StringRef)
static void output(const QuotedString &S, void *, llvm::raw_ostream &OS)
static SymbolID stringToSymbol(llvm::StringRef Value)
static StringRef input(StringRef Scalar, void *, SymbolID &Value)
static void output(const SymbolID &S, void *, llvm::raw_ostream &OS)
static QuotingType mustQuote(StringRef)
static T & element(IO &io, llvm::ArrayRef< T > &seq, size_t index)
static size_t size(IO &io, llvm::ArrayRef< T > &seq)