Coverage Report

Created: 2023-11-11 10:31

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- ExtractAPI/Serialization/SymbolGraphSerializer.cpp -------*- 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
/// \file
10
/// This file implements the SymbolGraphSerializer.
11
///
12
//===----------------------------------------------------------------------===//
13
14
#include "clang/ExtractAPI/Serialization/SymbolGraphSerializer.h"
15
#include "clang/Basic/SourceLocation.h"
16
#include "clang/Basic/Version.h"
17
#include "clang/ExtractAPI/DeclarationFragments.h"
18
#include "llvm/ADT/STLExtras.h"
19
#include "llvm/ADT/STLFunctionalExtras.h"
20
#include "llvm/Support/Casting.h"
21
#include "llvm/Support/Compiler.h"
22
#include "llvm/Support/Path.h"
23
#include "llvm/Support/VersionTuple.h"
24
#include <optional>
25
#include <type_traits>
26
27
using namespace clang;
28
using namespace clang::extractapi;
29
using namespace llvm;
30
using namespace llvm::json;
31
32
namespace {
33
34
/// Helper function to inject a JSON object \p Obj into another object \p Paren
35
/// at position \p Key.
36
2.14k
void serializeObject(Object &Paren, StringRef Key, std::optional<Object> Obj) {
37
2.14k
  if (Obj)
38
1.60k
    Paren[Key] = std::move(*Obj);
39
2.14k
}
40
41
/// Helper function to inject a StringRef \p String into an object \p Paren at
42
/// position \p Key
43
void serializeString(Object &Paren, StringRef Key,
44
202
                     std::optional<std::string> String) {
45
202
  if (String)
46
202
    Paren[Key] = std::move(*String);
47
202
}
48
49
/// Helper function to inject a JSON array \p Array into object \p Paren at
50
/// position \p Key.
51
1.15k
void serializeArray(Object &Paren, StringRef Key, std::optional<Array> Array) {
52
1.15k
  if (Array)
53
955
    Paren[Key] = std::move(*Array);
54
1.15k
}
55
56
/// Serialize a \c VersionTuple \p V with the Symbol Graph semantic version
57
/// format.
58
///
59
/// A semantic version object contains three numeric fields, representing the
60
/// \c major, \c minor, and \c patch parts of the version tuple.
61
/// For example version tuple 1.0.3 is serialized as:
62
/// \code
63
///   {
64
///     "major" : 1,
65
///     "minor" : 0,
66
///     "patch" : 3
67
///   }
68
/// \endcode
69
///
70
/// \returns \c std::nullopt if the version \p V is empty, or an \c Object
71
/// containing the semantic version representation of \p V.
72
168
std::optional<Object> serializeSemanticVersion(const VersionTuple &V) {
73
168
  if (V.empty())
74
31
    return std::nullopt;
75
76
137
  Object Version;
77
137
  Version["major"] = V.getMajor();
78
137
  Version["minor"] = V.getMinor().value_or(0);
79
137
  Version["patch"] = V.getSubminor().value_or(0);
80
137
  return Version;
81
168
}
82
83
/// Serialize the OS information in the Symbol Graph platform property.
84
///
85
/// The OS information in Symbol Graph contains the \c name of the OS, and an
86
/// optional \c minimumVersion semantic version field.
87
75
Object serializeOperatingSystem(const Triple &T) {
88
75
  Object OS;
89
75
  OS["name"] = T.getOSTypeName(T.getOS());
90
75
  serializeObject(OS, "minimumVersion",
91
75
                  serializeSemanticVersion(T.getMinimumSupportedOSVersion()));
92
75
  return OS;
93
75
}
94
95
/// Serialize the platform information in the Symbol Graph module section.
96
///
97
/// The platform object describes a target platform triple in corresponding
98
/// three fields: \c architecture, \c vendor, and \c operatingSystem.
99
75
Object serializePlatform(const Triple &T) {
100
75
  Object Platform;
101
75
  Platform["architecture"] = T.getArchName();
102
75
  Platform["vendor"] = T.getVendorName();
103
75
  Platform["operatingSystem"] = serializeOperatingSystem(T);
104
75
  return Platform;
105
75
}
106
107
/// Serialize a source position.
108
280
Object serializeSourcePosition(const PresumedLoc &Loc) {
109
280
  assert(Loc.isValid() && "invalid source position");
110
111
280
  Object SourcePosition;
112
280
  SourcePosition["line"] = Loc.getLine();
113
280
  SourcePosition["character"] = Loc.getColumn();
114
115
280
  return SourcePosition;
116
280
}
117
118
/// Serialize a source location in file.
119
///
120
/// \param Loc The presumed location to serialize.
121
/// \param IncludeFileURI If true, include the file path of \p Loc as a URI.
122
/// Defaults to false.
123
Object serializeSourceLocation(const PresumedLoc &Loc,
124
202
                               bool IncludeFileURI = false) {
125
202
  Object SourceLocation;
126
202
  serializeObject(SourceLocation, "position", serializeSourcePosition(Loc));
127
128
202
  if (IncludeFileURI) {
129
202
    std::string FileURI = "file://";
130
    // Normalize file path to use forward slashes for the URI.
131
202
    FileURI += sys::path::convert_to_slash(Loc.getFilename());
132
202
    SourceLocation["uri"] = FileURI;
133
202
  }
134
135
202
  return SourceLocation;
136
202
}
137
138
/// Serialize a source range with begin and end locations.
139
Object serializeSourceRange(const PresumedLoc &BeginLoc,
140
39
                            const PresumedLoc &EndLoc) {
141
39
  Object SourceRange;
142
39
  serializeObject(SourceRange, "start", serializeSourcePosition(BeginLoc));
143
39
  serializeObject(SourceRange, "end", serializeSourcePosition(EndLoc));
144
39
  return SourceRange;
145
39
}
146
147
/// Serialize the availability attributes of a symbol.
148
///
149
/// Availability information contains the introduced, deprecated, and obsoleted
150
/// versions of the symbol for a given domain (roughly corresponds to a
151
/// platform) as semantic versions, if not default.  Availability information
152
/// also contains flags to indicate if the symbol is unconditionally unavailable
153
/// or deprecated, i.e. \c __attribute__((unavailable)) and \c
154
/// __attribute__((deprecated)).
155
///
156
/// \returns \c std::nullopt if the symbol has default availability attributes,
157
/// or an \c Array containing the formatted availability information.
158
std::optional<Array>
159
202
serializeAvailability(const AvailabilitySet &Availabilities) {
160
202
  if (Availabilities.isDefault())
161
198
    return std::nullopt;
162
163
4
  Array AvailabilityArray;
164
165
4
  if (Availabilities.isUnconditionallyDeprecated()) {
166
1
    Object UnconditionallyDeprecated;
167
1
    UnconditionallyDeprecated["domain"] = "*";
168
1
    UnconditionallyDeprecated["isUnconditionallyDeprecated"] = true;
169
1
    AvailabilityArray.emplace_back(std::move(UnconditionallyDeprecated));
170
1
  }
171
172
  // Note unconditionally unavailable records are skipped.
173
174
7
  for (const auto &AvailInfo : Availabilities) {
175
7
    Object Availability;
176
7
    Availability["domain"] = AvailInfo.Domain;
177
7
    if (AvailInfo.Unavailable)
178
1
      Availability["isUnconditionallyUnavailable"] = true;
179
6
    else {
180
6
      serializeObject(Availability, "introduced",
181
6
                      serializeSemanticVersion(AvailInfo.Introduced));
182
6
      serializeObject(Availability, "deprecated",
183
6
                      serializeSemanticVersion(AvailInfo.Deprecated));
184
6
      serializeObject(Availability, "obsoleted",
185
6
                      serializeSemanticVersion(AvailInfo.Obsoleted));
186
6
    }
187
7
    AvailabilityArray.emplace_back(std::move(Availability));
188
7
  }
189
190
4
  return AvailabilityArray;
191
202
}
192
193
/// Get the language name string for interface language references.
194
450
StringRef getLanguageName(Language Lang) {
195
450
  switch (Lang) {
196
146
  case Language::C:
197
146
    return "c";
198
192
  case Language::ObjC:
199
192
    return "objective-c";
200
112
  case Language::CXX:
201
112
    return "c++";
202
203
  // Unsupported language currently
204
0
  case Language::ObjCXX:
205
0
  case Language::OpenCL:
206
0
  case Language::OpenCLCXX:
207
0
  case Language::CUDA:
208
0
  case Language::RenderScript:
209
0
  case Language::HIP:
210
0
  case Language::HLSL:
211
212
  // Languages that the frontend cannot parse and compile
213
0
  case Language::Unknown:
214
0
  case Language::Asm:
215
0
  case Language::LLVM_IR:
216
0
    llvm_unreachable("Unsupported language kind");
217
450
  }
218
219
0
  llvm_unreachable("Unhandled language kind");
220
0
}
221
222
/// Serialize the identifier object as specified by the Symbol Graph format.
223
///
224
/// The identifier property of a symbol contains the USR for precise and unique
225
/// references, and the interface language name.
226
204
Object serializeIdentifier(const APIRecord &Record, Language Lang) {
227
204
  Object Identifier;
228
204
  Identifier["precise"] = Record.USR;
229
204
  Identifier["interfaceLanguage"] = getLanguageName(Lang);
230
231
204
  return Identifier;
232
204
}
233
234
/// Serialize the documentation comments attached to a symbol, as specified by
235
/// the Symbol Graph format.
236
///
237
/// The Symbol Graph \c docComment object contains an array of lines. Each line
238
/// represents one line of striped documentation comment, with source range
239
/// information.
240
/// e.g.
241
/// \code
242
///   /// This is a documentation comment
243
///       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'  First line.
244
///   ///     with multiple lines.
245
///       ^~~~~~~~~~~~~~~~~~~~~~~'         Second line.
246
/// \endcode
247
///
248
/// \returns \c std::nullopt if \p Comment is empty, or an \c Object containing
249
/// the formatted lines.
250
202
std::optional<Object> serializeDocComment(const DocComment &Comment) {
251
202
  if (Comment.empty())
252
173
    return std::nullopt;
253
254
29
  Object DocComment;
255
29
  Array LinesArray;
256
39
  for (const auto &CommentLine : Comment) {
257
39
    Object Line;
258
39
    Line["text"] = CommentLine.Text;
259
39
    serializeObject(Line, "range",
260
39
                    serializeSourceRange(CommentLine.Begin, CommentLine.End));
261
39
    LinesArray.emplace_back(std::move(Line));
262
39
  }
263
29
  serializeArray(DocComment, "lines", LinesArray);
264
265
29
  return DocComment;
266
202
}
267
268
/// Serialize the declaration fragments of a symbol.
269
///
270
/// The Symbol Graph declaration fragments is an array of tagged important
271
/// parts of a symbol's declaration. The fragments sequence can be joined to
272
/// form spans of declaration text, with attached information useful for
273
/// purposes like syntax-highlighting etc. For example:
274
/// \code
275
///   const int pi; -> "declarationFragments" : [
276
///                      {
277
///                        "kind" : "keyword",
278
///                        "spelling" : "const"
279
///                      },
280
///                      {
281
///                        "kind" : "text",
282
///                        "spelling" : " "
283
///                      },
284
///                      {
285
///                        "kind" : "typeIdentifier",
286
///                        "preciseIdentifier" : "c:I",
287
///                        "spelling" : "int"
288
///                      },
289
///                      {
290
///                        "kind" : "text",
291
///                        "spelling" : " "
292
///                      },
293
///                      {
294
///                        "kind" : "identifier",
295
///                        "spelling" : "pi"
296
///                      }
297
///                    ]
298
/// \endcode
299
///
300
/// \returns \c std::nullopt if \p DF is empty, or an \c Array containing the
301
/// formatted declaration fragments array.
302
std::optional<Array>
303
681
serializeDeclarationFragments(const DeclarationFragments &DF) {
304
681
  if (DF.getFragments().empty())
305
5
    return std::nullopt;
306
307
676
  Array Fragments;
308
1.71k
  for (const auto &F : DF.getFragments()) {
309
1.71k
    Object Fragment;
310
1.71k
    Fragment["spelling"] = F.Spelling;
311
1.71k
    Fragment["kind"] = DeclarationFragments::getFragmentKindString(F.Kind);
312
1.71k
    if (!F.PreciseIdentifier.empty())
313
228
      Fragment["preciseIdentifier"] = F.PreciseIdentifier;
314
1.71k
    Fragments.emplace_back(std::move(Fragment));
315
1.71k
  }
316
317
676
  return Fragments;
318
681
}
319
320
/// Serialize the \c names field of a symbol as specified by the Symbol Graph
321
/// format.
322
///
323
/// The Symbol Graph names field contains multiple representations of a symbol
324
/// that can be used for different applications:
325
///   - \c title : The simple declared name of the symbol;
326
///   - \c subHeading : An array of declaration fragments that provides tags,
327
///     and potentially more tokens (for example the \c +/- symbol for
328
///     Objective-C methods). Can be used as sub-headings for documentation.
329
202
Object serializeNames(const APIRecord &Record) {
330
202
  Object Names;
331
202
  if (auto *CategoryRecord =
332
202
          dyn_cast_or_null<const ObjCCategoryRecord>(&Record))
333
4
    Names["title"] =
334
4
        (CategoryRecord->Interface.Name + " (" + Record.Name + ")").str();
335
198
  else
336
198
    Names["title"] = Record.Name;
337
338
202
  serializeArray(Names, "subHeading",
339
202
                 serializeDeclarationFragments(Record.SubHeading));
340
202
  DeclarationFragments NavigatorFragments;
341
202
  NavigatorFragments.append(Record.Name,
342
202
                            DeclarationFragments::FragmentKind::Identifier,
343
202
                            /*PreciseIdentifier*/ "");
344
202
  serializeArray(Names, "navigator",
345
202
                 serializeDeclarationFragments(NavigatorFragments));
346
347
202
  return Names;
348
202
}
349
350
240
Object serializeSymbolKind(APIRecord::RecordKind RK, Language Lang) {
351
240
  auto AddLangPrefix = [&Lang](StringRef S) -> std::string {
352
240
    return (getLanguageName(Lang) + "." + S).str();
353
240
  };
354
355
240
  Object Kind;
356
240
  switch (RK) {
357
0
  case APIRecord::RK_Unknown:
358
0
    llvm_unreachable("Records should have an explicit kind");
359
0
    break;
360
3
  case APIRecord::RK_Namespace:
361
3
    Kind["identifier"] = AddLangPrefix("namespace");
362
3
    Kind["displayName"] = "Namespace";
363
3
    break;
364
21
  case APIRecord::RK_GlobalFunction:
365
21
    Kind["identifier"] = AddLangPrefix("func");
366
21
    Kind["displayName"] = "Function";
367
21
    break;
368
3
  case APIRecord::RK_GlobalFunctionTemplate:
369
3
    Kind["identifier"] = AddLangPrefix("func");
370
3
    Kind["displayName"] = "Function Template";
371
3
    break;
372
1
  case APIRecord::RK_GlobalFunctionTemplateSpecialization:
373
1
    Kind["identifier"] = AddLangPrefix("func");
374
1
    Kind["displayName"] = "Function Template Specialization";
375
1
    break;
376
3
  case APIRecord::RK_GlobalVariableTemplate:
377
3
    Kind["identifier"] = AddLangPrefix("var");
378
3
    Kind["displayName"] = "Global Variable Template";
379
3
    break;
380
1
  case APIRecord::RK_GlobalVariableTemplateSpecialization:
381
1
    Kind["identifier"] = AddLangPrefix("var");
382
1
    Kind["displayName"] = "Global Variable Template Specialization";
383
1
    break;
384
1
  case APIRecord::RK_GlobalVariableTemplatePartialSpecialization:
385
1
    Kind["identifier"] = AddLangPrefix("var");
386
1
    Kind["displayName"] = "Global Variable Template Partial Specialization";
387
1
    break;
388
10
  case APIRecord::RK_GlobalVariable:
389
10
    Kind["identifier"] = AddLangPrefix("var");
390
10
    Kind["displayName"] = "Global Variable";
391
10
    break;
392
15
  case APIRecord::RK_EnumConstant:
393
15
    Kind["identifier"] = AddLangPrefix("enum.case");
394
15
    Kind["displayName"] = "Enumeration Case";
395
15
    break;
396
7
  case APIRecord::RK_Enum:
397
7
    Kind["identifier"] = AddLangPrefix("enum");
398
7
    Kind["displayName"] = "Enumeration";
399
7
    break;
400
12
  case APIRecord::RK_StructField:
401
12
    Kind["identifier"] = AddLangPrefix("property");
402
12
    Kind["displayName"] = "Instance Property";
403
12
    break;
404
16
  case APIRecord::RK_Struct:
405
16
    Kind["identifier"] = AddLangPrefix("struct");
406
16
    Kind["displayName"] = "Structure";
407
16
    break;
408
4
  case APIRecord::RK_CXXField:
409
4
    Kind["identifier"] = AddLangPrefix("property");
410
4
    Kind["displayName"] = "Instance Property";
411
4
    break;
412
0
  case APIRecord::RK_Union:
413
0
    Kind["identifier"] = AddLangPrefix("union");
414
0
    Kind["displayName"] = "Union";
415
0
    break;
416
0
  case APIRecord::RK_StaticField:
417
0
    Kind["identifier"] = AddLangPrefix("type.property");
418
0
    Kind["displayName"] = "Type Property";
419
0
    break;
420
4
  case APIRecord::RK_ClassTemplate:
421
6
  case APIRecord::RK_ClassTemplateSpecialization:
422
6
  case APIRecord::RK_ClassTemplatePartialSpecialization:
423
21
  case APIRecord::RK_CXXClass:
424
21
    Kind["identifier"] = AddLangPrefix("class");
425
21
    Kind["displayName"] = "Class";
426
21
    break;
427
2
  case APIRecord::RK_CXXMethodTemplate:
428
2
    Kind["identifier"] = AddLangPrefix("method");
429
2
    Kind["displayName"] = "Method Template";
430
2
    break;
431
1
  case APIRecord::RK_CXXMethodTemplateSpecialization:
432
1
    Kind["identifier"] = AddLangPrefix("method");
433
1
    Kind["displayName"] = "Method Template Specialization";
434
1
    break;
435
1
  case APIRecord::RK_CXXFieldTemplate:
436
1
    Kind["identifier"] = AddLangPrefix("property");
437
1
    Kind["displayName"] = "Template Property";
438
1
    break;
439
1
  case APIRecord::RK_Concept:
440
1
    Kind["identifier"] = AddLangPrefix("concept");
441
1
    Kind["displayName"] = "Concept";
442
1
    break;
443
1
  case APIRecord::RK_CXXStaticMethod:
444
1
    Kind["identifier"] = AddLangPrefix("type.method");
445
1
    Kind["displayName"] = "Static Method";
446
1
    break;
447
8
  case APIRecord::RK_CXXInstanceMethod:
448
8
    Kind["identifier"] = AddLangPrefix("method");
449
8
    Kind["displayName"] = "Instance Method";
450
8
    break;
451
0
  case APIRecord::RK_CXXConstructorMethod:
452
0
    Kind["identifier"] = AddLangPrefix("method");
453
0
    Kind["displayName"] = "Constructor";
454
0
    break;
455
0
  case APIRecord::RK_CXXDestructorMethod:
456
0
    Kind["identifier"] = AddLangPrefix("method");
457
0
    Kind["displayName"] = "Destructor";
458
0
    break;
459
1
  case APIRecord::RK_ObjCIvar:
460
1
    Kind["identifier"] = AddLangPrefix("ivar");
461
1
    Kind["displayName"] = "Instance Variable";
462
1
    break;
463
20
  case APIRecord::RK_ObjCInstanceMethod:
464
20
    Kind["identifier"] = AddLangPrefix("method");
465
20
    Kind["displayName"] = "Instance Method";
466
20
    break;
467
2
  case APIRecord::RK_ObjCClassMethod:
468
2
    Kind["identifier"] = AddLangPrefix("type.method");
469
2
    Kind["displayName"] = "Type Method";
470
2
    break;
471
15
  case APIRecord::RK_ObjCInstanceProperty:
472
15
    Kind["identifier"] = AddLangPrefix("property");
473
15
    Kind["displayName"] = "Instance Property";
474
15
    break;
475
3
  case APIRecord::RK_ObjCClassProperty:
476
3
    Kind["identifier"] = AddLangPrefix("type.property");
477
3
    Kind["displayName"] = "Type Property";
478
3
    break;
479
24
  case APIRecord::RK_ObjCInterface:
480
24
    Kind["identifier"] = AddLangPrefix("class");
481
24
    Kind["displayName"] = "Class";
482
24
    break;
483
4
  case APIRecord::RK_ObjCCategory:
484
4
    Kind["identifier"] = AddLangPrefix("class.extension");
485
4
    Kind["displayName"] = "Class Extension";
486
4
    break;
487
2
  case APIRecord::RK_ObjCCategoryModule:
488
2
    Kind["identifier"] = AddLangPrefix("module.extension");
489
2
    Kind["displayName"] = "Module Extension";
490
2
    break;
491
10
  case APIRecord::RK_ObjCProtocol:
492
10
    Kind["identifier"] = AddLangPrefix("protocol");
493
10
    Kind["displayName"] = "Protocol";
494
10
    break;
495
14
  case APIRecord::RK_MacroDefinition:
496
14
    Kind["identifier"] = AddLangPrefix("macro");
497
14
    Kind["displayName"] = "Macro";
498
14
    break;
499
13
  case APIRecord::RK_Typedef:
500
13
    Kind["identifier"] = AddLangPrefix("typealias");
501
13
    Kind["displayName"] = "Type Alias";
502
13
    break;
503
240
  }
504
505
240
  return Kind;
506
240
}
507
508
/// Serialize the symbol kind information.
509
///
510
/// The Symbol Graph symbol kind property contains a shorthand \c identifier
511
/// which is prefixed by the source language name, useful for tooling to parse
512
/// the kind, and a \c displayName for rendering human-readable names.
513
202
Object serializeSymbolKind(const APIRecord &Record, Language Lang) {
514
202
  return serializeSymbolKind(Record.getKind(), Lang);
515
202
}
516
517
template <typename RecordTy>
518
std::optional<Object>
519
49
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
49
  const auto &FS = Record.Signature;
521
49
  if (FS.empty())
522
0
    return std::nullopt;
523
524
49
  Object Signature;
525
49
  serializeArray(Signature, "returns",
526
49
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
49
  Array Parameters;
529
49
  for (const auto &P : FS.getParameters()) {
530
26
    Object Parameter;
531
26
    Parameter["name"] = P.Name;
532
26
    serializeArray(Parameter, "declarationFragments",
533
26
                   serializeDeclarationFragments(P.Fragments));
534
26
    Parameters.emplace_back(std::move(Parameter));
535
26
  }
536
537
49
  if (!Parameters.empty())
538
18
    Signature["parameters"] = std::move(Parameters);
539
540
49
  return Signature;
541
49
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalFunctionRecord>(clang::extractapi::GlobalFunctionRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
21
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
21
  const auto &FS = Record.Signature;
521
21
  if (FS.empty())
522
0
    return std::nullopt;
523
524
21
  Object Signature;
525
21
  serializeArray(Signature, "returns",
526
21
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
21
  Array Parameters;
529
21
  for (const auto &P : FS.getParameters()) {
530
14
    Object Parameter;
531
14
    Parameter["name"] = P.Name;
532
14
    serializeArray(Parameter, "declarationFragments",
533
14
                   serializeDeclarationFragments(P.Fragments));
534
14
    Parameters.emplace_back(std::move(Parameter));
535
14
  }
536
537
21
  if (!Parameters.empty())
538
7
    Signature["parameters"] = std::move(Parameters);
539
540
21
  return Signature;
541
21
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXInstanceMethodRecord>(clang::extractapi::CXXInstanceMethodRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
8
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
8
  const auto &FS = Record.Signature;
521
8
  if (FS.empty())
522
0
    return std::nullopt;
523
524
8
  Object Signature;
525
8
  serializeArray(Signature, "returns",
526
8
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
8
  Array Parameters;
529
8
  for (const auto &P : FS.getParameters()) {
530
2
    Object Parameter;
531
2
    Parameter["name"] = P.Name;
532
2
    serializeArray(Parameter, "declarationFragments",
533
2
                   serializeDeclarationFragments(P.Fragments));
534
2
    Parameters.emplace_back(std::move(Parameter));
535
2
  }
536
537
8
  if (!Parameters.empty())
538
2
    Signature["parameters"] = std::move(Parameters);
539
540
8
  return Signature;
541
8
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXStaticMethodRecord>(clang::extractapi::CXXStaticMethodRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
1
  const auto &FS = Record.Signature;
521
1
  if (FS.empty())
522
0
    return std::nullopt;
523
524
1
  Object Signature;
525
1
  serializeArray(Signature, "returns",
526
1
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
1
  Array Parameters;
529
1
  for (const auto &P : FS.getParameters()) {
530
0
    Object Parameter;
531
0
    Parameter["name"] = P.Name;
532
0
    serializeArray(Parameter, "declarationFragments",
533
0
                   serializeDeclarationFragments(P.Fragments));
534
0
    Parameters.emplace_back(std::move(Parameter));
535
0
  }
536
537
1
  if (!Parameters.empty())
538
0
    Signature["parameters"] = std::move(Parameters);
539
540
1
  return Signature;
541
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXMethodTemplateRecord>(clang::extractapi::CXXMethodTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
2
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
2
  const auto &FS = Record.Signature;
521
2
  if (FS.empty())
522
0
    return std::nullopt;
523
524
2
  Object Signature;
525
2
  serializeArray(Signature, "returns",
526
2
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
2
  Array Parameters;
529
2
  for (const auto &P : FS.getParameters()) {
530
2
    Object Parameter;
531
2
    Parameter["name"] = P.Name;
532
2
    serializeArray(Parameter, "declarationFragments",
533
2
                   serializeDeclarationFragments(P.Fragments));
534
2
    Parameters.emplace_back(std::move(Parameter));
535
2
  }
536
537
2
  if (!Parameters.empty())
538
2
    Signature["parameters"] = std::move(Parameters);
539
540
2
  return Signature;
541
2
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXMethodTemplateSpecializationRecord>(clang::extractapi::CXXMethodTemplateSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
1
  const auto &FS = Record.Signature;
521
1
  if (FS.empty())
522
0
    return std::nullopt;
523
524
1
  Object Signature;
525
1
  serializeArray(Signature, "returns",
526
1
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
1
  Array Parameters;
529
1
  for (const auto &P : FS.getParameters()) {
530
1
    Object Parameter;
531
1
    Parameter["name"] = P.Name;
532
1
    serializeArray(Parameter, "declarationFragments",
533
1
                   serializeDeclarationFragments(P.Fragments));
534
1
    Parameters.emplace_back(std::move(Parameter));
535
1
  }
536
537
1
  if (!Parameters.empty())
538
1
    Signature["parameters"] = std::move(Parameters);
539
540
1
  return Signature;
541
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalFunctionTemplateRecord>(clang::extractapi::GlobalFunctionTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
3
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
3
  const auto &FS = Record.Signature;
521
3
  if (FS.empty())
522
0
    return std::nullopt;
523
524
3
  Object Signature;
525
3
  serializeArray(Signature, "returns",
526
3
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
3
  Array Parameters;
529
3
  for (const auto &P : FS.getParameters()) {
530
3
    Object Parameter;
531
3
    Parameter["name"] = P.Name;
532
3
    serializeArray(Parameter, "declarationFragments",
533
3
                   serializeDeclarationFragments(P.Fragments));
534
3
    Parameters.emplace_back(std::move(Parameter));
535
3
  }
536
537
3
  if (!Parameters.empty())
538
3
    Signature["parameters"] = std::move(Parameters);
539
540
3
  return Signature;
541
3
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
1
  const auto &FS = Record.Signature;
521
1
  if (FS.empty())
522
0
    return std::nullopt;
523
524
1
  Object Signature;
525
1
  serializeArray(Signature, "returns",
526
1
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
1
  Array Parameters;
529
1
  for (const auto &P : FS.getParameters()) {
530
1
    Object Parameter;
531
1
    Parameter["name"] = P.Name;
532
1
    serializeArray(Parameter, "declarationFragments",
533
1
                   serializeDeclarationFragments(P.Fragments));
534
1
    Parameters.emplace_back(std::move(Parameter));
535
1
  }
536
537
1
  if (!Parameters.empty())
538
1
    Signature["parameters"] = std::move(Parameters);
539
540
1
  return Signature;
541
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ObjCMethodRecord>(clang::extractapi::ObjCMethodRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
519
12
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::true_type) {
520
12
  const auto &FS = Record.Signature;
521
12
  if (FS.empty())
522
0
    return std::nullopt;
523
524
12
  Object Signature;
525
12
  serializeArray(Signature, "returns",
526
12
                 serializeDeclarationFragments(FS.getReturnType()));
527
528
12
  Array Parameters;
529
12
  for (const auto &P : FS.getParameters()) {
530
3
    Object Parameter;
531
3
    Parameter["name"] = P.Name;
532
3
    serializeArray(Parameter, "declarationFragments",
533
3
                   serializeDeclarationFragments(P.Fragments));
534
3
    Parameters.emplace_back(std::move(Parameter));
535
3
  }
536
537
12
  if (!Parameters.empty())
538
2
    Signature["parameters"] = std::move(Parameters);
539
540
12
  return Signature;
541
12
}
542
543
template <typename RecordTy>
544
std::optional<Object>
545
153
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
153
  return std::nullopt;
547
153
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::NamespaceRecord>(clang::extractapi::NamespaceRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
3
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
3
  return std::nullopt;
547
3
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalVariableRecord>(clang::extractapi::GlobalVariableRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
10
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
10
  return std::nullopt;
547
10
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::EnumRecord>(clang::extractapi::EnumRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
7
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
7
  return std::nullopt;
547
7
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::EnumConstantRecord>(clang::extractapi::EnumConstantRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
15
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
15
  return std::nullopt;
547
15
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::StructRecord>(clang::extractapi::StructRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
8
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
8
  return std::nullopt;
547
8
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::StructFieldRecord>(clang::extractapi::StructFieldRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
8
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
8
  return std::nullopt;
547
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::StaticFieldRecord>(clang::extractapi::StaticFieldRecord const&, std::__1::integral_constant<bool, false>)
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXClassRecord>(clang::extractapi::CXXClassRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
15
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
15
  return std::nullopt;
547
15
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ClassTemplateRecord>(clang::extractapi::ClassTemplateRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
4
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
4
  return std::nullopt;
547
4
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ClassTemplateSpecializationRecord>(clang::extractapi::ClassTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ClassTemplatePartialSpecializationRecord>(clang::extractapi::ClassTemplatePartialSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXFieldRecord>(clang::extractapi::CXXFieldRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
4
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
4
  return std::nullopt;
547
4
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::CXXFieldTemplateRecord>(clang::extractapi::CXXFieldTemplateRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ConceptRecord>(clang::extractapi::ConceptRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalVariableTemplateRecord>(clang::extractapi::GlobalVariableTemplateRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
3
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
3
  return std::nullopt;
547
3
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(clang::extractapi::GlobalVariableTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ObjCContainerRecord>(clang::extractapi::ObjCContainerRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
17
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
17
  return std::nullopt;
547
17
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::ObjCInstanceVariableRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
1
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
1
  return std::nullopt;
547
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::ObjCPropertyRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
10
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
10
  return std::nullopt;
547
10
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::ObjCCategoryRecord>(clang::extractapi::ObjCCategoryRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
4
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
4
  return std::nullopt;
547
4
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::MacroDefinitionRecord>(clang::extractapi::MacroDefinitionRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
14
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
14
  return std::nullopt;
547
14
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::APIRecord>(clang::extractapi::APIRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
11
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
11
  return std::nullopt;
547
11
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeFunctionSignatureMixinImpl<clang::extractapi::TypedefRecord>(clang::extractapi::TypedefRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
545
13
serializeFunctionSignatureMixinImpl(const RecordTy &Record, std::false_type) {
546
13
  return std::nullopt;
547
13
}
548
549
/// Serialize the function signature field, as specified by the
550
/// Symbol Graph format.
551
///
552
/// The Symbol Graph function signature property contains two arrays.
553
///   - The \c returns array is the declaration fragments of the return type;
554
///   - The \c parameters array contains names and declaration fragments of the
555
///     parameters.
556
///
557
/// \returns \c std::nullopt if \p FS is empty, or an \c Object containing the
558
/// formatted function signature.
559
template <typename RecordTy>
560
202
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
202
  serializeObject(Paren, "functionSignature",
562
202
                  serializeFunctionSignatureMixinImpl(
563
202
                      Record, has_function_signature<RecordTy>()));
564
202
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::NamespaceRecord>(llvm::json::Object&, clang::extractapi::NamespaceRecord const&)
Line
Count
Source
560
3
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
3
  serializeObject(Paren, "functionSignature",
562
3
                  serializeFunctionSignatureMixinImpl(
563
3
                      Record, has_function_signature<RecordTy>()));
564
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalFunctionRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionRecord const&)
Line
Count
Source
560
21
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
21
  serializeObject(Paren, "functionSignature",
562
21
                  serializeFunctionSignatureMixinImpl(
563
21
                      Record, has_function_signature<RecordTy>()));
564
21
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalVariableRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableRecord const&)
Line
Count
Source
560
10
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
10
  serializeObject(Paren, "functionSignature",
562
10
                  serializeFunctionSignatureMixinImpl(
563
10
                      Record, has_function_signature<RecordTy>()));
564
10
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::EnumRecord>(llvm::json::Object&, clang::extractapi::EnumRecord const&)
Line
Count
Source
560
7
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
7
  serializeObject(Paren, "functionSignature",
562
7
                  serializeFunctionSignatureMixinImpl(
563
7
                      Record, has_function_signature<RecordTy>()));
564
7
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::EnumConstantRecord>(llvm::json::Object&, clang::extractapi::EnumConstantRecord const&)
Line
Count
Source
560
15
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
15
  serializeObject(Paren, "functionSignature",
562
15
                  serializeFunctionSignatureMixinImpl(
563
15
                      Record, has_function_signature<RecordTy>()));
564
15
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::StructRecord>(llvm::json::Object&, clang::extractapi::StructRecord const&)
Line
Count
Source
560
8
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
8
  serializeObject(Paren, "functionSignature",
562
8
                  serializeFunctionSignatureMixinImpl(
563
8
                      Record, has_function_signature<RecordTy>()));
564
8
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::StructFieldRecord>(llvm::json::Object&, clang::extractapi::StructFieldRecord const&)
Line
Count
Source
560
8
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
8
  serializeObject(Paren, "functionSignature",
562
8
                  serializeFunctionSignatureMixinImpl(
563
8
                      Record, has_function_signature<RecordTy>()));
564
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::StaticFieldRecord>(llvm::json::Object&, clang::extractapi::StaticFieldRecord const&)
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXClassRecord>(llvm::json::Object&, clang::extractapi::CXXClassRecord const&)
Line
Count
Source
560
15
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
15
  serializeObject(Paren, "functionSignature",
562
15
                  serializeFunctionSignatureMixinImpl(
563
15
                      Record, has_function_signature<RecordTy>()));
564
15
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ClassTemplateRecord>(llvm::json::Object&, clang::extractapi::ClassTemplateRecord const&)
Line
Count
Source
560
4
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
4
  serializeObject(Paren, "functionSignature",
562
4
                  serializeFunctionSignatureMixinImpl(
563
4
                      Record, has_function_signature<RecordTy>()));
564
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ClassTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::ClassTemplateSpecializationRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ClassTemplatePartialSpecializationRecord>(llvm::json::Object&, clang::extractapi::ClassTemplatePartialSpecializationRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXInstanceMethodRecord>(llvm::json::Object&, clang::extractapi::CXXInstanceMethodRecord const&)
Line
Count
Source
560
8
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
8
  serializeObject(Paren, "functionSignature",
562
8
                  serializeFunctionSignatureMixinImpl(
563
8
                      Record, has_function_signature<RecordTy>()));
564
8
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXStaticMethodRecord>(llvm::json::Object&, clang::extractapi::CXXStaticMethodRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXMethodTemplateRecord>(llvm::json::Object&, clang::extractapi::CXXMethodTemplateRecord const&)
Line
Count
Source
560
2
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
2
  serializeObject(Paren, "functionSignature",
562
2
                  serializeFunctionSignatureMixinImpl(
563
2
                      Record, has_function_signature<RecordTy>()));
564
2
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXMethodTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::CXXMethodTemplateSpecializationRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXFieldRecord>(llvm::json::Object&, clang::extractapi::CXXFieldRecord const&)
Line
Count
Source
560
4
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
4
  serializeObject(Paren, "functionSignature",
562
4
                  serializeFunctionSignatureMixinImpl(
563
4
                      Record, has_function_signature<RecordTy>()));
564
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::CXXFieldTemplateRecord>(llvm::json::Object&, clang::extractapi::CXXFieldTemplateRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ConceptRecord>(llvm::json::Object&, clang::extractapi::ConceptRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalVariableTemplateRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplateRecord const&)
Line
Count
Source
560
3
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
3
  serializeObject(Paren, "functionSignature",
562
3
                  serializeFunctionSignatureMixinImpl(
563
3
                      Record, has_function_signature<RecordTy>()));
564
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplateSpecializationRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalFunctionTemplateRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionTemplateRecord const&)
Line
Count
Source
560
3
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
3
  serializeObject(Paren, "functionSignature",
562
3
                  serializeFunctionSignatureMixinImpl(
563
3
                      Record, has_function_signature<RecordTy>()));
564
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ObjCContainerRecord>(llvm::json::Object&, clang::extractapi::ObjCContainerRecord const&)
Line
Count
Source
560
17
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
17
  serializeObject(Paren, "functionSignature",
562
17
                  serializeFunctionSignatureMixinImpl(
563
17
                      Record, has_function_signature<RecordTy>()));
564
17
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ObjCInstanceVariableRecord>(llvm::json::Object&, clang::extractapi::ObjCInstanceVariableRecord const&)
Line
Count
Source
560
1
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
1
  serializeObject(Paren, "functionSignature",
562
1
                  serializeFunctionSignatureMixinImpl(
563
1
                      Record, has_function_signature<RecordTy>()));
564
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ObjCMethodRecord>(llvm::json::Object&, clang::extractapi::ObjCMethodRecord const&)
Line
Count
Source
560
12
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
12
  serializeObject(Paren, "functionSignature",
562
12
                  serializeFunctionSignatureMixinImpl(
563
12
                      Record, has_function_signature<RecordTy>()));
564
12
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ObjCPropertyRecord>(llvm::json::Object&, clang::extractapi::ObjCPropertyRecord const&)
Line
Count
Source
560
10
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
10
  serializeObject(Paren, "functionSignature",
562
10
                  serializeFunctionSignatureMixinImpl(
563
10
                      Record, has_function_signature<RecordTy>()));
564
10
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::ObjCCategoryRecord>(llvm::json::Object&, clang::extractapi::ObjCCategoryRecord const&)
Line
Count
Source
560
4
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
4
  serializeObject(Paren, "functionSignature",
562
4
                  serializeFunctionSignatureMixinImpl(
563
4
                      Record, has_function_signature<RecordTy>()));
564
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::MacroDefinitionRecord>(llvm::json::Object&, clang::extractapi::MacroDefinitionRecord const&)
Line
Count
Source
560
14
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
14
  serializeObject(Paren, "functionSignature",
562
14
                  serializeFunctionSignatureMixinImpl(
563
14
                      Record, has_function_signature<RecordTy>()));
564
14
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::APIRecord>(llvm::json::Object&, clang::extractapi::APIRecord const&)
Line
Count
Source
560
11
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
11
  serializeObject(Paren, "functionSignature",
562
11
                  serializeFunctionSignatureMixinImpl(
563
11
                      Record, has_function_signature<RecordTy>()));
564
11
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeFunctionSignatureMixin<clang::extractapi::TypedefRecord>(llvm::json::Object&, clang::extractapi::TypedefRecord const&)
Line
Count
Source
560
13
void serializeFunctionSignatureMixin(Object &Paren, const RecordTy &Record) {
561
13
  serializeObject(Paren, "functionSignature",
562
13
                  serializeFunctionSignatureMixinImpl(
563
13
                      Record, has_function_signature<RecordTy>()));
564
13
}
565
566
template <typename RecordTy>
567
std::optional<std::string> serializeAccessMixinImpl(const RecordTy &Record,
568
38
                                                    std::true_type) {
569
38
  const auto &AccessControl = Record.Access;
570
38
  std::string Access;
571
38
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
38
  Access = AccessControl.getAccess();
574
38
  return Access;
575
38
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXClassRecord>(clang::extractapi::CXXClassRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
15
                                                    std::true_type) {
569
15
  const auto &AccessControl = Record.Access;
570
15
  std::string Access;
571
15
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
15
  Access = AccessControl.getAccess();
574
15
  return Access;
575
15
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ClassTemplateRecord>(clang::extractapi::ClassTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
4
                                                    std::true_type) {
569
4
  const auto &AccessControl = Record.Access;
570
4
  std::string Access;
571
4
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
4
  Access = AccessControl.getAccess();
574
4
  return Access;
575
4
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ClassTemplateSpecializationRecord>(clang::extractapi::ClassTemplateSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
1
                                                    std::true_type) {
569
1
  const auto &AccessControl = Record.Access;
570
1
  std::string Access;
571
1
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
1
  Access = AccessControl.getAccess();
574
1
  return Access;
575
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ClassTemplatePartialSpecializationRecord>(clang::extractapi::ClassTemplatePartialSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
1
                                                    std::true_type) {
569
1
  const auto &AccessControl = Record.Access;
570
1
  std::string Access;
571
1
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
1
  Access = AccessControl.getAccess();
574
1
  return Access;
575
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXInstanceMethodRecord>(clang::extractapi::CXXInstanceMethodRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
8
                                                    std::true_type) {
569
8
  const auto &AccessControl = Record.Access;
570
8
  std::string Access;
571
8
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
8
  Access = AccessControl.getAccess();
574
8
  return Access;
575
8
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXStaticMethodRecord>(clang::extractapi::CXXStaticMethodRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
1
                                                    std::true_type) {
569
1
  const auto &AccessControl = Record.Access;
570
1
  std::string Access;
571
1
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
1
  Access = AccessControl.getAccess();
574
1
  return Access;
575
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXMethodTemplateRecord>(clang::extractapi::CXXMethodTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
2
                                                    std::true_type) {
569
2
  const auto &AccessControl = Record.Access;
570
2
  std::string Access;
571
2
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
2
  Access = AccessControl.getAccess();
574
2
  return Access;
575
2
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXMethodTemplateSpecializationRecord>(clang::extractapi::CXXMethodTemplateSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
1
                                                    std::true_type) {
569
1
  const auto &AccessControl = Record.Access;
570
1
  std::string Access;
571
1
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
1
  Access = AccessControl.getAccess();
574
1
  return Access;
575
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXFieldRecord>(clang::extractapi::CXXFieldRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
4
                                                    std::true_type) {
569
4
  const auto &AccessControl = Record.Access;
570
4
  std::string Access;
571
4
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
4
  Access = AccessControl.getAccess();
574
4
  return Access;
575
4
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::CXXFieldTemplateRecord>(clang::extractapi::CXXFieldTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
568
1
                                                    std::true_type) {
569
1
  const auto &AccessControl = Record.Access;
570
1
  std::string Access;
571
1
  if (AccessControl.empty())
572
0
    return std::nullopt;
573
1
  Access = AccessControl.getAccess();
574
1
  return Access;
575
1
}
576
577
template <typename RecordTy>
578
std::optional<std::string> serializeAccessMixinImpl(const RecordTy &Record,
579
164
                                                    std::false_type) {
580
164
  return std::nullopt;
581
164
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::NamespaceRecord>(clang::extractapi::NamespaceRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
3
                                                    std::false_type) {
580
3
  return std::nullopt;
581
3
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalFunctionRecord>(clang::extractapi::GlobalFunctionRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
21
                                                    std::false_type) {
580
21
  return std::nullopt;
581
21
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalVariableRecord>(clang::extractapi::GlobalVariableRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
10
                                                    std::false_type) {
580
10
  return std::nullopt;
581
10
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::EnumRecord>(clang::extractapi::EnumRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
7
                                                    std::false_type) {
580
7
  return std::nullopt;
581
7
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::EnumConstantRecord>(clang::extractapi::EnumConstantRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
15
                                                    std::false_type) {
580
15
  return std::nullopt;
581
15
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::StructRecord>(clang::extractapi::StructRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
8
                                                    std::false_type) {
580
8
  return std::nullopt;
581
8
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::StructFieldRecord>(clang::extractapi::StructFieldRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
8
                                                    std::false_type) {
580
8
  return std::nullopt;
581
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::StaticFieldRecord>(clang::extractapi::StaticFieldRecord const&, std::__1::integral_constant<bool, false>)
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ConceptRecord>(clang::extractapi::ConceptRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
1
                                                    std::false_type) {
580
1
  return std::nullopt;
581
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalVariableTemplateRecord>(clang::extractapi::GlobalVariableTemplateRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
3
                                                    std::false_type) {
580
3
  return std::nullopt;
581
3
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(clang::extractapi::GlobalVariableTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
1
                                                    std::false_type) {
580
1
  return std::nullopt;
581
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
1
                                                    std::false_type) {
580
1
  return std::nullopt;
581
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalFunctionTemplateRecord>(clang::extractapi::GlobalFunctionTemplateRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
3
                                                    std::false_type) {
580
3
  return std::nullopt;
581
3
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
1
                                                    std::false_type) {
580
1
  return std::nullopt;
581
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ObjCContainerRecord>(clang::extractapi::ObjCContainerRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
17
                                                    std::false_type) {
580
17
  return std::nullopt;
581
17
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::ObjCInstanceVariableRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
1
                                                    std::false_type) {
580
1
  return std::nullopt;
581
1
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ObjCMethodRecord>(clang::extractapi::ObjCMethodRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
12
                                                    std::false_type) {
580
12
  return std::nullopt;
581
12
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::ObjCPropertyRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
10
                                                    std::false_type) {
580
10
  return std::nullopt;
581
10
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::ObjCCategoryRecord>(clang::extractapi::ObjCCategoryRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
4
                                                    std::false_type) {
580
4
  return std::nullopt;
581
4
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::MacroDefinitionRecord>(clang::extractapi::MacroDefinitionRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
14
                                                    std::false_type) {
580
14
  return std::nullopt;
581
14
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::APIRecord>(clang::extractapi::APIRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
11
                                                    std::false_type) {
580
11
  return std::nullopt;
581
11
}
SymbolGraphSerializer.cpp:std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (anonymous namespace)::serializeAccessMixinImpl<clang::extractapi::TypedefRecord>(clang::extractapi::TypedefRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
579
13
                                                    std::false_type) {
580
13
  return std::nullopt;
581
13
}
582
583
template <typename RecordTy>
584
202
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
202
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
202
  if (!accessLevel.has_value())
587
164
    accessLevel = "public";
588
202
  serializeString(Paren, "accessLevel", accessLevel);
589
202
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::NamespaceRecord>(llvm::json::Object&, clang::extractapi::NamespaceRecord const&)
Line
Count
Source
584
3
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
3
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
3
  if (!accessLevel.has_value())
587
3
    accessLevel = "public";
588
3
  serializeString(Paren, "accessLevel", accessLevel);
589
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalFunctionRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionRecord const&)
Line
Count
Source
584
21
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
21
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
21
  if (!accessLevel.has_value())
587
21
    accessLevel = "public";
588
21
  serializeString(Paren, "accessLevel", accessLevel);
589
21
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalVariableRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableRecord const&)
Line
Count
Source
584
10
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
10
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
10
  if (!accessLevel.has_value())
587
10
    accessLevel = "public";
588
10
  serializeString(Paren, "accessLevel", accessLevel);
589
10
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::EnumRecord>(llvm::json::Object&, clang::extractapi::EnumRecord const&)
Line
Count
Source
584
7
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
7
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
7
  if (!accessLevel.has_value())
587
7
    accessLevel = "public";
588
7
  serializeString(Paren, "accessLevel", accessLevel);
589
7
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::EnumConstantRecord>(llvm::json::Object&, clang::extractapi::EnumConstantRecord const&)
Line
Count
Source
584
15
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
15
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
15
  if (!accessLevel.has_value())
587
15
    accessLevel = "public";
588
15
  serializeString(Paren, "accessLevel", accessLevel);
589
15
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::StructRecord>(llvm::json::Object&, clang::extractapi::StructRecord const&)
Line
Count
Source
584
8
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
8
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
8
  if (!accessLevel.has_value())
587
8
    accessLevel = "public";
588
8
  serializeString(Paren, "accessLevel", accessLevel);
589
8
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::StructFieldRecord>(llvm::json::Object&, clang::extractapi::StructFieldRecord const&)
Line
Count
Source
584
8
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
8
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
8
  if (!accessLevel.has_value())
587
8
    accessLevel = "public";
588
8
  serializeString(Paren, "accessLevel", accessLevel);
589
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::StaticFieldRecord>(llvm::json::Object&, clang::extractapi::StaticFieldRecord const&)
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXClassRecord>(llvm::json::Object&, clang::extractapi::CXXClassRecord const&)
Line
Count
Source
584
15
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
15
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
15
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
15
  serializeString(Paren, "accessLevel", accessLevel);
589
15
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ClassTemplateRecord>(llvm::json::Object&, clang::extractapi::ClassTemplateRecord const&)
Line
Count
Source
584
4
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
4
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
4
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
4
  serializeString(Paren, "accessLevel", accessLevel);
589
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ClassTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::ClassTemplateSpecializationRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ClassTemplatePartialSpecializationRecord>(llvm::json::Object&, clang::extractapi::ClassTemplatePartialSpecializationRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXInstanceMethodRecord>(llvm::json::Object&, clang::extractapi::CXXInstanceMethodRecord const&)
Line
Count
Source
584
8
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
8
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
8
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
8
  serializeString(Paren, "accessLevel", accessLevel);
589
8
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXStaticMethodRecord>(llvm::json::Object&, clang::extractapi::CXXStaticMethodRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXMethodTemplateRecord>(llvm::json::Object&, clang::extractapi::CXXMethodTemplateRecord const&)
Line
Count
Source
584
2
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
2
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
2
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
2
  serializeString(Paren, "accessLevel", accessLevel);
589
2
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXMethodTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::CXXMethodTemplateSpecializationRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXFieldRecord>(llvm::json::Object&, clang::extractapi::CXXFieldRecord const&)
Line
Count
Source
584
4
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
4
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
4
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
4
  serializeString(Paren, "accessLevel", accessLevel);
589
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::CXXFieldTemplateRecord>(llvm::json::Object&, clang::extractapi::CXXFieldTemplateRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
0
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ConceptRecord>(llvm::json::Object&, clang::extractapi::ConceptRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
1
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalVariableTemplateRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplateRecord const&)
Line
Count
Source
584
3
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
3
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
3
  if (!accessLevel.has_value())
587
3
    accessLevel = "public";
588
3
  serializeString(Paren, "accessLevel", accessLevel);
589
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplateSpecializationRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
1
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
1
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalFunctionTemplateRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionTemplateRecord const&)
Line
Count
Source
584
3
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
3
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
3
  if (!accessLevel.has_value())
587
3
    accessLevel = "public";
588
3
  serializeString(Paren, "accessLevel", accessLevel);
589
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
1
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ObjCContainerRecord>(llvm::json::Object&, clang::extractapi::ObjCContainerRecord const&)
Line
Count
Source
584
17
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
17
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
17
  if (!accessLevel.has_value())
587
17
    accessLevel = "public";
588
17
  serializeString(Paren, "accessLevel", accessLevel);
589
17
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ObjCInstanceVariableRecord>(llvm::json::Object&, clang::extractapi::ObjCInstanceVariableRecord const&)
Line
Count
Source
584
1
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
1
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
1
  if (!accessLevel.has_value())
587
1
    accessLevel = "public";
588
1
  serializeString(Paren, "accessLevel", accessLevel);
589
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ObjCMethodRecord>(llvm::json::Object&, clang::extractapi::ObjCMethodRecord const&)
Line
Count
Source
584
12
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
12
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
12
  if (!accessLevel.has_value())
587
12
    accessLevel = "public";
588
12
  serializeString(Paren, "accessLevel", accessLevel);
589
12
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ObjCPropertyRecord>(llvm::json::Object&, clang::extractapi::ObjCPropertyRecord const&)
Line
Count
Source
584
10
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
10
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
10
  if (!accessLevel.has_value())
587
10
    accessLevel = "public";
588
10
  serializeString(Paren, "accessLevel", accessLevel);
589
10
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::ObjCCategoryRecord>(llvm::json::Object&, clang::extractapi::ObjCCategoryRecord const&)
Line
Count
Source
584
4
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
4
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
4
  if (!accessLevel.has_value())
587
4
    accessLevel = "public";
588
4
  serializeString(Paren, "accessLevel", accessLevel);
589
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::MacroDefinitionRecord>(llvm::json::Object&, clang::extractapi::MacroDefinitionRecord const&)
Line
Count
Source
584
14
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
14
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
14
  if (!accessLevel.has_value())
587
14
    accessLevel = "public";
588
14
  serializeString(Paren, "accessLevel", accessLevel);
589
14
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::APIRecord>(llvm::json::Object&, clang::extractapi::APIRecord const&)
Line
Count
Source
584
11
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
11
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
11
  if (!accessLevel.has_value())
587
11
    accessLevel = "public";
588
11
  serializeString(Paren, "accessLevel", accessLevel);
589
11
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeAccessMixin<clang::extractapi::TypedefRecord>(llvm::json::Object&, clang::extractapi::TypedefRecord const&)
Line
Count
Source
584
13
void serializeAccessMixin(Object &Paren, const RecordTy &Record) {
585
13
  auto accessLevel = serializeAccessMixinImpl(Record, has_access<RecordTy>());
586
13
  if (!accessLevel.has_value())
587
13
    accessLevel = "public";
588
13
  serializeString(Paren, "accessLevel", accessLevel);
589
13
}
590
591
template <typename RecordTy>
592
std::optional<Object> serializeTemplateMixinImpl(const RecordTy &Record,
593
16
                                                 std::true_type) {
594
16
  const auto &Template = Record.Templ;
595
16
  if (Template.empty())
596
0
    return std::nullopt;
597
598
16
  Object Generics;
599
16
  Array GenericParameters;
600
18
  for (const auto &Param : Template.getParameters()) {
601
18
    Object Parameter;
602
18
    Parameter["name"] = Param.Name;
603
18
    Parameter["index"] = Param.Index;
604
18
    Parameter["depth"] = Param.Depth;
605
18
    GenericParameters.emplace_back(std::move(Parameter));
606
18
  }
607
16
  if (!GenericParameters.empty())
608
16
    Generics["parameters"] = std::move(GenericParameters);
609
610
16
  Array GenericConstraints;
611
16
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
16
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
16
  return Generics;
623
16
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ClassTemplateRecord>(clang::extractapi::ClassTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
4
                                                 std::true_type) {
594
4
  const auto &Template = Record.Templ;
595
4
  if (Template.empty())
596
0
    return std::nullopt;
597
598
4
  Object Generics;
599
4
  Array GenericParameters;
600
5
  for (const auto &Param : Template.getParameters()) {
601
5
    Object Parameter;
602
5
    Parameter["name"] = Param.Name;
603
5
    Parameter["index"] = Param.Index;
604
5
    Parameter["depth"] = Param.Depth;
605
5
    GenericParameters.emplace_back(std::move(Parameter));
606
5
  }
607
4
  if (!GenericParameters.empty())
608
4
    Generics["parameters"] = std::move(GenericParameters);
609
610
4
  Array GenericConstraints;
611
4
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
4
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
4
  return Generics;
623
4
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ClassTemplatePartialSpecializationRecord>(clang::extractapi::ClassTemplatePartialSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
1
                                                 std::true_type) {
594
1
  const auto &Template = Record.Templ;
595
1
  if (Template.empty())
596
0
    return std::nullopt;
597
598
1
  Object Generics;
599
1
  Array GenericParameters;
600
1
  for (const auto &Param : Template.getParameters()) {
601
1
    Object Parameter;
602
1
    Parameter["name"] = Param.Name;
603
1
    Parameter["index"] = Param.Index;
604
1
    Parameter["depth"] = Param.Depth;
605
1
    GenericParameters.emplace_back(std::move(Parameter));
606
1
  }
607
1
  if (!GenericParameters.empty())
608
1
    Generics["parameters"] = std::move(GenericParameters);
609
610
1
  Array GenericConstraints;
611
1
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
1
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
1
  return Generics;
623
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXMethodTemplateRecord>(clang::extractapi::CXXMethodTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
2
                                                 std::true_type) {
594
2
  const auto &Template = Record.Templ;
595
2
  if (Template.empty())
596
0
    return std::nullopt;
597
598
2
  Object Generics;
599
2
  Array GenericParameters;
600
2
  for (const auto &Param : Template.getParameters()) {
601
2
    Object Parameter;
602
2
    Parameter["name"] = Param.Name;
603
2
    Parameter["index"] = Param.Index;
604
2
    Parameter["depth"] = Param.Depth;
605
2
    GenericParameters.emplace_back(std::move(Parameter));
606
2
  }
607
2
  if (!GenericParameters.empty())
608
2
    Generics["parameters"] = std::move(GenericParameters);
609
610
2
  Array GenericConstraints;
611
2
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
2
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
2
  return Generics;
623
2
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXFieldTemplateRecord>(clang::extractapi::CXXFieldTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
1
                                                 std::true_type) {
594
1
  const auto &Template = Record.Templ;
595
1
  if (Template.empty())
596
0
    return std::nullopt;
597
598
1
  Object Generics;
599
1
  Array GenericParameters;
600
1
  for (const auto &Param : Template.getParameters()) {
601
1
    Object Parameter;
602
1
    Parameter["name"] = Param.Name;
603
1
    Parameter["index"] = Param.Index;
604
1
    Parameter["depth"] = Param.Depth;
605
1
    GenericParameters.emplace_back(std::move(Parameter));
606
1
  }
607
1
  if (!GenericParameters.empty())
608
1
    Generics["parameters"] = std::move(GenericParameters);
609
610
1
  Array GenericConstraints;
611
1
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
1
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
1
  return Generics;
623
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ConceptRecord>(clang::extractapi::ConceptRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
1
                                                 std::true_type) {
594
1
  const auto &Template = Record.Templ;
595
1
  if (Template.empty())
596
0
    return std::nullopt;
597
598
1
  Object Generics;
599
1
  Array GenericParameters;
600
1
  for (const auto &Param : Template.getParameters()) {
601
1
    Object Parameter;
602
1
    Parameter["name"] = Param.Name;
603
1
    Parameter["index"] = Param.Index;
604
1
    Parameter["depth"] = Param.Depth;
605
1
    GenericParameters.emplace_back(std::move(Parameter));
606
1
  }
607
1
  if (!GenericParameters.empty())
608
1
    Generics["parameters"] = std::move(GenericParameters);
609
610
1
  Array GenericConstraints;
611
1
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
1
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
1
  return Generics;
623
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalVariableTemplateRecord>(clang::extractapi::GlobalVariableTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
3
                                                 std::true_type) {
594
3
  const auto &Template = Record.Templ;
595
3
  if (Template.empty())
596
0
    return std::nullopt;
597
598
3
  Object Generics;
599
3
  Array GenericParameters;
600
4
  for (const auto &Param : Template.getParameters()) {
601
4
    Object Parameter;
602
4
    Parameter["name"] = Param.Name;
603
4
    Parameter["index"] = Param.Index;
604
4
    Parameter["depth"] = Param.Depth;
605
4
    GenericParameters.emplace_back(std::move(Parameter));
606
4
  }
607
3
  if (!GenericParameters.empty())
608
3
    Generics["parameters"] = std::move(GenericParameters);
609
610
3
  Array GenericConstraints;
611
3
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
3
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
3
  return Generics;
623
3
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
1
                                                 std::true_type) {
594
1
  const auto &Template = Record.Templ;
595
1
  if (Template.empty())
596
0
    return std::nullopt;
597
598
1
  Object Generics;
599
1
  Array GenericParameters;
600
1
  for (const auto &Param : Template.getParameters()) {
601
1
    Object Parameter;
602
1
    Parameter["name"] = Param.Name;
603
1
    Parameter["index"] = Param.Index;
604
1
    Parameter["depth"] = Param.Depth;
605
1
    GenericParameters.emplace_back(std::move(Parameter));
606
1
  }
607
1
  if (!GenericParameters.empty())
608
1
    Generics["parameters"] = std::move(GenericParameters);
609
610
1
  Array GenericConstraints;
611
1
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
1
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
1
  return Generics;
623
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalFunctionTemplateRecord>(clang::extractapi::GlobalFunctionTemplateRecord const&, std::__1::integral_constant<bool, true>)
Line
Count
Source
593
3
                                                 std::true_type) {
594
3
  const auto &Template = Record.Templ;
595
3
  if (Template.empty())
596
0
    return std::nullopt;
597
598
3
  Object Generics;
599
3
  Array GenericParameters;
600
3
  for (const auto &Param : Template.getParameters()) {
601
3
    Object Parameter;
602
3
    Parameter["name"] = Param.Name;
603
3
    Parameter["index"] = Param.Index;
604
3
    Parameter["depth"] = Param.Depth;
605
3
    GenericParameters.emplace_back(std::move(Parameter));
606
3
  }
607
3
  if (!GenericParameters.empty())
608
3
    Generics["parameters"] = std::move(GenericParameters);
609
610
3
  Array GenericConstraints;
611
3
  for (const auto &Constr : Template.getConstraints()) {
612
0
    Object Constraint;
613
0
    Constraint["kind"] = Constr.Kind;
614
0
    Constraint["lhs"] = Constr.LHS;
615
0
    Constraint["rhs"] = Constr.RHS;
616
0
    GenericConstraints.emplace_back(std::move(Constraint));
617
0
  }
618
619
3
  if (!GenericConstraints.empty())
620
0
    Generics["constraints"] = std::move(GenericConstraints);
621
622
3
  return Generics;
623
3
}
624
625
template <typename RecordTy>
626
std::optional<Object> serializeTemplateMixinImpl(const RecordTy &Record,
627
186
                                                 std::false_type) {
628
186
  return std::nullopt;
629
186
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::NamespaceRecord>(clang::extractapi::NamespaceRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
3
                                                 std::false_type) {
628
3
  return std::nullopt;
629
3
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalFunctionRecord>(clang::extractapi::GlobalFunctionRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
21
                                                 std::false_type) {
628
21
  return std::nullopt;
629
21
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalVariableRecord>(clang::extractapi::GlobalVariableRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
10
                                                 std::false_type) {
628
10
  return std::nullopt;
629
10
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::EnumRecord>(clang::extractapi::EnumRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
7
                                                 std::false_type) {
628
7
  return std::nullopt;
629
7
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::EnumConstantRecord>(clang::extractapi::EnumConstantRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
15
                                                 std::false_type) {
628
15
  return std::nullopt;
629
15
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::StructRecord>(clang::extractapi::StructRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
8
                                                 std::false_type) {
628
8
  return std::nullopt;
629
8
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::StructFieldRecord>(clang::extractapi::StructFieldRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
8
                                                 std::false_type) {
628
8
  return std::nullopt;
629
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::StaticFieldRecord>(clang::extractapi::StaticFieldRecord const&, std::__1::integral_constant<bool, false>)
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXClassRecord>(clang::extractapi::CXXClassRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
15
                                                 std::false_type) {
628
15
  return std::nullopt;
629
15
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ClassTemplateSpecializationRecord>(clang::extractapi::ClassTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
1
                                                 std::false_type) {
628
1
  return std::nullopt;
629
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXInstanceMethodRecord>(clang::extractapi::CXXInstanceMethodRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
8
                                                 std::false_type) {
628
8
  return std::nullopt;
629
8
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXStaticMethodRecord>(clang::extractapi::CXXStaticMethodRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
1
                                                 std::false_type) {
628
1
  return std::nullopt;
629
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXMethodTemplateSpecializationRecord>(clang::extractapi::CXXMethodTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
1
                                                 std::false_type) {
628
1
  return std::nullopt;
629
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::CXXFieldRecord>(clang::extractapi::CXXFieldRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
4
                                                 std::false_type) {
628
4
  return std::nullopt;
629
4
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(clang::extractapi::GlobalVariableTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
1
                                                 std::false_type) {
628
1
  return std::nullopt;
629
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
1
                                                 std::false_type) {
628
1
  return std::nullopt;
629
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ObjCContainerRecord>(clang::extractapi::ObjCContainerRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
17
                                                 std::false_type) {
628
17
  return std::nullopt;
629
17
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::ObjCInstanceVariableRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
1
                                                 std::false_type) {
628
1
  return std::nullopt;
629
1
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ObjCMethodRecord>(clang::extractapi::ObjCMethodRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
12
                                                 std::false_type) {
628
12
  return std::nullopt;
629
12
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::ObjCPropertyRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
10
                                                 std::false_type) {
628
10
  return std::nullopt;
629
10
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::ObjCCategoryRecord>(clang::extractapi::ObjCCategoryRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
4
                                                 std::false_type) {
628
4
  return std::nullopt;
629
4
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::MacroDefinitionRecord>(clang::extractapi::MacroDefinitionRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
14
                                                 std::false_type) {
628
14
  return std::nullopt;
629
14
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::APIRecord>(clang::extractapi::APIRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
11
                                                 std::false_type) {
628
11
  return std::nullopt;
629
11
}
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> (anonymous namespace)::serializeTemplateMixinImpl<clang::extractapi::TypedefRecord>(clang::extractapi::TypedefRecord const&, std::__1::integral_constant<bool, false>)
Line
Count
Source
627
13
                                                 std::false_type) {
628
13
  return std::nullopt;
629
13
}
630
631
template <typename RecordTy>
632
202
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
202
  serializeObject(Paren, "swiftGenerics",
634
202
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
202
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::NamespaceRecord>(llvm::json::Object&, clang::extractapi::NamespaceRecord const&)
Line
Count
Source
632
3
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
3
  serializeObject(Paren, "swiftGenerics",
634
3
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalFunctionRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionRecord const&)
Line
Count
Source
632
21
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
21
  serializeObject(Paren, "swiftGenerics",
634
21
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
21
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalVariableRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableRecord const&)
Line
Count
Source
632
10
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
10
  serializeObject(Paren, "swiftGenerics",
634
10
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
10
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::EnumRecord>(llvm::json::Object&, clang::extractapi::EnumRecord const&)
Line
Count
Source
632
7
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
7
  serializeObject(Paren, "swiftGenerics",
634
7
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
7
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::EnumConstantRecord>(llvm::json::Object&, clang::extractapi::EnumConstantRecord const&)
Line
Count
Source
632
15
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
15
  serializeObject(Paren, "swiftGenerics",
634
15
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
15
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::StructRecord>(llvm::json::Object&, clang::extractapi::StructRecord const&)
Line
Count
Source
632
8
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
8
  serializeObject(Paren, "swiftGenerics",
634
8
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
8
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::StructFieldRecord>(llvm::json::Object&, clang::extractapi::StructFieldRecord const&)
Line
Count
Source
632
8
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
8
  serializeObject(Paren, "swiftGenerics",
634
8
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::StaticFieldRecord>(llvm::json::Object&, clang::extractapi::StaticFieldRecord const&)
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXClassRecord>(llvm::json::Object&, clang::extractapi::CXXClassRecord const&)
Line
Count
Source
632
15
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
15
  serializeObject(Paren, "swiftGenerics",
634
15
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
15
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ClassTemplateRecord>(llvm::json::Object&, clang::extractapi::ClassTemplateRecord const&)
Line
Count
Source
632
4
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
4
  serializeObject(Paren, "swiftGenerics",
634
4
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ClassTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::ClassTemplateSpecializationRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ClassTemplatePartialSpecializationRecord>(llvm::json::Object&, clang::extractapi::ClassTemplatePartialSpecializationRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXInstanceMethodRecord>(llvm::json::Object&, clang::extractapi::CXXInstanceMethodRecord const&)
Line
Count
Source
632
8
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
8
  serializeObject(Paren, "swiftGenerics",
634
8
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
8
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXStaticMethodRecord>(llvm::json::Object&, clang::extractapi::CXXStaticMethodRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXMethodTemplateRecord>(llvm::json::Object&, clang::extractapi::CXXMethodTemplateRecord const&)
Line
Count
Source
632
2
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
2
  serializeObject(Paren, "swiftGenerics",
634
2
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
2
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXMethodTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::CXXMethodTemplateSpecializationRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXFieldRecord>(llvm::json::Object&, clang::extractapi::CXXFieldRecord const&)
Line
Count
Source
632
4
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
4
  serializeObject(Paren, "swiftGenerics",
634
4
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::CXXFieldTemplateRecord>(llvm::json::Object&, clang::extractapi::CXXFieldTemplateRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ConceptRecord>(llvm::json::Object&, clang::extractapi::ConceptRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalVariableTemplateRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplateRecord const&)
Line
Count
Source
632
3
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
3
  serializeObject(Paren, "swiftGenerics",
634
3
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplateSpecializationRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalFunctionTemplateRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionTemplateRecord const&)
Line
Count
Source
632
3
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
3
  serializeObject(Paren, "swiftGenerics",
634
3
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
3
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(llvm::json::Object&, clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ObjCContainerRecord>(llvm::json::Object&, clang::extractapi::ObjCContainerRecord const&)
Line
Count
Source
632
17
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
17
  serializeObject(Paren, "swiftGenerics",
634
17
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
17
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ObjCInstanceVariableRecord>(llvm::json::Object&, clang::extractapi::ObjCInstanceVariableRecord const&)
Line
Count
Source
632
1
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
1
  serializeObject(Paren, "swiftGenerics",
634
1
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
1
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ObjCMethodRecord>(llvm::json::Object&, clang::extractapi::ObjCMethodRecord const&)
Line
Count
Source
632
12
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
12
  serializeObject(Paren, "swiftGenerics",
634
12
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
12
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ObjCPropertyRecord>(llvm::json::Object&, clang::extractapi::ObjCPropertyRecord const&)
Line
Count
Source
632
10
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
10
  serializeObject(Paren, "swiftGenerics",
634
10
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
10
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::ObjCCategoryRecord>(llvm::json::Object&, clang::extractapi::ObjCCategoryRecord const&)
Line
Count
Source
632
4
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
4
  serializeObject(Paren, "swiftGenerics",
634
4
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
4
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::MacroDefinitionRecord>(llvm::json::Object&, clang::extractapi::MacroDefinitionRecord const&)
Line
Count
Source
632
14
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
14
  serializeObject(Paren, "swiftGenerics",
634
14
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
14
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::APIRecord>(llvm::json::Object&, clang::extractapi::APIRecord const&)
Line
Count
Source
632
11
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
11
  serializeObject(Paren, "swiftGenerics",
634
11
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
11
}
SymbolGraphSerializer.cpp:void (anonymous namespace)::serializeTemplateMixin<clang::extractapi::TypedefRecord>(llvm::json::Object&, clang::extractapi::TypedefRecord const&)
Line
Count
Source
632
13
void serializeTemplateMixin(Object &Paren, const RecordTy &Record) {
633
13
  serializeObject(Paren, "swiftGenerics",
634
13
                  serializeTemplateMixinImpl(Record, has_template<RecordTy>()));
635
13
}
636
637
struct PathComponent {
638
  StringRef USR;
639
  StringRef Name;
640
  APIRecord::RecordKind Kind;
641
642
  PathComponent(StringRef USR, StringRef Name, APIRecord::RecordKind Kind)
643
320
      : USR(USR), Name(Name), Kind(Kind) {}
644
};
645
646
template <typename RecordTy>
647
bool generatePathComponents(
648
    const RecordTy &Record, const APISet &API,
649
227
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
227
  SmallVector<PathComponent, 4> ReverseComponenents;
651
227
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
227
  const auto *CurrentParent = &Record.ParentInformation;
653
227
  bool FailedToFindParent = false;
654
314
  while (CurrentParent && !CurrentParent->empty()) {
655
87
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
87
                                         CurrentParent->ParentName,
657
87
                                         CurrentParent->ParentKind);
658
659
87
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
87
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
87
    if (auto *CategoryRecord =
667
87
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
10
      if (!CategoryRecord->IsFromExternalModule) {
669
6
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
6
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
6
                                               CategoryRecord->Interface.Name,
672
6
                                               APIRecord::RK_ObjCInterface);
673
6
      }
674
10
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
87
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
87
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
87
    CurrentParent = &ParentRecord->ParentInformation;
685
87
  }
686
687
227
  for (const auto &PC : reverse(ReverseComponenents))
688
314
    ComponentTransformer(PC);
689
690
227
  return FailedToFindParent;
691
227
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::NamespaceRecord>(clang::extractapi::NamespaceRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
3
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
3
  SmallVector<PathComponent, 4> ReverseComponenents;
651
3
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
3
  const auto *CurrentParent = &Record.ParentInformation;
653
3
  bool FailedToFindParent = false;
654
4
  while (CurrentParent && !CurrentParent->empty()) {
655
1
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
1
                                         CurrentParent->ParentName,
657
1
                                         CurrentParent->ParentKind);
658
659
1
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
1
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
1
    if (auto *CategoryRecord =
667
1
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
1
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
1
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
1
    CurrentParent = &ParentRecord->ParentInformation;
685
1
  }
686
687
3
  for (const auto &PC : reverse(ReverseComponenents))
688
4
    ComponentTransformer(PC);
689
690
3
  return FailedToFindParent;
691
3
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalFunctionRecord>(clang::extractapi::GlobalFunctionRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
21
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
21
  SmallVector<PathComponent, 4> ReverseComponenents;
651
21
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
21
  const auto *CurrentParent = &Record.ParentInformation;
653
21
  bool FailedToFindParent = false;
654
21
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
21
  for (const auto &PC : reverse(ReverseComponenents))
688
21
    ComponentTransformer(PC);
689
690
21
  return FailedToFindParent;
691
21
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalVariableRecord>(clang::extractapi::GlobalVariableRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
10
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
10
  SmallVector<PathComponent, 4> ReverseComponenents;
651
10
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
10
  const auto *CurrentParent = &Record.ParentInformation;
653
10
  bool FailedToFindParent = false;
654
10
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
10
  for (const auto &PC : reverse(ReverseComponenents))
688
10
    ComponentTransformer(PC);
689
690
10
  return FailedToFindParent;
691
10
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::EnumRecord>(clang::extractapi::EnumRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
7
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
7
  SmallVector<PathComponent, 4> ReverseComponenents;
651
7
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
7
  const auto *CurrentParent = &Record.ParentInformation;
653
7
  bool FailedToFindParent = false;
654
7
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
7
  for (const auto &PC : reverse(ReverseComponenents))
688
7
    ComponentTransformer(PC);
689
690
7
  return FailedToFindParent;
691
7
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::EnumConstantRecord>(clang::extractapi::EnumConstantRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
15
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
15
  SmallVector<PathComponent, 4> ReverseComponenents;
651
15
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
15
  const auto *CurrentParent = &Record.ParentInformation;
653
15
  bool FailedToFindParent = false;
654
30
  while (CurrentParent && !CurrentParent->empty()) {
655
15
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
15
                                         CurrentParent->ParentName,
657
15
                                         CurrentParent->ParentKind);
658
659
15
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
15
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
15
    if (auto *CategoryRecord =
667
15
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
15
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
15
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
15
    CurrentParent = &ParentRecord->ParentInformation;
685
15
  }
686
687
15
  for (const auto &PC : reverse(ReverseComponenents))
688
30
    ComponentTransformer(PC);
689
690
15
  return FailedToFindParent;
691
15
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::StructRecord>(clang::extractapi::StructRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
8
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
8
  SmallVector<PathComponent, 4> ReverseComponenents;
651
8
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
8
  const auto *CurrentParent = &Record.ParentInformation;
653
8
  bool FailedToFindParent = false;
654
8
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
8
  for (const auto &PC : reverse(ReverseComponenents))
688
8
    ComponentTransformer(PC);
689
690
8
  return FailedToFindParent;
691
8
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::StructFieldRecord>(clang::extractapi::StructFieldRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
8
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
8
  SmallVector<PathComponent, 4> ReverseComponenents;
651
8
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
8
  const auto *CurrentParent = &Record.ParentInformation;
653
8
  bool FailedToFindParent = false;
654
16
  while (CurrentParent && !CurrentParent->empty()) {
655
8
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
8
                                         CurrentParent->ParentName,
657
8
                                         CurrentParent->ParentKind);
658
659
8
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
8
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
8
    if (auto *CategoryRecord =
667
8
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
8
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
8
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
8
    CurrentParent = &ParentRecord->ParentInformation;
685
8
  }
686
687
8
  for (const auto &PC : reverse(ReverseComponenents))
688
16
    ComponentTransformer(PC);
689
690
8
  return FailedToFindParent;
691
8
}
Unexecuted instantiation: SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::StaticFieldRecord>(clang::extractapi::StaticFieldRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXClassRecord>(clang::extractapi::CXXClassRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
15
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
15
  SmallVector<PathComponent, 4> ReverseComponenents;
651
15
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
15
  const auto *CurrentParent = &Record.ParentInformation;
653
15
  bool FailedToFindParent = false;
654
16
  while (CurrentParent && !CurrentParent->empty()) {
655
1
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
1
                                         CurrentParent->ParentName,
657
1
                                         CurrentParent->ParentKind);
658
659
1
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
1
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
1
    if (auto *CategoryRecord =
667
1
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
1
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
1
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
1
    CurrentParent = &ParentRecord->ParentInformation;
685
1
  }
686
687
15
  for (const auto &PC : reverse(ReverseComponenents))
688
16
    ComponentTransformer(PC);
689
690
15
  return FailedToFindParent;
691
15
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ClassTemplateRecord>(clang::extractapi::ClassTemplateRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
4
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
4
  SmallVector<PathComponent, 4> ReverseComponenents;
651
4
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
4
  const auto *CurrentParent = &Record.ParentInformation;
653
4
  bool FailedToFindParent = false;
654
4
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
4
  for (const auto &PC : reverse(ReverseComponenents))
688
4
    ComponentTransformer(PC);
689
690
4
  return FailedToFindParent;
691
4
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ClassTemplateSpecializationRecord>(clang::extractapi::ClassTemplateSpecializationRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
1
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
1
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ClassTemplatePartialSpecializationRecord>(clang::extractapi::ClassTemplatePartialSpecializationRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
1
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
1
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXInstanceMethodRecord>(clang::extractapi::CXXInstanceMethodRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
8
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
8
  SmallVector<PathComponent, 4> ReverseComponenents;
651
8
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
8
  const auto *CurrentParent = &Record.ParentInformation;
653
8
  bool FailedToFindParent = false;
654
16
  while (CurrentParent && !CurrentParent->empty()) {
655
8
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
8
                                         CurrentParent->ParentName,
657
8
                                         CurrentParent->ParentKind);
658
659
8
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
8
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
8
    if (auto *CategoryRecord =
667
8
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
8
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
8
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
8
    CurrentParent = &ParentRecord->ParentInformation;
685
8
  }
686
687
8
  for (const auto &PC : reverse(ReverseComponenents))
688
16
    ComponentTransformer(PC);
689
690
8
  return FailedToFindParent;
691
8
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXStaticMethodRecord>(clang::extractapi::CXXStaticMethodRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
2
  while (CurrentParent && !CurrentParent->empty()) {
655
1
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
1
                                         CurrentParent->ParentName,
657
1
                                         CurrentParent->ParentKind);
658
659
1
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
1
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
1
    if (auto *CategoryRecord =
667
1
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
1
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
1
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
1
    CurrentParent = &ParentRecord->ParentInformation;
685
1
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
2
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXMethodTemplateRecord>(clang::extractapi::CXXMethodTemplateRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
2
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
2
  SmallVector<PathComponent, 4> ReverseComponenents;
651
2
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
2
  const auto *CurrentParent = &Record.ParentInformation;
653
2
  bool FailedToFindParent = false;
654
4
  while (CurrentParent && !CurrentParent->empty()) {
655
2
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
2
                                         CurrentParent->ParentName,
657
2
                                         CurrentParent->ParentKind);
658
659
2
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
2
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
2
    if (auto *CategoryRecord =
667
2
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
2
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
2
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
2
    CurrentParent = &ParentRecord->ParentInformation;
685
2
  }
686
687
2
  for (const auto &PC : reverse(ReverseComponenents))
688
4
    ComponentTransformer(PC);
689
690
2
  return FailedToFindParent;
691
2
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXMethodTemplateSpecializationRecord>(clang::extractapi::CXXMethodTemplateSpecializationRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
2
  while (CurrentParent && !CurrentParent->empty()) {
655
1
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
1
                                         CurrentParent->ParentName,
657
1
                                         CurrentParent->ParentKind);
658
659
1
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
1
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
1
    if (auto *CategoryRecord =
667
1
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
1
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
1
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
1
    CurrentParent = &ParentRecord->ParentInformation;
685
1
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
2
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXFieldRecord>(clang::extractapi::CXXFieldRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
4
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
4
  SmallVector<PathComponent, 4> ReverseComponenents;
651
4
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
4
  const auto *CurrentParent = &Record.ParentInformation;
653
4
  bool FailedToFindParent = false;
654
8
  while (CurrentParent && !CurrentParent->empty()) {
655
4
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
4
                                         CurrentParent->ParentName,
657
4
                                         CurrentParent->ParentKind);
658
659
4
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
4
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
4
    if (auto *CategoryRecord =
667
4
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
4
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
4
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
4
    CurrentParent = &ParentRecord->ParentInformation;
685
4
  }
686
687
4
  for (const auto &PC : reverse(ReverseComponenents))
688
8
    ComponentTransformer(PC);
689
690
4
  return FailedToFindParent;
691
4
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::CXXFieldTemplateRecord>(clang::extractapi::CXXFieldTemplateRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
2
  while (CurrentParent && !CurrentParent->empty()) {
655
1
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
1
                                         CurrentParent->ParentName,
657
1
                                         CurrentParent->ParentKind);
658
659
1
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
1
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
1
    if (auto *CategoryRecord =
667
1
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
1
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
1
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
1
    CurrentParent = &ParentRecord->ParentInformation;
685
1
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
2
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ConceptRecord>(clang::extractapi::ConceptRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
1
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
1
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalVariableTemplateRecord>(clang::extractapi::GlobalVariableTemplateRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
3
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
3
  SmallVector<PathComponent, 4> ReverseComponenents;
651
3
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
3
  const auto *CurrentParent = &Record.ParentInformation;
653
3
  bool FailedToFindParent = false;
654
3
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
3
  for (const auto &PC : reverse(ReverseComponenents))
688
3
    ComponentTransformer(PC);
689
690
3
  return FailedToFindParent;
691
3
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(clang::extractapi::GlobalVariableTemplateSpecializationRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
1
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
1
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
1
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
1
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalFunctionTemplateRecord>(clang::extractapi::GlobalFunctionTemplateRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
3
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
3
  SmallVector<PathComponent, 4> ReverseComponenents;
651
3
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
3
  const auto *CurrentParent = &Record.ParentInformation;
653
3
  bool FailedToFindParent = false;
654
3
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
3
  for (const auto &PC : reverse(ReverseComponenents))
688
3
    ComponentTransformer(PC);
689
690
3
  return FailedToFindParent;
691
3
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
1
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
1
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ObjCContainerRecord>(clang::extractapi::ObjCContainerRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
17
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
17
  SmallVector<PathComponent, 4> ReverseComponenents;
651
17
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
17
  const auto *CurrentParent = &Record.ParentInformation;
653
17
  bool FailedToFindParent = false;
654
17
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
17
  for (const auto &PC : reverse(ReverseComponenents))
688
17
    ComponentTransformer(PC);
689
690
17
  return FailedToFindParent;
691
17
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::ObjCInstanceVariableRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
1
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
1
  SmallVector<PathComponent, 4> ReverseComponenents;
651
1
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
1
  const auto *CurrentParent = &Record.ParentInformation;
653
1
  bool FailedToFindParent = false;
654
2
  while (CurrentParent && !CurrentParent->empty()) {
655
1
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
1
                                         CurrentParent->ParentName,
657
1
                                         CurrentParent->ParentKind);
658
659
1
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
1
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
1
    if (auto *CategoryRecord =
667
1
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
1
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
1
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
1
    CurrentParent = &ParentRecord->ParentInformation;
685
1
  }
686
687
1
  for (const auto &PC : reverse(ReverseComponenents))
688
2
    ComponentTransformer(PC);
689
690
1
  return FailedToFindParent;
691
1
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ObjCMethodRecord>(clang::extractapi::ObjCMethodRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
12
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
12
  SmallVector<PathComponent, 4> ReverseComponenents;
651
12
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
12
  const auto *CurrentParent = &Record.ParentInformation;
653
12
  bool FailedToFindParent = false;
654
24
  while (CurrentParent && !CurrentParent->empty()) {
655
12
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
12
                                         CurrentParent->ParentName,
657
12
                                         CurrentParent->ParentKind);
658
659
12
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
12
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
12
    if (auto *CategoryRecord =
667
12
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
7
      if (!CategoryRecord->IsFromExternalModule) {
669
3
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
3
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
3
                                               CategoryRecord->Interface.Name,
672
3
                                               APIRecord::RK_ObjCInterface);
673
3
      }
674
7
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
12
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
12
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
12
    CurrentParent = &ParentRecord->ParentInformation;
685
12
  }
686
687
12
  for (const auto &PC : reverse(ReverseComponenents))
688
24
    ComponentTransformer(PC);
689
690
12
  return FailedToFindParent;
691
12
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::ObjCPropertyRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
10
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
10
  SmallVector<PathComponent, 4> ReverseComponenents;
651
10
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
10
  const auto *CurrentParent = &Record.ParentInformation;
653
10
  bool FailedToFindParent = false;
654
20
  while (CurrentParent && !CurrentParent->empty()) {
655
10
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
10
                                         CurrentParent->ParentName,
657
10
                                         CurrentParent->ParentKind);
658
659
10
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
10
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
10
    if (auto *CategoryRecord =
667
10
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
3
      if (!CategoryRecord->IsFromExternalModule) {
669
3
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
3
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
3
                                               CategoryRecord->Interface.Name,
672
3
                                               APIRecord::RK_ObjCInterface);
673
3
      }
674
3
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
10
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
10
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
10
    CurrentParent = &ParentRecord->ParentInformation;
685
10
  }
686
687
10
  for (const auto &PC : reverse(ReverseComponenents))
688
20
    ComponentTransformer(PC);
689
690
10
  return FailedToFindParent;
691
10
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::ObjCCategoryRecord>(clang::extractapi::ObjCCategoryRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
4
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
4
  SmallVector<PathComponent, 4> ReverseComponenents;
651
4
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
4
  const auto *CurrentParent = &Record.ParentInformation;
653
4
  bool FailedToFindParent = false;
654
4
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
4
  for (const auto &PC : reverse(ReverseComponenents))
688
4
    ComponentTransformer(PC);
689
690
4
  return FailedToFindParent;
691
4
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::MacroDefinitionRecord>(clang::extractapi::MacroDefinitionRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
14
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
14
  SmallVector<PathComponent, 4> ReverseComponenents;
651
14
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
14
  const auto *CurrentParent = &Record.ParentInformation;
653
14
  bool FailedToFindParent = false;
654
14
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
14
  for (const auto &PC : reverse(ReverseComponenents))
688
14
    ComponentTransformer(PC);
689
690
14
  return FailedToFindParent;
691
14
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::APIRecord>(clang::extractapi::APIRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
36
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
36
  SmallVector<PathComponent, 4> ReverseComponenents;
651
36
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
36
  const auto *CurrentParent = &Record.ParentInformation;
653
36
  bool FailedToFindParent = false;
654
58
  while (CurrentParent && !CurrentParent->empty()) {
655
22
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
22
                                         CurrentParent->ParentName,
657
22
                                         CurrentParent->ParentKind);
658
659
22
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
22
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
22
    if (auto *CategoryRecord =
667
22
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
22
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
22
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
22
    CurrentParent = &ParentRecord->ParentInformation;
685
22
  }
686
687
36
  for (const auto &PC : reverse(ReverseComponenents))
688
58
    ComponentTransformer(PC);
689
690
36
  return FailedToFindParent;
691
36
}
SymbolGraphSerializer.cpp:bool (anonymous namespace)::generatePathComponents<clang::extractapi::TypedefRecord>(clang::extractapi::TypedefRecord const&, clang::extractapi::APISet const&, llvm::function_ref<void ((anonymous namespace)::PathComponent const&)>)
Line
Count
Source
649
13
    function_ref<void(const PathComponent &)> ComponentTransformer) {
650
13
  SmallVector<PathComponent, 4> ReverseComponenents;
651
13
  ReverseComponenents.emplace_back(Record.USR, Record.Name, Record.getKind());
652
13
  const auto *CurrentParent = &Record.ParentInformation;
653
13
  bool FailedToFindParent = false;
654
13
  while (CurrentParent && !CurrentParent->empty()) {
655
0
    PathComponent CurrentParentComponent(CurrentParent->ParentUSR,
656
0
                                         CurrentParent->ParentName,
657
0
                                         CurrentParent->ParentKind);
658
659
0
    auto *ParentRecord = CurrentParent->ParentRecord;
660
    // Slow path if we don't have a direct reference to the ParentRecord
661
0
    if (!ParentRecord)
662
0
      ParentRecord = API.findRecordForUSR(CurrentParent->ParentUSR);
663
664
    // If the parent is a category extended from internal module then we need to
665
    // pretend this belongs to the associated interface.
666
0
    if (auto *CategoryRecord =
667
0
            dyn_cast_or_null<ObjCCategoryRecord>(ParentRecord)) {
668
0
      if (!CategoryRecord->IsFromExternalModule) {
669
0
        ParentRecord = API.findRecordForUSR(CategoryRecord->Interface.USR);
670
0
        CurrentParentComponent = PathComponent(CategoryRecord->Interface.USR,
671
0
                                               CategoryRecord->Interface.Name,
672
0
                                               APIRecord::RK_ObjCInterface);
673
0
      }
674
0
    }
675
676
    // The parent record doesn't exist which means the symbol shouldn't be
677
    // treated as part of the current product.
678
0
    if (!ParentRecord) {
679
0
      FailedToFindParent = true;
680
0
      break;
681
0
    }
682
683
0
    ReverseComponenents.push_back(std::move(CurrentParentComponent));
684
0
    CurrentParent = &ParentRecord->ParentInformation;
685
0
  }
686
687
13
  for (const auto &PC : reverse(ReverseComponenents))
688
13
    ComponentTransformer(PC);
689
690
13
  return FailedToFindParent;
691
13
}
692
693
36
Object serializeParentContext(const PathComponent &PC, Language Lang) {
694
36
  Object ParentContextElem;
695
36
  ParentContextElem["usr"] = PC.USR;
696
36
  ParentContextElem["name"] = PC.Name;
697
36
  ParentContextElem["kind"] = serializeSymbolKind(PC.Kind, Lang)["identifier"];
698
36
  return ParentContextElem;
699
36
}
700
701
template <typename RecordTy>
702
Array generateParentContexts(const RecordTy &Record, const APISet &API,
703
25
                             Language Lang) {
704
25
  Array ParentContexts;
705
25
  generatePathComponents(
706
36
      Record, API, [Lang, &ParentContexts](const PathComponent &PC) {
707
36
        ParentContexts.push_back(serializeParentContext(PC, Lang));
708
36
      });
709
710
25
  return ParentContexts;
711
25
}
712
} // namespace
713
714
/// Defines the format version emitted by SymbolGraphSerializer.
715
const VersionTuple SymbolGraphSerializer::FormatVersion{0, 5, 3};
716
717
75
Object SymbolGraphSerializer::serializeMetadata() const {
718
75
  Object Metadata;
719
75
  serializeObject(Metadata, "formatVersion",
720
75
                  serializeSemanticVersion(FormatVersion));
721
75
  Metadata["generator"] = clang::getClangFullVersion();
722
75
  return Metadata;
723
75
}
724
725
75
Object SymbolGraphSerializer::serializeModule() const {
726
75
  Object Module;
727
  // The user is expected to always pass `--product-name=` on the command line
728
  // to populate this field.
729
75
  Module["name"] = API.ProductName;
730
75
  serializeObject(Module, "platform", serializePlatform(API.getTarget()));
731
75
  return Module;
732
75
}
733
734
221
bool SymbolGraphSerializer::shouldSkip(const APIRecord &Record) const {
735
  // Skip explicitly ignored symbols.
736
221
  if (IgnoresList.shouldIgnore(Record.Name))
737
12
    return true;
738
739
  // Skip unconditionally unavailable symbols
740
209
  if (Record.Availabilities.isUnconditionallyUnavailable())
741
3
    return true;
742
743
  // Filter out symbols prefixed with an underscored as they are understood to
744
  // be symbols clients should not use.
745
206
  if (Record.Name.startswith("_"))
746
4
    return true;
747
748
202
  return false;
749
206
}
750
751
template <typename RecordTy>
752
std::optional<Object>
753
221
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
221
  if (shouldSkip(Record))
755
19
    return std::nullopt;
756
757
202
  Object Obj;
758
202
  serializeObject(Obj, "identifier",
759
202
                  serializeIdentifier(Record, API.getLanguage()));
760
202
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
202
  serializeObject(Obj, "names", serializeNames(Record));
762
202
  serializeObject(
763
202
      Obj, "location",
764
202
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
202
  serializeArray(Obj, "availability",
766
202
                 serializeAvailability(Record.Availabilities));
767
202
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
202
  serializeArray(Obj, "declarationFragments",
769
202
                 serializeDeclarationFragments(Record.Declaration));
770
202
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
202
  if (generatePathComponents(Record, API,
774
278
                             [&PathComponentsNames](const PathComponent &PC) {
775
278
                               PathComponentsNames.push_back(PC.Name);
776
278
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::NamespaceRecord>(clang::extractapi::NamespaceRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalFunctionRecord>(clang::extractapi::GlobalFunctionRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
21
                             [&PathComponentsNames](const PathComponent &PC) {
775
21
                               PathComponentsNames.push_back(PC.Name);
776
21
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableRecord>(clang::extractapi::GlobalVariableRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
10
                             [&PathComponentsNames](const PathComponent &PC) {
775
10
                               PathComponentsNames.push_back(PC.Name);
776
10
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::EnumRecord>(clang::extractapi::EnumRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
7
                             [&PathComponentsNames](const PathComponent &PC) {
775
7
                               PathComponentsNames.push_back(PC.Name);
776
7
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::EnumConstantRecord>(clang::extractapi::EnumConstantRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
30
                             [&PathComponentsNames](const PathComponent &PC) {
775
30
                               PathComponentsNames.push_back(PC.Name);
776
30
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::StructRecord>(clang::extractapi::StructRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
8
                             [&PathComponentsNames](const PathComponent &PC) {
775
8
                               PathComponentsNames.push_back(PC.Name);
776
8
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::StructFieldRecord>(clang::extractapi::StructFieldRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
16
                             [&PathComponentsNames](const PathComponent &PC) {
775
16
                               PathComponentsNames.push_back(PC.Name);
776
16
                             }))
Unexecuted instantiation: SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::StaticFieldRecord>(clang::extractapi::StaticFieldRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXClassRecord>(clang::extractapi::CXXClassRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
16
                             [&PathComponentsNames](const PathComponent &PC) {
775
16
                               PathComponentsNames.push_back(PC.Name);
776
16
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ClassTemplateRecord>(clang::extractapi::ClassTemplateRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ClassTemplateSpecializationRecord>(clang::extractapi::ClassTemplateSpecializationRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ClassTemplatePartialSpecializationRecord>(clang::extractapi::ClassTemplatePartialSpecializationRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXInstanceMethodRecord>(clang::extractapi::CXXInstanceMethodRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
16
                             [&PathComponentsNames](const PathComponent &PC) {
775
16
                               PathComponentsNames.push_back(PC.Name);
776
16
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXStaticMethodRecord>(clang::extractapi::CXXStaticMethodRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
2
                             [&PathComponentsNames](const PathComponent &PC) {
775
2
                               PathComponentsNames.push_back(PC.Name);
776
2
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXMethodTemplateRecord>(clang::extractapi::CXXMethodTemplateRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXMethodTemplateSpecializationRecord>(clang::extractapi::CXXMethodTemplateSpecializationRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
2
                             [&PathComponentsNames](const PathComponent &PC) {
775
2
                               PathComponentsNames.push_back(PC.Name);
776
2
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXFieldRecord>(clang::extractapi::CXXFieldRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
8
                             [&PathComponentsNames](const PathComponent &PC) {
775
8
                               PathComponentsNames.push_back(PC.Name);
776
8
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXFieldTemplateRecord>(clang::extractapi::CXXFieldTemplateRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
2
                             [&PathComponentsNames](const PathComponent &PC) {
775
2
                               PathComponentsNames.push_back(PC.Name);
776
2
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ConceptRecord>(clang::extractapi::ConceptRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableTemplateRecord>(clang::extractapi::GlobalVariableTemplateRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
3
                             [&PathComponentsNames](const PathComponent &PC) {
775
3
                               PathComponentsNames.push_back(PC.Name);
776
3
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(clang::extractapi::GlobalVariableTemplateSpecializationRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalFunctionTemplateRecord>(clang::extractapi::GlobalFunctionTemplateRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
3
                             [&PathComponentsNames](const PathComponent &PC) {
775
3
                               PathComponentsNames.push_back(PC.Name);
776
3
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCContainerRecord>(clang::extractapi::ObjCContainerRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
17
                             [&PathComponentsNames](const PathComponent &PC) {
775
17
                               PathComponentsNames.push_back(PC.Name);
776
17
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::ObjCInstanceVariableRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
2
                             [&PathComponentsNames](const PathComponent &PC) {
775
2
                               PathComponentsNames.push_back(PC.Name);
776
2
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCMethodRecord>(clang::extractapi::ObjCMethodRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
24
                             [&PathComponentsNames](const PathComponent &PC) {
775
24
                               PathComponentsNames.push_back(PC.Name);
776
24
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::ObjCPropertyRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
20
                             [&PathComponentsNames](const PathComponent &PC) {
775
20
                               PathComponentsNames.push_back(PC.Name);
776
20
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCCategoryRecord>(clang::extractapi::ObjCCategoryRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::MacroDefinitionRecord>(clang::extractapi::MacroDefinitionRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
14
                             [&PathComponentsNames](const PathComponent &PC) {
775
14
                               PathComponentsNames.push_back(PC.Name);
776
14
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::APIRecord>(clang::extractapi::APIRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
22
                             [&PathComponentsNames](const PathComponent &PC) {
775
22
                               PathComponentsNames.push_back(PC.Name);
776
22
                             }))
SymbolGraphSerializer.cpp:std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::TypedefRecord>(clang::extractapi::TypedefRecord const&) const::'lambda'((anonymous namespace)::PathComponent const&)::operator()((anonymous namespace)::PathComponent const&) const
Line
Count
Source
774
13
                             [&PathComponentsNames](const PathComponent &PC) {
775
13
                               PathComponentsNames.push_back(PC.Name);
776
13
                             }))
777
0
    return {};
778
779
202
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
202
  serializeFunctionSignatureMixin(Obj, Record);
782
202
  serializeAccessMixin(Obj, Record);
783
202
  serializeTemplateMixin(Obj, Record);
784
785
202
  return Obj;
786
202
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::NamespaceRecord>(clang::extractapi::NamespaceRecord const&) const
Line
Count
Source
753
3
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
3
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
3
  Object Obj;
758
3
  serializeObject(Obj, "identifier",
759
3
                  serializeIdentifier(Record, API.getLanguage()));
760
3
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
3
  serializeObject(Obj, "names", serializeNames(Record));
762
3
  serializeObject(
763
3
      Obj, "location",
764
3
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
3
  serializeArray(Obj, "availability",
766
3
                 serializeAvailability(Record.Availabilities));
767
3
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
3
  serializeArray(Obj, "declarationFragments",
769
3
                 serializeDeclarationFragments(Record.Declaration));
770
3
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
3
  if (generatePathComponents(Record, API,
774
3
                             [&PathComponentsNames](const PathComponent &PC) {
775
3
                               PathComponentsNames.push_back(PC.Name);
776
3
                             }))
777
0
    return {};
778
779
3
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
3
  serializeFunctionSignatureMixin(Obj, Record);
782
3
  serializeAccessMixin(Obj, Record);
783
3
  serializeTemplateMixin(Obj, Record);
784
785
3
  return Obj;
786
3
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalFunctionRecord>(clang::extractapi::GlobalFunctionRecord const&) const
Line
Count
Source
753
22
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
22
  if (shouldSkip(Record))
755
1
    return std::nullopt;
756
757
21
  Object Obj;
758
21
  serializeObject(Obj, "identifier",
759
21
                  serializeIdentifier(Record, API.getLanguage()));
760
21
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
21
  serializeObject(Obj, "names", serializeNames(Record));
762
21
  serializeObject(
763
21
      Obj, "location",
764
21
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
21
  serializeArray(Obj, "availability",
766
21
                 serializeAvailability(Record.Availabilities));
767
21
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
21
  serializeArray(Obj, "declarationFragments",
769
21
                 serializeDeclarationFragments(Record.Declaration));
770
21
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
21
  if (generatePathComponents(Record, API,
774
21
                             [&PathComponentsNames](const PathComponent &PC) {
775
21
                               PathComponentsNames.push_back(PC.Name);
776
21
                             }))
777
0
    return {};
778
779
21
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
21
  serializeFunctionSignatureMixin(Obj, Record);
782
21
  serializeAccessMixin(Obj, Record);
783
21
  serializeTemplateMixin(Obj, Record);
784
785
21
  return Obj;
786
21
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableRecord>(clang::extractapi::GlobalVariableRecord const&) const
Line
Count
Source
753
13
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
13
  if (shouldSkip(Record))
755
3
    return std::nullopt;
756
757
10
  Object Obj;
758
10
  serializeObject(Obj, "identifier",
759
10
                  serializeIdentifier(Record, API.getLanguage()));
760
10
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
10
  serializeObject(Obj, "names", serializeNames(Record));
762
10
  serializeObject(
763
10
      Obj, "location",
764
10
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
10
  serializeArray(Obj, "availability",
766
10
                 serializeAvailability(Record.Availabilities));
767
10
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
10
  serializeArray(Obj, "declarationFragments",
769
10
                 serializeDeclarationFragments(Record.Declaration));
770
10
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
10
  if (generatePathComponents(Record, API,
774
10
                             [&PathComponentsNames](const PathComponent &PC) {
775
10
                               PathComponentsNames.push_back(PC.Name);
776
10
                             }))
777
0
    return {};
778
779
10
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
10
  serializeFunctionSignatureMixin(Obj, Record);
782
10
  serializeAccessMixin(Obj, Record);
783
10
  serializeTemplateMixin(Obj, Record);
784
785
10
  return Obj;
786
10
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::EnumRecord>(clang::extractapi::EnumRecord const&) const
Line
Count
Source
753
7
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
7
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
7
  Object Obj;
758
7
  serializeObject(Obj, "identifier",
759
7
                  serializeIdentifier(Record, API.getLanguage()));
760
7
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
7
  serializeObject(Obj, "names", serializeNames(Record));
762
7
  serializeObject(
763
7
      Obj, "location",
764
7
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
7
  serializeArray(Obj, "availability",
766
7
                 serializeAvailability(Record.Availabilities));
767
7
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
7
  serializeArray(Obj, "declarationFragments",
769
7
                 serializeDeclarationFragments(Record.Declaration));
770
7
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
7
  if (generatePathComponents(Record, API,
774
7
                             [&PathComponentsNames](const PathComponent &PC) {
775
7
                               PathComponentsNames.push_back(PC.Name);
776
7
                             }))
777
0
    return {};
778
779
7
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
7
  serializeFunctionSignatureMixin(Obj, Record);
782
7
  serializeAccessMixin(Obj, Record);
783
7
  serializeTemplateMixin(Obj, Record);
784
785
7
  return Obj;
786
7
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::EnumConstantRecord>(clang::extractapi::EnumConstantRecord const&) const
Line
Count
Source
753
15
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
15
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
15
  Object Obj;
758
15
  serializeObject(Obj, "identifier",
759
15
                  serializeIdentifier(Record, API.getLanguage()));
760
15
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
15
  serializeObject(Obj, "names", serializeNames(Record));
762
15
  serializeObject(
763
15
      Obj, "location",
764
15
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
15
  serializeArray(Obj, "availability",
766
15
                 serializeAvailability(Record.Availabilities));
767
15
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
15
  serializeArray(Obj, "declarationFragments",
769
15
                 serializeDeclarationFragments(Record.Declaration));
770
15
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
15
  if (generatePathComponents(Record, API,
774
15
                             [&PathComponentsNames](const PathComponent &PC) {
775
15
                               PathComponentsNames.push_back(PC.Name);
776
15
                             }))
777
0
    return {};
778
779
15
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
15
  serializeFunctionSignatureMixin(Obj, Record);
782
15
  serializeAccessMixin(Obj, Record);
783
15
  serializeTemplateMixin(Obj, Record);
784
785
15
  return Obj;
786
15
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::StructRecord>(clang::extractapi::StructRecord const&) const
Line
Count
Source
753
10
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
10
  if (shouldSkip(Record))
755
2
    return std::nullopt;
756
757
8
  Object Obj;
758
8
  serializeObject(Obj, "identifier",
759
8
                  serializeIdentifier(Record, API.getLanguage()));
760
8
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
8
  serializeObject(Obj, "names", serializeNames(Record));
762
8
  serializeObject(
763
8
      Obj, "location",
764
8
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
8
  serializeArray(Obj, "availability",
766
8
                 serializeAvailability(Record.Availabilities));
767
8
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
8
  serializeArray(Obj, "declarationFragments",
769
8
                 serializeDeclarationFragments(Record.Declaration));
770
8
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
8
  if (generatePathComponents(Record, API,
774
8
                             [&PathComponentsNames](const PathComponent &PC) {
775
8
                               PathComponentsNames.push_back(PC.Name);
776
8
                             }))
777
0
    return {};
778
779
8
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
8
  serializeFunctionSignatureMixin(Obj, Record);
782
8
  serializeAccessMixin(Obj, Record);
783
8
  serializeTemplateMixin(Obj, Record);
784
785
8
  return Obj;
786
8
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::StructFieldRecord>(clang::extractapi::StructFieldRecord const&) const
Line
Count
Source
753
8
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
8
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
8
  Object Obj;
758
8
  serializeObject(Obj, "identifier",
759
8
                  serializeIdentifier(Record, API.getLanguage()));
760
8
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
8
  serializeObject(Obj, "names", serializeNames(Record));
762
8
  serializeObject(
763
8
      Obj, "location",
764
8
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
8
  serializeArray(Obj, "availability",
766
8
                 serializeAvailability(Record.Availabilities));
767
8
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
8
  serializeArray(Obj, "declarationFragments",
769
8
                 serializeDeclarationFragments(Record.Declaration));
770
8
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
8
  if (generatePathComponents(Record, API,
774
8
                             [&PathComponentsNames](const PathComponent &PC) {
775
8
                               PathComponentsNames.push_back(PC.Name);
776
8
                             }))
777
0
    return {};
778
779
8
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
8
  serializeFunctionSignatureMixin(Obj, Record);
782
8
  serializeAccessMixin(Obj, Record);
783
8
  serializeTemplateMixin(Obj, Record);
784
785
8
  return Obj;
786
8
}
Unexecuted instantiation: std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::StaticFieldRecord>(clang::extractapi::StaticFieldRecord const&) const
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXClassRecord>(clang::extractapi::CXXClassRecord const&) const
Line
Count
Source
753
15
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
15
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
15
  Object Obj;
758
15
  serializeObject(Obj, "identifier",
759
15
                  serializeIdentifier(Record, API.getLanguage()));
760
15
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
15
  serializeObject(Obj, "names", serializeNames(Record));
762
15
  serializeObject(
763
15
      Obj, "location",
764
15
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
15
  serializeArray(Obj, "availability",
766
15
                 serializeAvailability(Record.Availabilities));
767
15
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
15
  serializeArray(Obj, "declarationFragments",
769
15
                 serializeDeclarationFragments(Record.Declaration));
770
15
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
15
  if (generatePathComponents(Record, API,
774
15
                             [&PathComponentsNames](const PathComponent &PC) {
775
15
                               PathComponentsNames.push_back(PC.Name);
776
15
                             }))
777
0
    return {};
778
779
15
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
15
  serializeFunctionSignatureMixin(Obj, Record);
782
15
  serializeAccessMixin(Obj, Record);
783
15
  serializeTemplateMixin(Obj, Record);
784
785
15
  return Obj;
786
15
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ClassTemplateRecord>(clang::extractapi::ClassTemplateRecord const&) const
Line
Count
Source
753
4
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
4
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
4
  Object Obj;
758
4
  serializeObject(Obj, "identifier",
759
4
                  serializeIdentifier(Record, API.getLanguage()));
760
4
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
4
  serializeObject(Obj, "names", serializeNames(Record));
762
4
  serializeObject(
763
4
      Obj, "location",
764
4
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
4
  serializeArray(Obj, "availability",
766
4
                 serializeAvailability(Record.Availabilities));
767
4
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
4
  serializeArray(Obj, "declarationFragments",
769
4
                 serializeDeclarationFragments(Record.Declaration));
770
4
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
4
  if (generatePathComponents(Record, API,
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
777
0
    return {};
778
779
4
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
4
  serializeFunctionSignatureMixin(Obj, Record);
782
4
  serializeAccessMixin(Obj, Record);
783
4
  serializeTemplateMixin(Obj, Record);
784
785
4
  return Obj;
786
4
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ClassTemplateSpecializationRecord>(clang::extractapi::ClassTemplateSpecializationRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ClassTemplatePartialSpecializationRecord>(clang::extractapi::ClassTemplatePartialSpecializationRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXInstanceMethodRecord>(clang::extractapi::CXXInstanceMethodRecord const&) const
Line
Count
Source
753
8
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
8
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
8
  Object Obj;
758
8
  serializeObject(Obj, "identifier",
759
8
                  serializeIdentifier(Record, API.getLanguage()));
760
8
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
8
  serializeObject(Obj, "names", serializeNames(Record));
762
8
  serializeObject(
763
8
      Obj, "location",
764
8
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
8
  serializeArray(Obj, "availability",
766
8
                 serializeAvailability(Record.Availabilities));
767
8
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
8
  serializeArray(Obj, "declarationFragments",
769
8
                 serializeDeclarationFragments(Record.Declaration));
770
8
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
8
  if (generatePathComponents(Record, API,
774
8
                             [&PathComponentsNames](const PathComponent &PC) {
775
8
                               PathComponentsNames.push_back(PC.Name);
776
8
                             }))
777
0
    return {};
778
779
8
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
8
  serializeFunctionSignatureMixin(Obj, Record);
782
8
  serializeAccessMixin(Obj, Record);
783
8
  serializeTemplateMixin(Obj, Record);
784
785
8
  return Obj;
786
8
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXStaticMethodRecord>(clang::extractapi::CXXStaticMethodRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXMethodTemplateRecord>(clang::extractapi::CXXMethodTemplateRecord const&) const
Line
Count
Source
753
2
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
2
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
2
  Object Obj;
758
2
  serializeObject(Obj, "identifier",
759
2
                  serializeIdentifier(Record, API.getLanguage()));
760
2
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
2
  serializeObject(Obj, "names", serializeNames(Record));
762
2
  serializeObject(
763
2
      Obj, "location",
764
2
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
2
  serializeArray(Obj, "availability",
766
2
                 serializeAvailability(Record.Availabilities));
767
2
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
2
  serializeArray(Obj, "declarationFragments",
769
2
                 serializeDeclarationFragments(Record.Declaration));
770
2
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
2
  if (generatePathComponents(Record, API,
774
2
                             [&PathComponentsNames](const PathComponent &PC) {
775
2
                               PathComponentsNames.push_back(PC.Name);
776
2
                             }))
777
0
    return {};
778
779
2
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
2
  serializeFunctionSignatureMixin(Obj, Record);
782
2
  serializeAccessMixin(Obj, Record);
783
2
  serializeTemplateMixin(Obj, Record);
784
785
2
  return Obj;
786
2
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXMethodTemplateSpecializationRecord>(clang::extractapi::CXXMethodTemplateSpecializationRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXFieldRecord>(clang::extractapi::CXXFieldRecord const&) const
Line
Count
Source
753
4
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
4
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
4
  Object Obj;
758
4
  serializeObject(Obj, "identifier",
759
4
                  serializeIdentifier(Record, API.getLanguage()));
760
4
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
4
  serializeObject(Obj, "names", serializeNames(Record));
762
4
  serializeObject(
763
4
      Obj, "location",
764
4
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
4
  serializeArray(Obj, "availability",
766
4
                 serializeAvailability(Record.Availabilities));
767
4
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
4
  serializeArray(Obj, "declarationFragments",
769
4
                 serializeDeclarationFragments(Record.Declaration));
770
4
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
4
  if (generatePathComponents(Record, API,
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
777
0
    return {};
778
779
4
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
4
  serializeFunctionSignatureMixin(Obj, Record);
782
4
  serializeAccessMixin(Obj, Record);
783
4
  serializeTemplateMixin(Obj, Record);
784
785
4
  return Obj;
786
4
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::CXXFieldTemplateRecord>(clang::extractapi::CXXFieldTemplateRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ConceptRecord>(clang::extractapi::ConceptRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableTemplateRecord>(clang::extractapi::GlobalVariableTemplateRecord const&) const
Line
Count
Source
753
3
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
3
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
3
  Object Obj;
758
3
  serializeObject(Obj, "identifier",
759
3
                  serializeIdentifier(Record, API.getLanguage()));
760
3
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
3
  serializeObject(Obj, "names", serializeNames(Record));
762
3
  serializeObject(
763
3
      Obj, "location",
764
3
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
3
  serializeArray(Obj, "availability",
766
3
                 serializeAvailability(Record.Availabilities));
767
3
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
3
  serializeArray(Obj, "declarationFragments",
769
3
                 serializeDeclarationFragments(Record.Declaration));
770
3
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
3
  if (generatePathComponents(Record, API,
774
3
                             [&PathComponentsNames](const PathComponent &PC) {
775
3
                               PathComponentsNames.push_back(PC.Name);
776
3
                             }))
777
0
    return {};
778
779
3
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
3
  serializeFunctionSignatureMixin(Obj, Record);
782
3
  serializeAccessMixin(Obj, Record);
783
3
  serializeTemplateMixin(Obj, Record);
784
785
3
  return Obj;
786
3
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableTemplateSpecializationRecord>(clang::extractapi::GlobalVariableTemplateSpecializationRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord>(clang::extractapi::GlobalVariableTemplatePartialSpecializationRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalFunctionTemplateRecord>(clang::extractapi::GlobalFunctionTemplateRecord const&) const
Line
Count
Source
753
3
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
3
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
3
  Object Obj;
758
3
  serializeObject(Obj, "identifier",
759
3
                  serializeIdentifier(Record, API.getLanguage()));
760
3
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
3
  serializeObject(Obj, "names", serializeNames(Record));
762
3
  serializeObject(
763
3
      Obj, "location",
764
3
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
3
  serializeArray(Obj, "availability",
766
3
                 serializeAvailability(Record.Availabilities));
767
3
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
3
  serializeArray(Obj, "declarationFragments",
769
3
                 serializeDeclarationFragments(Record.Declaration));
770
3
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
3
  if (generatePathComponents(Record, API,
774
3
                             [&PathComponentsNames](const PathComponent &PC) {
775
3
                               PathComponentsNames.push_back(PC.Name);
776
3
                             }))
777
0
    return {};
778
779
3
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
3
  serializeFunctionSignatureMixin(Obj, Record);
782
3
  serializeAccessMixin(Obj, Record);
783
3
  serializeTemplateMixin(Obj, Record);
784
785
3
  return Obj;
786
3
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::GlobalFunctionTemplateSpecializationRecord>(clang::extractapi::GlobalFunctionTemplateSpecializationRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCContainerRecord>(clang::extractapi::ObjCContainerRecord const&) const
Line
Count
Source
753
17
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
17
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
17
  Object Obj;
758
17
  serializeObject(Obj, "identifier",
759
17
                  serializeIdentifier(Record, API.getLanguage()));
760
17
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
17
  serializeObject(Obj, "names", serializeNames(Record));
762
17
  serializeObject(
763
17
      Obj, "location",
764
17
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
17
  serializeArray(Obj, "availability",
766
17
                 serializeAvailability(Record.Availabilities));
767
17
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
17
  serializeArray(Obj, "declarationFragments",
769
17
                 serializeDeclarationFragments(Record.Declaration));
770
17
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
17
  if (generatePathComponents(Record, API,
774
17
                             [&PathComponentsNames](const PathComponent &PC) {
775
17
                               PathComponentsNames.push_back(PC.Name);
776
17
                             }))
777
0
    return {};
778
779
17
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
17
  serializeFunctionSignatureMixin(Obj, Record);
782
17
  serializeAccessMixin(Obj, Record);
783
17
  serializeTemplateMixin(Obj, Record);
784
785
17
  return Obj;
786
17
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::ObjCInstanceVariableRecord const&) const
Line
Count
Source
753
1
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
1
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
1
  Object Obj;
758
1
  serializeObject(Obj, "identifier",
759
1
                  serializeIdentifier(Record, API.getLanguage()));
760
1
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
1
  serializeObject(Obj, "names", serializeNames(Record));
762
1
  serializeObject(
763
1
      Obj, "location",
764
1
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
1
  serializeArray(Obj, "availability",
766
1
                 serializeAvailability(Record.Availabilities));
767
1
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
1
  serializeArray(Obj, "declarationFragments",
769
1
                 serializeDeclarationFragments(Record.Declaration));
770
1
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
1
  if (generatePathComponents(Record, API,
774
1
                             [&PathComponentsNames](const PathComponent &PC) {
775
1
                               PathComponentsNames.push_back(PC.Name);
776
1
                             }))
777
0
    return {};
778
779
1
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
1
  serializeFunctionSignatureMixin(Obj, Record);
782
1
  serializeAccessMixin(Obj, Record);
783
1
  serializeTemplateMixin(Obj, Record);
784
785
1
  return Obj;
786
1
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCMethodRecord>(clang::extractapi::ObjCMethodRecord const&) const
Line
Count
Source
753
12
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
12
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
12
  Object Obj;
758
12
  serializeObject(Obj, "identifier",
759
12
                  serializeIdentifier(Record, API.getLanguage()));
760
12
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
12
  serializeObject(Obj, "names", serializeNames(Record));
762
12
  serializeObject(
763
12
      Obj, "location",
764
12
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
12
  serializeArray(Obj, "availability",
766
12
                 serializeAvailability(Record.Availabilities));
767
12
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
12
  serializeArray(Obj, "declarationFragments",
769
12
                 serializeDeclarationFragments(Record.Declaration));
770
12
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
12
  if (generatePathComponents(Record, API,
774
12
                             [&PathComponentsNames](const PathComponent &PC) {
775
12
                               PathComponentsNames.push_back(PC.Name);
776
12
                             }))
777
0
    return {};
778
779
12
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
12
  serializeFunctionSignatureMixin(Obj, Record);
782
12
  serializeAccessMixin(Obj, Record);
783
12
  serializeTemplateMixin(Obj, Record);
784
785
12
  return Obj;
786
12
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::ObjCPropertyRecord const&) const
Line
Count
Source
753
10
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
10
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
10
  Object Obj;
758
10
  serializeObject(Obj, "identifier",
759
10
                  serializeIdentifier(Record, API.getLanguage()));
760
10
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
10
  serializeObject(Obj, "names", serializeNames(Record));
762
10
  serializeObject(
763
10
      Obj, "location",
764
10
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
10
  serializeArray(Obj, "availability",
766
10
                 serializeAvailability(Record.Availabilities));
767
10
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
10
  serializeArray(Obj, "declarationFragments",
769
10
                 serializeDeclarationFragments(Record.Declaration));
770
10
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
10
  if (generatePathComponents(Record, API,
774
10
                             [&PathComponentsNames](const PathComponent &PC) {
775
10
                               PathComponentsNames.push_back(PC.Name);
776
10
                             }))
777
0
    return {};
778
779
10
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
10
  serializeFunctionSignatureMixin(Obj, Record);
782
10
  serializeAccessMixin(Obj, Record);
783
10
  serializeTemplateMixin(Obj, Record);
784
785
10
  return Obj;
786
10
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::ObjCCategoryRecord>(clang::extractapi::ObjCCategoryRecord const&) const
Line
Count
Source
753
4
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
4
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
4
  Object Obj;
758
4
  serializeObject(Obj, "identifier",
759
4
                  serializeIdentifier(Record, API.getLanguage()));
760
4
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
4
  serializeObject(Obj, "names", serializeNames(Record));
762
4
  serializeObject(
763
4
      Obj, "location",
764
4
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
4
  serializeArray(Obj, "availability",
766
4
                 serializeAvailability(Record.Availabilities));
767
4
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
4
  serializeArray(Obj, "declarationFragments",
769
4
                 serializeDeclarationFragments(Record.Declaration));
770
4
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
4
  if (generatePathComponents(Record, API,
774
4
                             [&PathComponentsNames](const PathComponent &PC) {
775
4
                               PathComponentsNames.push_back(PC.Name);
776
4
                             }))
777
0
    return {};
778
779
4
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
4
  serializeFunctionSignatureMixin(Obj, Record);
782
4
  serializeAccessMixin(Obj, Record);
783
4
  serializeTemplateMixin(Obj, Record);
784
785
4
  return Obj;
786
4
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::MacroDefinitionRecord>(clang::extractapi::MacroDefinitionRecord const&) const
Line
Count
Source
753
24
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
24
  if (shouldSkip(Record))
755
10
    return std::nullopt;
756
757
14
  Object Obj;
758
14
  serializeObject(Obj, "identifier",
759
14
                  serializeIdentifier(Record, API.getLanguage()));
760
14
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
14
  serializeObject(Obj, "names", serializeNames(Record));
762
14
  serializeObject(
763
14
      Obj, "location",
764
14
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
14
  serializeArray(Obj, "availability",
766
14
                 serializeAvailability(Record.Availabilities));
767
14
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
14
  serializeArray(Obj, "declarationFragments",
769
14
                 serializeDeclarationFragments(Record.Declaration));
770
14
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
14
  if (generatePathComponents(Record, API,
774
14
                             [&PathComponentsNames](const PathComponent &PC) {
775
14
                               PathComponentsNames.push_back(PC.Name);
776
14
                             }))
777
0
    return {};
778
779
14
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
14
  serializeFunctionSignatureMixin(Obj, Record);
782
14
  serializeAccessMixin(Obj, Record);
783
14
  serializeTemplateMixin(Obj, Record);
784
785
14
  return Obj;
786
14
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::APIRecord>(clang::extractapi::APIRecord const&) const
Line
Count
Source
753
11
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
11
  if (shouldSkip(Record))
755
0
    return std::nullopt;
756
757
11
  Object Obj;
758
11
  serializeObject(Obj, "identifier",
759
11
                  serializeIdentifier(Record, API.getLanguage()));
760
11
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
11
  serializeObject(Obj, "names", serializeNames(Record));
762
11
  serializeObject(
763
11
      Obj, "location",
764
11
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
11
  serializeArray(Obj, "availability",
766
11
                 serializeAvailability(Record.Availabilities));
767
11
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
11
  serializeArray(Obj, "declarationFragments",
769
11
                 serializeDeclarationFragments(Record.Declaration));
770
11
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
11
  if (generatePathComponents(Record, API,
774
11
                             [&PathComponentsNames](const PathComponent &PC) {
775
11
                               PathComponentsNames.push_back(PC.Name);
776
11
                             }))
777
0
    return {};
778
779
11
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
11
  serializeFunctionSignatureMixin(Obj, Record);
782
11
  serializeAccessMixin(Obj, Record);
783
11
  serializeTemplateMixin(Obj, Record);
784
785
11
  return Obj;
786
11
}
std::__1::optional<llvm::json::Object> clang::extractapi::SymbolGraphSerializer::serializeAPIRecord<clang::extractapi::TypedefRecord>(clang::extractapi::TypedefRecord const&) const
Line
Count
Source
753
16
SymbolGraphSerializer::serializeAPIRecord(const RecordTy &Record) const {
754
16
  if (shouldSkip(Record))
755
3
    return std::nullopt;
756
757
13
  Object Obj;
758
13
  serializeObject(Obj, "identifier",
759
13
                  serializeIdentifier(Record, API.getLanguage()));
760
13
  serializeObject(Obj, "kind", serializeSymbolKind(Record, API.getLanguage()));
761
13
  serializeObject(Obj, "names", serializeNames(Record));
762
13
  serializeObject(
763
13
      Obj, "location",
764
13
      serializeSourceLocation(Record.Location, /*IncludeFileURI=*/true));
765
13
  serializeArray(Obj, "availability",
766
13
                 serializeAvailability(Record.Availabilities));
767
13
  serializeObject(Obj, "docComment", serializeDocComment(Record.Comment));
768
13
  serializeArray(Obj, "declarationFragments",
769
13
                 serializeDeclarationFragments(Record.Declaration));
770
13
  SmallVector<StringRef, 4> PathComponentsNames;
771
  // If this returns true it indicates that we couldn't find a symbol in the
772
  // hierarchy.
773
13
  if (generatePathComponents(Record, API,
774
13
                             [&PathComponentsNames](const PathComponent &PC) {
775
13
                               PathComponentsNames.push_back(PC.Name);
776
13
                             }))
777
0
    return {};
778
779
13
  serializeArray(Obj, "pathComponents", Array(PathComponentsNames));
780
781
13
  serializeFunctionSignatureMixin(Obj, Record);
782
13
  serializeAccessMixin(Obj, Record);
783
13
  serializeTemplateMixin(Obj, Record);
784
785
13
  return Obj;
786
13
}
787
788
template <typename MemberTy>
789
void SymbolGraphSerializer::serializeMembers(
790
    const APIRecord &Record,
791
83
    const SmallVector<std::unique_ptr<MemberTy>> &Members) {
792
  // Members should not be serialized if we aren't recursing.
793
83
  if (!ShouldRecurse)
794
20
    return;
795
63
  for (const auto &Member : Members) {
796
46
    auto MemberRecord = serializeAPIRecord(*Member);
797
46
    if (!MemberRecord)
798
0
      continue;
799
800
46
    Symbols.emplace_back(std::move(*MemberRecord));
801
46
    serializeRelationship(RelationshipKind::MemberOf, *Member, Record);
802
46
  }
803
63
}
void clang::extractapi::SymbolGraphSerializer::serializeMembers<clang::extractapi::EnumConstantRecord>(clang::extractapi::APIRecord const&, llvm::SmallVector<std::__1::unique_ptr<clang::extractapi::EnumConstantRecord, std::__1::default_delete<clang::extractapi::EnumConstantRecord> >, CalculateSmallVectorDefaultInlinedElements<std::__1::unique_ptr<clang::extractapi::EnumConstantRecord, std::__1::default_delete<clang::extractapi::EnumConstantRecord> > >::value> const&)
Line
Count
Source
791
7
    const SmallVector<std::unique_ptr<MemberTy>> &Members) {
792
  // Members should not be serialized if we aren't recursing.
793
7
  if (!ShouldRecurse)
794
0
    return;
795
15
  
for (const auto &Member : Members)7
{
796
15
    auto MemberRecord = serializeAPIRecord(*Member);
797
15
    if (!MemberRecord)
798
0
      continue;
799
800
15
    Symbols.emplace_back(std::move(*MemberRecord));
801
15
    serializeRelationship(RelationshipKind::MemberOf, *Member, Record);
802
15
  }
803
7
}
void clang::extractapi::SymbolGraphSerializer::serializeMembers<clang::extractapi::StructFieldRecord>(clang::extractapi::APIRecord const&, llvm::SmallVector<std::__1::unique_ptr<clang::extractapi::StructFieldRecord, std::__1::default_delete<clang::extractapi::StructFieldRecord> >, CalculateSmallVectorDefaultInlinedElements<std::__1::unique_ptr<clang::extractapi::StructFieldRecord, std::__1::default_delete<clang::extractapi::StructFieldRecord> > >::value> const&)
Line
Count
Source
791
8
    const SmallVector<std::unique_ptr<MemberTy>> &Members) {
792
  // Members should not be serialized if we aren't recursing.
793
8
  if (!ShouldRecurse)
794
2
    return;
795
8
  
for (const auto &Member : Members)6
{
796
8
    auto MemberRecord = serializeAPIRecord(*Member);
797
8
    if (!MemberRecord)
798
0
      continue;
799
800
8
    Symbols.emplace_back(std::move(*MemberRecord));
801
8
    serializeRelationship(RelationshipKind::MemberOf, *Member, Record);
802
8
  }
803
6
}
void clang::extractapi::SymbolGraphSerializer::serializeMembers<clang::extractapi::ObjCInstanceVariableRecord>(clang::extractapi::APIRecord const&, llvm::SmallVector<std::__1::unique_ptr<clang::extractapi::ObjCInstanceVariableRecord, std::__1::default_delete<clang::extractapi::ObjCInstanceVariableRecord> >, CalculateSmallVectorDefaultInlinedElements<std::__1::unique_ptr<clang::extractapi::ObjCInstanceVariableRecord, std::__1::default_delete<clang::extractapi::ObjCInstanceVariableRecord> > >::value> const&)
Line
Count
Source
791
20
    const SmallVector<std::unique_ptr<MemberTy>> &Members) {
792
  // Members should not be serialized if we aren't recursing.
793
20
  if (!ShouldRecurse)
794
6
    return;
795
14
  for (const auto &Member : Members) {
796
1
    auto MemberRecord = serializeAPIRecord(*Member);
797
1
    if (!MemberRecord)
798
0
      continue;
799
800
1
    Symbols.emplace_back(std::move(*MemberRecord));
801
1
    serializeRelationship(RelationshipKind::MemberOf, *Member, Record);
802
1
  }
803
14
}
void clang::extractapi::SymbolGraphSerializer::serializeMembers<clang::extractapi::ObjCMethodRecord>(clang::extractapi::APIRecord const&, llvm::SmallVector<std::__1::unique_ptr<clang::extractapi::ObjCMethodRecord, std::__1::default_delete<clang::extractapi::ObjCMethodRecord> >, CalculateSmallVectorDefaultInlinedElements<std::__1::unique_ptr<clang::extractapi::ObjCMethodRecord, std::__1::default_delete<clang::extractapi::ObjCMethodRecord> > >::value> const&)
Line
Count
Source
791
24
    const SmallVector<std::unique_ptr<MemberTy>> &Members) {
792
  // Members should not be serialized if we aren't recursing.
793
24
  if (!ShouldRecurse)
794
6
    return;
795
18
  for (const auto &Member : Members) {
796
12
    auto MemberRecord = serializeAPIRecord(*Member);
797
12
    if (!MemberRecord)
798
0
      continue;
799
800
12
    Symbols.emplace_back(std::move(*MemberRecord));
801
12
    serializeRelationship(RelationshipKind::MemberOf, *Member, Record);
802
12
  }
803
18
}
void clang::extractapi::SymbolGraphSerializer::serializeMembers<clang::extractapi::ObjCPropertyRecord>(clang::extractapi::APIRecord const&, llvm::SmallVector<std::__1::unique_ptr<clang::extractapi::ObjCPropertyRecord, std::__1::default_delete<clang::extractapi::ObjCPropertyRecord> >, CalculateSmallVectorDefaultInlinedElements<std::__1::unique_ptr<clang::extractapi::ObjCPropertyRecord, std::__1::default_delete<clang::extractapi::ObjCPropertyRecord> > >::value> const&)
Line
Count
Source
791
24
    const SmallVector<std::unique_ptr<MemberTy>> &Members) {
792
  // Members should not be serialized if we aren't recursing.
793
24
  if (!ShouldRecurse)
794
6
    return;
795
18
  for (const auto &Member : Members) {
796
10
    auto MemberRecord = serializeAPIRecord(*Member);
797
10
    if (!MemberRecord)
798
0
      continue;
799
800
10
    Symbols.emplace_back(std::move(*MemberRecord));
801
10
    serializeRelationship(RelationshipKind::MemberOf, *Member, Record);
802
10
  }
803
18
}
804
805
93
StringRef SymbolGraphSerializer::getRelationshipString(RelationshipKind Kind) {
806
93
  switch (Kind) {
807
76
  case RelationshipKind::MemberOf:
808
76
    return "memberOf";
809
9
  case RelationshipKind::InheritsFrom:
810
9
    return "inheritsFrom";
811
4
  case RelationshipKind::ConformsTo:
812
4
    return "conformsTo";
813
4
  case RelationshipKind::ExtensionTo:
814
4
    return "extensionTo";
815
93
  }
816
0
  llvm_unreachable("Unhandled relationship kind");
817
0
}
818
819
0
StringRef SymbolGraphSerializer::getConstraintString(ConstraintKind Kind) {
820
0
  switch (Kind) {
821
0
  case ConstraintKind::Conformance:
822
0
    return "conformance";
823
0
  case ConstraintKind::ConditionalConformance:
824
0
    return "conditionalConformance";
825
0
  }
826
0
  llvm_unreachable("Unhandled constraint kind");
827
0
}
828
829
void SymbolGraphSerializer::serializeRelationship(RelationshipKind Kind,
830
                                                  SymbolReference Source,
831
89
                                                  SymbolReference Target) {
832
89
  Object Relationship;
833
89
  Relationship["source"] = Source.USR;
834
89
  Relationship["target"] = Target.USR;
835
89
  Relationship["targetFallback"] = Target.Name;
836
89
  Relationship["kind"] = getRelationshipString(Kind);
837
838
89
  Relationships.emplace_back(std::move(Relationship));
839
89
}
840
841
void SymbolGraphSerializer::visitNamespaceRecord(
842
3
    const NamespaceRecord &Record) {
843
3
  auto Namespace = serializeAPIRecord(Record);
844
3
  if (!Namespace)
845
0
    return;
846
3
  Symbols.emplace_back(std::move(*Namespace));
847
3
  if (!Record.ParentInformation.empty())
848
1
    serializeRelationship(RelationshipKind::MemberOf, Record,
849
1
                          Record.ParentInformation.ParentRecord);
850
3
}
851
852
void SymbolGraphSerializer::visitGlobalFunctionRecord(
853
22
    const GlobalFunctionRecord &Record) {
854
22
  auto Obj = serializeAPIRecord(Record);
855
22
  if (!Obj)
856
1
    return;
857
858
21
  Symbols.emplace_back(std::move(*Obj));
859
21
}
860
861
void SymbolGraphSerializer::visitGlobalVariableRecord(
862
13
    const GlobalVariableRecord &Record) {
863
13
  auto Obj = serializeAPIRecord(Record);
864
13
  if (!Obj)
865
3
    return;
866
867
10
  Symbols.emplace_back(std::move(*Obj));
868
10
}
869
870
7
void SymbolGraphSerializer::visitEnumRecord(const EnumRecord &Record) {
871
7
  auto Enum = serializeAPIRecord(Record);
872
7
  if (!Enum)
873
0
    return;
874
875
7
  Symbols.emplace_back(std::move(*Enum));
876
7
  serializeMembers(Record, Record.Constants);
877
7
}
878
879
10
void SymbolGraphSerializer::visitStructRecord(const StructRecord &Record) {
880
10
  auto Struct = serializeAPIRecord(Record);
881
10
  if (!Struct)
882
2
    return;
883
884
8
  Symbols.emplace_back(std::move(*Struct));
885
8
  serializeMembers(Record, Record.Fields);
886
8
}
887
888
void SymbolGraphSerializer::visitStaticFieldRecord(
889
0
    const StaticFieldRecord &Record) {
890
0
  auto StaticField = serializeAPIRecord(Record);
891
0
  if (!StaticField)
892
0
    return;
893
0
  Symbols.emplace_back(std::move(*StaticField));
894
0
  serializeRelationship(RelationshipKind::MemberOf, Record, Record.Context);
895
0
}
896
897
15
void SymbolGraphSerializer::visitCXXClassRecord(const CXXClassRecord &Record) {
898
15
  auto Class = serializeAPIRecord(Record);
899
15
  if (!Class)
900
0
    return;
901
902
15
  Symbols.emplace_back(std::move(*Class));
903
15
  for (const auto &Base : Record.Bases)
904
5
    serializeRelationship(RelationshipKind::InheritsFrom, Record, Base);
905
15
  if (!Record.ParentInformation.empty())
906
1
    serializeRelationship(RelationshipKind::MemberOf, Record,
907
1
                          Record.ParentInformation.ParentRecord);
908
15
}
909
910
void SymbolGraphSerializer::visitClassTemplateRecord(
911
4
    const ClassTemplateRecord &Record) {
912
4
  auto Class = serializeAPIRecord(Record);
913
4
  if (!Class)
914
0
    return;
915
916
4
  Symbols.emplace_back(std::move(*Class));
917
4
  for (const auto &Base : Record.Bases)
918
1
    serializeRelationship(RelationshipKind::InheritsFrom, Record, Base);
919
4
  if (!Record.ParentInformation.empty())
920
0
    serializeRelationship(RelationshipKind::MemberOf, Record,
921
0
                          Record.ParentInformation.ParentRecord);
922
4
}
923
924
void SymbolGraphSerializer::visitClassTemplateSpecializationRecord(
925
1
    const ClassTemplateSpecializationRecord &Record) {
926
1
  auto Class = serializeAPIRecord(Record);
927
1
  if (!Class)
928
0
    return;
929
930
1
  Symbols.emplace_back(std::move(*Class));
931
932
1
  for (const auto &Base : Record.Bases)
933
0
    serializeRelationship(RelationshipKind::InheritsFrom, Record, Base);
934
1
  if (!Record.ParentInformation.empty())
935
0
    serializeRelationship(RelationshipKind::MemberOf, Record,
936
0
                          Record.ParentInformation.ParentRecord);
937
1
}
938
939
void SymbolGraphSerializer::visitClassTemplatePartialSpecializationRecord(
940
1
    const ClassTemplatePartialSpecializationRecord &Record) {
941
1
  auto Class = serializeAPIRecord(Record);
942
1
  if (!Class)
943
0
    return;
944
945
1
  Symbols.emplace_back(std::move(*Class));
946
947
1
  for (const auto &Base : Record.Bases)
948
0
    serializeRelationship(RelationshipKind::InheritsFrom, Record, Base);
949
1
  if (!Record.ParentInformation.empty())
950
0
    serializeRelationship(RelationshipKind::MemberOf, Record,
951
0
                          Record.ParentInformation.ParentRecord);
952
1
}
953
954
void SymbolGraphSerializer::visitCXXInstanceMethodRecord(
955
8
    const CXXInstanceMethodRecord &Record) {
956
8
  auto InstanceMethod = serializeAPIRecord(Record);
957
8
  if (!InstanceMethod)
958
0
    return;
959
960
8
  Symbols.emplace_back(std::move(*InstanceMethod));
961
8
  serializeRelationship(RelationshipKind::MemberOf, Record,
962
8
                        Record.ParentInformation.ParentRecord);
963
8
}
964
965
void SymbolGraphSerializer::visitCXXStaticMethodRecord(
966
1
    const CXXStaticMethodRecord &Record) {
967
1
  auto StaticMethod = serializeAPIRecord(Record);
968
1
  if (!StaticMethod)
969
0
    return;
970
971
1
  Symbols.emplace_back(std::move(*StaticMethod));
972
1
  serializeRelationship(RelationshipKind::MemberOf, Record,
973
1
                        Record.ParentInformation.ParentRecord);
974
1
}
975
976
void SymbolGraphSerializer::visitMethodTemplateRecord(
977
2
    const CXXMethodTemplateRecord &Record) {
978
2
  if (!ShouldRecurse)
979
    // Ignore child symbols
980
0
    return;
981
2
  auto MethodTemplate = serializeAPIRecord(Record);
982
2
  if (!MethodTemplate)
983
0
    return;
984
2
  Symbols.emplace_back(std::move(*MethodTemplate));
985
2
  serializeRelationship(RelationshipKind::MemberOf, Record,
986
2
                        Record.ParentInformation.ParentRecord);
987
2
}
988
989
void SymbolGraphSerializer::visitMethodTemplateSpecializationRecord(
990
1
    const CXXMethodTemplateSpecializationRecord &Record) {
991
1
  if (!ShouldRecurse)
992
    // Ignore child symbols
993
0
    return;
994
1
  auto MethodTemplateSpecialization = serializeAPIRecord(Record);
995
1
  if (!MethodTemplateSpecialization)
996
0
    return;
997
1
  Symbols.emplace_back(std::move(*MethodTemplateSpecialization));
998
1
  serializeRelationship(RelationshipKind::MemberOf, Record,
999
1
                        Record.ParentInformation.ParentRecord);
1000
1
}
1001
1002
4
void SymbolGraphSerializer::visitCXXFieldRecord(const CXXFieldRecord &Record) {
1003
4
  if (!ShouldRecurse)
1004
0
    return;
1005
4
  auto CXXField = serializeAPIRecord(Record);
1006
4
  if (!CXXField)
1007
0
    return;
1008
4
  Symbols.emplace_back(std::move(*CXXField));
1009
4
  serializeRelationship(RelationshipKind::MemberOf, Record,
1010
4
                        Record.ParentInformation.ParentRecord);
1011
4
}
1012
1013
void SymbolGraphSerializer::visitCXXFieldTemplateRecord(
1014
1
    const CXXFieldTemplateRecord &Record) {
1015
1
  if (!ShouldRecurse)
1016
    // Ignore child symbols
1017
0
    return;
1018
1
  auto CXXFieldTemplate = serializeAPIRecord(Record);
1019
1
  if (!CXXFieldTemplate)
1020
0
    return;
1021
1
  Symbols.emplace_back(std::move(*CXXFieldTemplate));
1022
1
  serializeRelationship(RelationshipKind::MemberOf, Record,
1023
1
                        Record.ParentInformation.ParentRecord);
1024
1
}
1025
1026
1
void SymbolGraphSerializer::visitConceptRecord(const ConceptRecord &Record) {
1027
1
  auto Concept = serializeAPIRecord(Record);
1028
1
  if (!Concept)
1029
0
    return;
1030
1031
1
  Symbols.emplace_back(std::move(*Concept));
1032
1
}
1033
1034
void SymbolGraphSerializer::visitGlobalVariableTemplateRecord(
1035
3
    const GlobalVariableTemplateRecord &Record) {
1036
3
  auto GlobalVariableTemplate = serializeAPIRecord(Record);
1037
3
  if (!GlobalVariableTemplate)
1038
0
    return;
1039
3
  Symbols.emplace_back(std::move(*GlobalVariableTemplate));
1040
3
}
1041
1042
void SymbolGraphSerializer::visitGlobalVariableTemplateSpecializationRecord(
1043
1
    const GlobalVariableTemplateSpecializationRecord &Record) {
1044
1
  auto GlobalVariableTemplateSpecialization = serializeAPIRecord(Record);
1045
1
  if (!GlobalVariableTemplateSpecialization)
1046
0
    return;
1047
1
  Symbols.emplace_back(std::move(*GlobalVariableTemplateSpecialization));
1048
1
}
1049
1050
void SymbolGraphSerializer::
1051
    visitGlobalVariableTemplatePartialSpecializationRecord(
1052
1
        const GlobalVariableTemplatePartialSpecializationRecord &Record) {
1053
1
  auto GlobalVariableTemplatePartialSpecialization = serializeAPIRecord(Record);
1054
1
  if (!GlobalVariableTemplatePartialSpecialization)
1055
0
    return;
1056
1
  Symbols.emplace_back(std::move(*GlobalVariableTemplatePartialSpecialization));
1057
1
}
1058
1059
void SymbolGraphSerializer::visitGlobalFunctionTemplateRecord(
1060
3
    const GlobalFunctionTemplateRecord &Record) {
1061
3
  auto GlobalFunctionTemplate = serializeAPIRecord(Record);
1062
3
  if (!GlobalFunctionTemplate)
1063
0
    return;
1064
3
  Symbols.emplace_back(std::move(*GlobalFunctionTemplate));
1065
3
}
1066
1067
void SymbolGraphSerializer::visitGlobalFunctionTemplateSpecializationRecord(
1068
1
    const GlobalFunctionTemplateSpecializationRecord &Record) {
1069
1
  auto GlobalFunctionTemplateSpecialization = serializeAPIRecord(Record);
1070
1
  if (!GlobalFunctionTemplateSpecialization)
1071
0
    return;
1072
1
  Symbols.emplace_back(std::move(*GlobalFunctionTemplateSpecialization));
1073
1
}
1074
1075
void SymbolGraphSerializer::visitObjCContainerRecord(
1076
17
    const ObjCContainerRecord &Record) {
1077
17
  auto ObjCContainer = serializeAPIRecord(Record);
1078
17
  if (!ObjCContainer)
1079
0
    return;
1080
1081
17
  Symbols.emplace_back(std::move(*ObjCContainer));
1082
1083
17
  serializeMembers(Record, Record.Ivars);
1084
17
  serializeMembers(Record, Record.Methods);
1085
17
  serializeMembers(Record, Record.Properties);
1086
1087
17
  for (const auto &Protocol : Record.Protocols)
1088
    // Record that Record conforms to Protocol.
1089
2
    serializeRelationship(RelationshipKind::ConformsTo, Record, Protocol);
1090
1091
17
  if (auto *ObjCInterface = dyn_cast<ObjCInterfaceRecord>(&Record)) {
1092
11
    if (!ObjCInterface->SuperClass.empty())
1093
      // If Record is an Objective-C interface record and it has a super class,
1094
      // record that Record is inherited from SuperClass.
1095
3
      serializeRelationship(RelationshipKind::InheritsFrom, Record,
1096
3
                            ObjCInterface->SuperClass);
1097
1098
    // Members of categories extending an interface are serialized as members of
1099
    // the interface.
1100
11
    for (const auto *Category : ObjCInterface->Categories) {
1101
3
      serializeMembers(Record, Category->Ivars);
1102
3
      serializeMembers(Record, Category->Methods);
1103
3
      serializeMembers(Record, Category->Properties);
1104
1105
      // Surface the protocols of the category to the interface.
1106
3
      for (const auto &Protocol : Category->Protocols)
1107
2
        serializeRelationship(RelationshipKind::ConformsTo, Record, Protocol);
1108
3
    }
1109
11
  }
1110
17
}
1111
1112
void SymbolGraphSerializer::visitObjCCategoryRecord(
1113
7
    const ObjCCategoryRecord &Record) {
1114
7
  if (!Record.IsFromExternalModule)
1115
3
    return;
1116
1117
  // Check if the current Category' parent has been visited before, if so skip.
1118
4
  if (!visitedCategories.contains(Record.Interface.Name)) {
1119
2
    visitedCategories.insert(Record.Interface.Name);
1120
2
    Object Obj;
1121
2
    serializeObject(Obj, "identifier",
1122
2
                    serializeIdentifier(Record, API.getLanguage()));
1123
2
    serializeObject(Obj, "kind",
1124
2
                    serializeSymbolKind(APIRecord::RK_ObjCCategoryModule,
1125
2
                                        API.getLanguage()));
1126
2
    Obj["accessLevel"] = "public";
1127
2
    Symbols.emplace_back(std::move(Obj));
1128
2
  }
1129
1130
4
  Object Relationship;
1131
4
  Relationship["source"] = Record.USR;
1132
4
  Relationship["target"] = Record.Interface.USR;
1133
4
  Relationship["targetFallback"] = Record.Interface.Name;
1134
4
  Relationship["kind"] = getRelationshipString(RelationshipKind::ExtensionTo);
1135
4
  Relationships.emplace_back(std::move(Relationship));
1136
1137
4
  auto ObjCCategory = serializeAPIRecord(Record);
1138
1139
4
  if (!ObjCCategory)
1140
0
    return;
1141
1142
4
  Symbols.emplace_back(std::move(*ObjCCategory));
1143
4
  serializeMembers(Record, Record.Methods);
1144
4
  serializeMembers(Record, Record.Properties);
1145
1146
  // Surface the protocols of the category to the interface.
1147
4
  for (const auto &Protocol : Record.Protocols)
1148
0
    serializeRelationship(RelationshipKind::ConformsTo, Record, Protocol);
1149
4
}
1150
1151
void SymbolGraphSerializer::visitMacroDefinitionRecord(
1152
24
    const MacroDefinitionRecord &Record) {
1153
24
  auto Macro = serializeAPIRecord(Record);
1154
1155
24
  if (!Macro)
1156
10
    return;
1157
1158
14
  Symbols.emplace_back(std::move(*Macro));
1159
14
}
1160
1161
19
void SymbolGraphSerializer::serializeSingleRecord(const APIRecord *Record) {
1162
19
  switch (Record->getKind()) {
1163
0
  case APIRecord::RK_Unknown:
1164
0
    llvm_unreachable("Records should have a known kind!");
1165
0
  case APIRecord::RK_GlobalFunction:
1166
0
    visitGlobalFunctionRecord(*cast<GlobalFunctionRecord>(Record));
1167
0
    break;
1168
0
  case APIRecord::RK_GlobalVariable:
1169
0
    visitGlobalVariableRecord(*cast<GlobalVariableRecord>(Record));
1170
0
    break;
1171
0
  case APIRecord::RK_Enum:
1172
0
    visitEnumRecord(*cast<EnumRecord>(Record));
1173
0
    break;
1174
2
  case APIRecord::RK_Struct:
1175
2
    visitStructRecord(*cast<StructRecord>(Record));
1176
2
    break;
1177
0
  case APIRecord::RK_StaticField:
1178
0
    visitStaticFieldRecord(*cast<StaticFieldRecord>(Record));
1179
0
    break;
1180
0
  case APIRecord::RK_CXXClass:
1181
0
    visitCXXClassRecord(*cast<CXXClassRecord>(Record));
1182
0
    break;
1183
4
  case APIRecord::RK_ObjCInterface:
1184
4
    visitObjCContainerRecord(*cast<ObjCInterfaceRecord>(Record));
1185
4
    break;
1186
2
  case APIRecord::RK_ObjCProtocol:
1187
2
    visitObjCContainerRecord(*cast<ObjCProtocolRecord>(Record));
1188
2
    break;
1189
0
  case APIRecord::RK_ObjCCategory:
1190
0
    visitObjCCategoryRecord(*cast<ObjCCategoryRecord>(Record));
1191
0
    break;
1192
0
  case APIRecord::RK_MacroDefinition:
1193
0
    visitMacroDefinitionRecord(*cast<MacroDefinitionRecord>(Record));
1194
0
    break;
1195
0
  case APIRecord::RK_Typedef:
1196
0
    visitTypedefRecord(*cast<TypedefRecord>(Record));
1197
0
    break;
1198
11
  default:
1199
11
    if (auto Obj = serializeAPIRecord(*Record)) {
1200
11
      Symbols.emplace_back(std::move(*Obj));
1201
11
      auto &ParentInformation = Record->ParentInformation;
1202
11
      if (!ParentInformation.empty())
1203
11
        serializeRelationship(RelationshipKind::MemberOf, *Record,
1204
11
                              *ParentInformation.ParentRecord);
1205
11
    }
1206
11
    break;
1207
19
  }
1208
19
}
1209
1210
21
void SymbolGraphSerializer::visitTypedefRecord(const TypedefRecord &Record) {
1211
  // Typedefs of anonymous types have their entries unified with the underlying
1212
  // type.
1213
21
  bool ShouldDrop = Record.UnderlyingType.Name.empty();
1214
  // enums declared with `NS_OPTION` have a named enum and a named typedef, with
1215
  // the same name
1216
21
  ShouldDrop |= (Record.UnderlyingType.Name == Record.Name);
1217
21
  if (ShouldDrop)
1218
5
    return;
1219
1220
16
  auto Typedef = serializeAPIRecord(Record);
1221
16
  if (!Typedef)
1222
3
    return;
1223
1224
13
  (*Typedef)["type"] = Record.UnderlyingType.USR;
1225
1226
13
  Symbols.emplace_back(std::move(*Typedef));
1227
13
}
1228
1229
56
Object SymbolGraphSerializer::serialize() {
1230
56
  traverseAPISet();
1231
56
  return serializeCurrentGraph();
1232
56
}
1233
1234
75
Object SymbolGraphSerializer::serializeCurrentGraph() {
1235
75
  Object Root;
1236
75
  serializeObject(Root, "metadata", serializeMetadata());
1237
75
  serializeObject(Root, "module", serializeModule());
1238
1239
75
  Root["symbols"] = std::move(Symbols);
1240
75
  Root["relationships"] = std::move(Relationships);
1241
1242
75
  return Root;
1243
75
}
1244
1245
56
void SymbolGraphSerializer::serialize(raw_ostream &os) {
1246
56
  Object root = serialize();
1247
56
  if (Options.Compact)
1248
0
    os << formatv("{0}", Value(std::move(root))) << "\n";
1249
56
  else
1250
56
    os << formatv("{0:2}", Value(std::move(root))) << "\n";
1251
56
}
1252
1253
std::optional<Object>
1254
SymbolGraphSerializer::serializeSingleSymbolSGF(StringRef USR,
1255
19
                                                const APISet &API) {
1256
19
  APIRecord *Record = API.findRecordForUSR(USR);
1257
19
  if (!Record)
1258
0
    return {};
1259
1260
19
  Object Root;
1261
19
  APIIgnoresList EmptyIgnores;
1262
19
  SymbolGraphSerializer Serializer(API, EmptyIgnores,
1263
19
                                   /*Options.Compact*/ {true},
1264
19
                                   /*ShouldRecurse*/ false);
1265
19
  Serializer.serializeSingleRecord(Record);
1266
19
  serializeObject(Root, "symbolGraph", Serializer.serializeCurrentGraph());
1267
1268
19
  Language Lang = API.getLanguage();
1269
19
  serializeArray(Root, "parentContexts",
1270
19
                 generateParentContexts(*Record, API, Lang));
1271
1272
19
  Array RelatedSymbols;
1273
1274
111
  for (const auto &Fragment : Record->Declaration.getFragments()) {
1275
    // If we don't have a USR there isn't much we can do.
1276
111
    if (Fragment.PreciseIdentifier.empty())
1277
93
      continue;
1278
1279
18
    APIRecord *RelatedRecord = API.findRecordForUSR(Fragment.PreciseIdentifier);
1280
1281
    // If we can't find the record let's skip.
1282
18
    if (!RelatedRecord)
1283
12
      continue;
1284
1285
6
    Object RelatedSymbol;
1286
6
    RelatedSymbol["usr"] = RelatedRecord->USR;
1287
6
    RelatedSymbol["declarationLanguage"] = getLanguageName(Lang);
1288
    // TODO: once we record this properly let's serialize it right.
1289
6
    RelatedSymbol["accessLevel"] = "public";
1290
6
    RelatedSymbol["filePath"] = RelatedRecord->Location.getFilename();
1291
6
    RelatedSymbol["moduleName"] = API.ProductName;
1292
6
    RelatedSymbol["isSystem"] = RelatedRecord->IsFromSystemHeader;
1293
1294
6
    serializeArray(RelatedSymbol, "parentContexts",
1295
6
                   generateParentContexts(*RelatedRecord, API, Lang));
1296
6
    RelatedSymbols.push_back(std::move(RelatedSymbol));
1297
6
  }
1298
1299
19
  serializeArray(Root, "relatedSymbols", RelatedSymbols);
1300
19
  return Root;
1301
19
}