clang 23.0.0git
API.h
Go to the documentation of this file.
1//===- ExtractAPI/API.h -----------------------------------------*- 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 defines the APIRecord-based structs and the APISet class.
11///
12/// Clang ExtractAPI is a tool to collect API information from a given set of
13/// header files. The structures in this file describe data representations of
14/// the API information collected for various kinds of symbols.
15///
16//===----------------------------------------------------------------------===//
17
18#ifndef LLVM_CLANG_EXTRACTAPI_API_H
19#define LLVM_CLANG_EXTRACTAPI_API_H
20
22#include "clang/AST/DeclBase.h"
26#include "llvm/ADT/SmallVector.h"
27#include "llvm/Support/Allocator.h"
28#include "llvm/Support/Casting.h"
29#include "llvm/Support/Compiler.h"
30#include "llvm/TargetParser/Triple.h"
31#include <cstddef>
32#include <iterator>
33#include <memory>
34#include <optional>
35#include <type_traits>
36
37namespace clang {
38namespace extractapi {
39
40class Template {
41 struct TemplateParameter {
42 // "class", "typename", or concept name
43 std::string Type;
44 std::string Name;
45 unsigned int Index;
46 unsigned int Depth;
47 bool IsParameterPack;
48
49 TemplateParameter(std::string Type, std::string Name, unsigned int Index,
50 unsigned int Depth, bool IsParameterPack)
51 : Type(Type), Name(Name), Index(Index), Depth(Depth),
52 IsParameterPack(IsParameterPack) {}
53 };
54
55 struct TemplateConstraint {
56 // type name of the constraint, if it has one
57 std::string Type;
58 std::string Kind;
59 std::string LHS, RHS;
60 };
63
64public:
65 Template() = default;
66
68 for (auto *const Parameter : *Decl->getTemplateParameters()) {
69 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
70 if (!Param) // some params are null
71 continue;
72 std::string Type;
73 if (Param->hasTypeConstraint())
74 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
75 else if (Param->wasDeclaredWithTypename())
76 Type = "typename";
77 else
78 Type = "class";
79
80 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
81 Param->getDepth(), Param->isParameterPack());
82 }
83 }
84
86 for (auto *const Parameter : *Decl->getTemplateParameters()) {
87 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
88 if (!Param) // some params are null
89 continue;
90 std::string Type;
91 if (Param->hasTypeConstraint())
92 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
93 else if (Param->wasDeclaredWithTypename())
94 Type = "typename";
95 else
96 Type = "class";
97
98 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
99 Param->getDepth(), Param->isParameterPack());
100 }
101 }
102
104 for (auto *const Parameter : *Decl->getTemplateParameters()) {
105 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
106 if (!Param) // some params are null
107 continue;
108 std::string Type;
109 if (Param->hasTypeConstraint())
110 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
111 else if (Param->wasDeclaredWithTypename())
112 Type = "typename";
113 else
114 Type = "class";
115
116 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
117 Param->getDepth(), Param->isParameterPack());
118 }
119 }
120
122 return Parameters;
123 }
124
126 return Constraints;
127 }
128
129 void addTemplateParameter(std::string Type, std::string Name,
130 unsigned int Index, unsigned int Depth,
131 bool IsParameterPack) {
132 Parameters.emplace_back(Type, Name, Index, Depth, IsParameterPack);
133 }
134
135 bool empty() const { return Parameters.empty() && Constraints.empty(); }
136};
137
138/// DocComment is a vector of RawComment::CommentLine.
139///
140/// Each line represents one line of striped documentation comment,
141/// with source range information. This simplifies calculating the source
142/// location of a character in the doc comment for pointing back to the source
143/// file.
144/// e.g.
145/// \code
146/// /// This is a documentation comment
147/// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' First line.
148/// /// with multiple lines.
149/// ^~~~~~~~~~~~~~~~~~~~~~~' Second line.
150/// \endcode
151using DocComment = std::vector<RawComment::CommentLine>;
152
153struct APIRecord;
154
155// This represents a reference to another symbol that might come from external
156/// sources.
158 StringRef Name;
159 StringRef USR;
160
161 /// The source project/module/product of the referred symbol.
162 StringRef Source;
163
164 // A Pointer to the APIRecord for this reference if known
165 const APIRecord *Record = nullptr;
166
167 SymbolReference() = default;
168 SymbolReference(StringRef Name, StringRef USR, StringRef Source = "")
169 : Name(Name), USR(USR), Source(Source) {}
170 SymbolReference(const APIRecord *R);
171
172 /// Determine if this SymbolReference is empty.
173 ///
174 /// \returns true if and only if all \c Name, \c USR, and \c Source is empty.
175 bool empty() const { return Name.empty() && USR.empty() && Source.empty(); }
176};
177
178class RecordContext;
179
180// Concrete classes deriving from APIRecord need to have a construct with first
181// arguments USR, and Name, in that order. This is so that they
182// are compatible with `APISet::createRecord`.
183// When adding a new kind of record don't forget to update APIRecords.inc!
184/// The base representation of an API record. Holds common symbol information.
185struct APIRecord {
186 /// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
233
234 StringRef USR;
235 StringRef Name;
236
238
242
243 /// Documentation comment lines attached to this symbol declaration.
245
246 /// Declaration fragments of this symbol declaration.
248
249 /// SubHeading provides a more detailed representation than the plain
250 /// declaration name.
251 ///
252 /// SubHeading is an array of declaration fragments of tagged declaration
253 /// name, with potentially more tokens (for example the \c +/- symbol for
254 /// Objective-C class/instance methods).
256
257 /// Whether the symbol was defined in a system header.
259
261
263
264private:
265 const RecordKind Kind;
266 friend class RecordContext;
267 // Used to store the next child record in RecordContext. This works because
268 // APIRecords semantically only have one parent.
269 mutable APIRecord *NextInContext = nullptr;
270
271public:
272 APIRecord *getNextInContext() const { return NextInContext; }
273
274 RecordKind getKind() const { return Kind; }
276
279
280 APIRecord() = delete;
281
293
294 APIRecord(RecordKind Kind, StringRef USR, StringRef Name)
295 : USR(USR), Name(Name), KindForDisplay(Kind), Kind(Kind) {}
296
297 // Pure virtual destructor to make APIRecord abstract
298 virtual ~APIRecord() = 0;
299 static bool classof(const APIRecord *Record) { return true; }
300 static bool classofKind(RecordKind K) { return true; }
301 static bool classof(const RecordContext *Ctx) { return true; }
302};
303
304/// Base class used for specific record types that have children records this is
305/// analogous to the DeclContext for the AST
307public:
308 static bool classof(const APIRecord *Record) {
309 return classofKind(Record->getKind());
310 }
315
316 static bool classof(const RecordContext *Context) { return true; }
317
319
320 /// Append \p Other children chain into ours and empty out Other's record
321 /// chain.
323
325
326 APIRecord::RecordKind getKind() const { return Kind; }
327
329 private:
330 APIRecord *Current = nullptr;
331
332 public:
334 using reference = const value_type &;
335 using pointer = const value_type *;
336 using iterator_category = std::forward_iterator_tag;
337 using difference_type = std::ptrdiff_t;
338
339 record_iterator() = default;
340 explicit record_iterator(value_type R) : Current(R) {}
341 reference operator*() const { return Current; }
342 // This doesn't strictly meet the iterator requirements, but it's the
343 // behavior we want here.
344 value_type operator->() const { return Current; }
346 Current = Current->getNextInContext();
347 return *this;
348 }
350 record_iterator tmp(*this);
351 ++(*this);
352 return tmp;
353 }
354
356 return x.Current == y.Current;
357 }
359 return x.Current != y.Current;
360 }
361 };
362
363 using record_range = llvm::iterator_range<record_iterator>;
366 }
369 bool records_empty() const { return First == nullptr; };
370
371private:
373 mutable APIRecord *First = nullptr;
374 mutable APIRecord *Last = nullptr;
375 bool IsWellFormed() const;
376
377protected:
378 friend class APISet;
379 void addToRecordChain(APIRecord *) const;
380};
381
398
399/// This holds information associated with global functions.
434
459
479
480/// This holds information associated with global functions.
515
538
557
581
582/// This holds information associated with enum constants.
592
593 static bool classof(const APIRecord *Record) {
594 return classofKind(Record->getKind());
595 }
596 static bool classofKind(RecordKind K) { return K == RK_EnumConstant; }
597
598private:
599 virtual void anchor();
600};
601
614
615 static bool classof(const APIRecord *Record) {
616 return classofKind(Record->getKind());
617 }
618 static bool classofKind(RecordKind K) {
619 switch (K) {
620 case RK_Enum:
621 [[fallthrough]];
622 case RK_Struct:
623 [[fallthrough]];
624 case RK_Union:
625 [[fallthrough]];
626 case RK_CXXClass:
627 [[fallthrough]];
628 case RK_ClassTemplate:
629 [[fallthrough]];
631 [[fallthrough]];
633 return true;
634 default:
635 return false;
636 }
637 }
638
640
641 virtual ~TagRecord() = 0;
642};
643
644/// This holds information associated with enums.
655
656 static bool classof(const APIRecord *Record) {
657 return classofKind(Record->getKind());
658 }
659
660 static bool classofKind(RecordKind K) { return K == RK_Enum; }
661
662private:
663 virtual void anchor();
664};
665
666/// This holds information associated with struct or union fields fields.
677
678 static bool classof(const APIRecord *Record) {
679 return classofKind(Record->getKind());
680 }
681 static bool classofKind(RecordKind K) {
682 return K == RK_StructField || K == RK_UnionField;
683 }
684
685 virtual ~RecordFieldRecord() = 0;
686};
687
688/// This holds information associated with structs and unions.
700
701 static bool classof(const APIRecord *Record) {
702 return classofKind(Record->getKind());
703 }
704 static bool classofKind(RecordKind K) {
705 switch (K) {
706 case RK_Struct:
707 [[fallthrough]];
708 case RK_Union:
709 [[fallthrough]];
710 case RK_CXXClass:
711 [[fallthrough]];
712 case RK_ClassTemplate:
713 [[fallthrough]];
715 [[fallthrough]];
717 return true;
718 default:
719 return false;
720 }
721 }
722
723 bool isAnonymousWithNoTypedef() { return Name.empty(); }
724
725 virtual ~RecordRecord() = 0;
726};
727
736
737 static bool classof(const APIRecord *Record) {
738 return classofKind(Record->getKind());
739 }
740 static bool classofKind(RecordKind K) { return K == RK_StructField; }
741
742private:
743 virtual void anchor();
744};
745
755
756 static bool classof(const APIRecord *Record) {
757 return classofKind(Record->getKind());
758 }
759 static bool classofKind(RecordKind K) { return K == RK_Struct; }
760
761private:
762 virtual void anchor();
763};
764
773
774 static bool classof(const APIRecord *Record) {
775 return classofKind(Record->getKind());
776 }
777 static bool classofKind(RecordKind K) { return K == RK_UnionField; }
778
779private:
780 virtual void anchor();
781};
782
792
793 static bool classof(const APIRecord *Record) {
794 return classofKind(Record->getKind());
795 }
796 static bool classofKind(RecordKind K) { return K == RK_Union; }
797
798private:
799 virtual void anchor();
800};
801
834
854
873
894
915
936
958
980
1000
1001/// This holds information associated with Objective-C properties.
1003 /// The attributes associated with an Objective-C property.
1004 enum AttributeKind : unsigned {
1007 Dynamic = 1 << 2,
1008 };
1009
1011 StringRef GetterName;
1012 StringRef SetterName;
1014
1027
1028 bool isReadOnly() const { return Attributes & ReadOnly; }
1029 bool isDynamic() const { return Attributes & Dynamic; }
1030
1031 virtual ~ObjCPropertyRecord() = 0;
1032};
1033
1054
1068
1069 static bool classof(const APIRecord *Record) {
1070 return classofKind(Record->getKind());
1071 }
1072 static bool classofKind(RecordKind K) { return K == RK_ObjCClassProperty; }
1073
1074private:
1075 virtual void anchor();
1076};
1077
1078/// This holds information associated with Objective-C instance variables.
1090
1091 static bool classof(const APIRecord *Record) {
1092 return classofKind(Record->getKind());
1093 }
1094 static bool classofKind(RecordKind K) { return K == RK_ObjCIvar; }
1095
1096private:
1097 virtual void anchor();
1098};
1099
1100/// This holds information associated with Objective-C methods.
1119
1139
1159
1176
1177/// The base representation of an Objective-C container record. Holds common
1178/// information associated with Objective-C containers.
1197
1200
1210
1211 static bool classof(const APIRecord *Record) {
1212 return classofKind(Record->getKind());
1213 }
1214 static bool classofKind(RecordKind K) {
1215 return K == RK_CXXClass || K == RK_ClassTemplate ||
1218 }
1219
1220private:
1221 virtual void anchor();
1222};
1223
1243
1261
1282
1301
1302/// This holds information associated with Objective-C categories.
1305
1317
1318 static bool classof(const APIRecord *Record) {
1319 return classofKind(Record->getKind());
1320 }
1321 static bool classofKind(RecordKind K) { return K == RK_ObjCCategory; }
1322
1323 bool isExtendingExternalModule() const { return !Interface.Source.empty(); }
1324
1325 std::optional<StringRef> getExtendedExternalModule() const {
1327 return {};
1328 return Interface.Source;
1329 }
1330
1331private:
1332 virtual void anchor();
1333};
1334
1335/// This holds information associated with Objective-C interfaces/classes.
1358
1359/// This holds information associated with Objective-C protocols.
1370
1371 static bool classof(const APIRecord *Record) {
1372 return classofKind(Record->getKind());
1373 }
1374 static bool classofKind(RecordKind K) { return K == RK_ObjCProtocol; }
1375
1376private:
1377 virtual void anchor();
1378};
1379
1380/// This holds information associated with macro definitions.
1390
1391 static bool classof(const APIRecord *Record) {
1392 return classofKind(Record->getKind());
1393 }
1394 static bool classofKind(RecordKind K) { return K == RK_MacroDefinition; }
1395
1396private:
1397 virtual void anchor();
1398};
1399
1400/// This holds information associated with typedefs.
1401///
1402/// Note: Typedefs for anonymous enums and structs typically don't get emitted
1403/// by the serializers but still get a TypedefRecord. Instead we use the
1404/// typedef name as a name for the underlying anonymous struct or enum.
1426
1427/// APISet holds the set of API records collected from given inputs.
1428class APISet {
1429public:
1430 /// Get the target triple for the ExtractAPI invocation.
1431 const llvm::Triple &getTarget() const { return Target; }
1432
1433 /// Get the language used by the APIs.
1434 Language getLanguage() const { return Lang; }
1435
1436 /// Finds the APIRecord for a given USR.
1437 ///
1438 /// \returns a pointer to the APIRecord associated with that USR or nullptr.
1439 APIRecord *findRecordForUSR(StringRef USR) const;
1440
1441 /// Copy \p String into the Allocator in this APISet.
1442 ///
1443 /// \returns a StringRef of the copied string in APISet::Allocator.
1444 StringRef copyString(StringRef String);
1445
1446 SymbolReference createSymbolReference(StringRef Name, StringRef USR,
1447 StringRef Source = "");
1448
1449 /// Create a subclass of \p APIRecord and store it in the APISet.
1450 ///
1451 /// \returns A pointer to the created record or the already existing record
1452 /// matching this USR.
1453 template <typename RecordTy, typename... CtorArgsContTy>
1454 typename std::enable_if_t<std::is_base_of_v<APIRecord, RecordTy>, RecordTy> *
1455 createRecord(StringRef USR, StringRef Name, CtorArgsContTy &&...CtorArgs);
1456
1458 return TopLevelRecords;
1459 }
1460
1461 void removeRecord(StringRef USR);
1462
1464
1465 APISet(const llvm::Triple &Target, Language Lang,
1466 const std::string &ProductName)
1467 : Target(Target), Lang(Lang), ProductName(ProductName) {}
1468
1469 // Prevent moves and copies
1470 APISet(const APISet &Other) = delete;
1471 APISet &operator=(const APISet &Other) = delete;
1472 APISet(APISet &&Other) = delete;
1474
1475private:
1476 /// BumpPtrAllocator that serves as the memory arena for the allocated objects
1477 llvm::BumpPtrAllocator Allocator;
1478
1479 const llvm::Triple Target;
1480 const Language Lang;
1481
1482 struct APIRecordDeleter {
1483 void operator()(APIRecord *Record) { Record->~APIRecord(); }
1484 };
1485
1486 // Ensure that the destructor of each record is called when the LookupTable is
1487 // destroyed without calling delete operator as the memory for the record
1488 // lives in the BumpPtrAllocator.
1489 using APIRecordStoredPtr = std::unique_ptr<APIRecord, APIRecordDeleter>;
1490 llvm::DenseMap<StringRef, APIRecordStoredPtr> USRBasedLookupTable;
1492
1493public:
1494 const std::string ProductName;
1495};
1496
1497template <typename RecordTy, typename... CtorArgsContTy>
1498typename std::enable_if_t<std::is_base_of_v<APIRecord, RecordTy>, RecordTy> *
1499APISet::createRecord(StringRef USR, StringRef Name,
1500 CtorArgsContTy &&...CtorArgs) {
1501 // Ensure USR refers to a String stored in the allocator.
1502 auto USRString = copyString(USR);
1503 auto Result = USRBasedLookupTable.try_emplace(USRString);
1504 RecordTy *Record;
1505
1506 // Create the record if it does not already exist
1507 if (Result.second) {
1508 Record = new (Allocator) RecordTy(
1509 USRString, copyString(Name), std::forward<CtorArgsContTy>(CtorArgs)...);
1510 // Store the record in the record lookup map
1511 Result.first->second = APIRecordStoredPtr(Record);
1512
1513 if (auto *ParentContext =
1514 dyn_cast_if_present<RecordContext>(Record->Parent.Record))
1515 ParentContext->addToRecordChain(Record);
1516 else
1517 TopLevelRecords.push_back(Record);
1518 } else {
1519 Record = dyn_cast<RecordTy>(Result.first->second.get());
1520 }
1521
1522 return Record;
1523}
1524
1525// Helper type for implementing casting to RecordContext pointers.
1526// Selected when FromTy not a known subclass of RecordContext.
1527template <typename FromTy,
1528 bool IsKnownSubType = std::is_base_of_v<RecordContext, FromTy>>
1530 static_assert(std::is_base_of_v<APIRecord, FromTy>,
1531 "Can only cast APIRecord and derived classes to RecordContext");
1532
1533 static bool isPossible(FromTy *From) { return RecordContext::classof(From); }
1534
1535 static RecordContext *doCast(FromTy *From) {
1536 return APIRecord::castToRecordContext(From);
1537 }
1538};
1539
1540// Selected when FromTy is a known subclass of RecordContext.
1541template <typename FromTy> struct ToRecordContextCastInfoWrapper<FromTy, true> {
1542 static_assert(std::is_base_of_v<APIRecord, FromTy>,
1543 "Can only cast APIRecord and derived classes to RecordContext");
1544 static bool isPossible(const FromTy *From) { return true; }
1545 static RecordContext *doCast(FromTy *From) {
1546 return static_cast<RecordContext *>(From);
1547 }
1548};
1549
1550// Helper type for implementing casting to RecordContext pointers.
1551// Selected when ToTy isn't a known subclass of RecordContext
1552template <typename ToTy,
1553 bool IsKnownSubType = std::is_base_of_v<RecordContext, ToTy>>
1555 static_assert(
1556 std::is_base_of_v<APIRecord, ToTy>,
1557 "Can only class RecordContext to APIRecord and derived classes");
1558
1559 static bool isPossible(RecordContext *Ctx) {
1560 return ToTy::classofKind(Ctx->getKind());
1561 }
1562
1563 static ToTy *doCast(RecordContext *Ctx) {
1565 }
1566};
1567
1568// Selected when ToTy is a known subclass of RecordContext.
1569template <typename ToTy> struct FromRecordContextCastInfoWrapper<ToTy, true> {
1570 static_assert(
1571 std::is_base_of_v<APIRecord, ToTy>,
1572 "Can only class RecordContext to APIRecord and derived classes");
1573 static bool isPossible(RecordContext *Ctx) {
1574 return ToTy::classof(Ctx->getKind());
1575 }
1577 return static_cast<ToTy *>(Ctx);
1578 }
1579};
1580
1581} // namespace extractapi
1582} // namespace clang
1583
1584// Implement APIRecord (and derived classes) to and from RecordContext
1585// conversions
1586namespace llvm {
1587
1588template <typename FromTy>
1589struct CastInfo<::clang::extractapi::RecordContext, FromTy *>
1590 : public NullableValueCastFailed<::clang::extractapi::RecordContext *>,
1592 ::clang::extractapi::RecordContext *, FromTy *,
1593 CastInfo<::clang::extractapi::RecordContext, FromTy *>> {
1594 static inline bool isPossible(FromTy *From) {
1595 return ::clang::extractapi::ToRecordContextCastInfoWrapper<
1596 FromTy>::isPossible(From);
1597 }
1598
1599 static inline ::clang::extractapi::RecordContext *doCast(FromTy *From) {
1600 return ::clang::extractapi::ToRecordContextCastInfoWrapper<FromTy>::doCast(
1601 From);
1602 }
1603};
1604
1605template <typename FromTy>
1606struct CastInfo<::clang::extractapi::RecordContext, const FromTy *>
1608 ::clang::extractapi::RecordContext, const FromTy *,
1609 CastInfo<::clang::extractapi::RecordContext, FromTy *>> {};
1610
1611template <typename ToTy>
1612struct CastInfo<ToTy, ::clang::extractapi::RecordContext *>
1613 : public NullableValueCastFailed<ToTy *>,
1615 ToTy *, ::clang::extractapi::RecordContext *,
1616 CastInfo<ToTy, ::clang::extractapi::RecordContext *>> {
1618 return ::clang::extractapi::FromRecordContextCastInfoWrapper<
1619 ToTy>::isPossible(Ctx);
1620 }
1621
1622 static inline ToTy *doCast(::clang::extractapi::RecordContext *Ctx) {
1623 return ::clang::extractapi::FromRecordContextCastInfoWrapper<ToTy>::doCast(
1624 Ctx);
1625 }
1626};
1627
1628template <typename ToTy>
1629struct CastInfo<ToTy, const ::clang::extractapi::RecordContext *>
1631 ToTy, const ::clang::extractapi::RecordContext *,
1632 CastInfo<ToTy, ::clang::extractapi::RecordContext *>> {};
1633
1634} // namespace llvm
1635
1636#endif // LLVM_CLANG_EXTRACTAPI_API_H
This file defines the Declaration Fragments related classes.
llvm::MachO::Record Record
Definition MachO.h:31
Defines the clang::SourceLocation class and associated facilities.
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
Represents an unpacked "presumed" location which can be presented to the user.
The base class of all kinds of template declarations (e.g., class, function, etc.).
The base class of the type hierarchy.
Definition TypeBase.h:1875
std::enable_if_t< std::is_base_of_v< APIRecord, RecordTy >, RecordTy > * createRecord(StringRef USR, StringRef Name, CtorArgsContTy &&...CtorArgs)
Create a subclass of APIRecord and store it in the APISet.
Definition API.h:1499
APISet & operator=(const APISet &Other)=delete
SymbolReference createSymbolReference(StringRef Name, StringRef USR, StringRef Source="")
Definition API.cpp:134
Language getLanguage() const
Get the language used by the APIs.
Definition API.h:1434
ArrayRef< const APIRecord * > getTopLevelRecords() const
Definition API.h:1457
const std::string ProductName
Definition API.h:1494
APISet(const APISet &Other)=delete
StringRef copyString(StringRef String)
Copy String into the Allocator in this APISet.
Definition API.cpp:121
APISet(APISet &&Other)=delete
const llvm::Triple & getTarget() const
Get the target triple for the ExtractAPI invocation.
Definition API.h:1431
APISet & operator=(APISet &&Other)=delete
void removeRecord(StringRef USR)
Definition API.cpp:139
APIRecord * findRecordForUSR(StringRef USR) const
Finds the APIRecord for a given USR.
Definition API.cpp:110
APISet(const llvm::Triple &Target, Language Lang, const std::string &ProductName)
Definition API.h:1465
DeclarationFragments is a vector of tagged important parts of a symbol's declaration.
Store function signature information with DeclarationFragments of the return type and parameters.
Base class used for specific record types that have children records this is analogous to the DeclCon...
Definition API.h:306
void removeFromRecordChain(APIRecord *Record)
Definition API.cpp:94
record_iterator records_begin() const
Definition API.h:367
static bool classof(const RecordContext *Context)
Definition API.h:316
llvm::iterator_range< record_iterator > record_range
Definition API.h:363
APIRecord::RecordKind getKind() const
Definition API.h:326
record_range records() const
Definition API.h:364
void stealRecordChain(RecordContext &Other)
Append Other children chain into ours and empty out Other's record chain.
Definition API.cpp:59
record_iterator records_end() const
Definition API.h:368
static bool classofKind(APIRecord::RecordKind K)
Definition API.h:311
void addToRecordChain(APIRecord *) const
Definition API.cpp:82
RecordContext(APIRecord::RecordKind Kind)
Definition API.h:318
static bool classof(const APIRecord *Record)
Definition API.h:308
void addTemplateParameter(std::string Type, std::string Name, unsigned int Index, unsigned int Depth, bool IsParameterPack)
Definition API.h:129
Template(const TemplateDecl *Decl)
Definition API.h:67
Template(const VarTemplatePartialSpecializationDecl *Decl)
Definition API.h:103
Template(const ClassTemplatePartialSpecializationDecl *Decl)
Definition API.h:85
const llvm::SmallVector< TemplateParameter > & getParameters() const
Definition API.h:121
const llvm::SmallVector< TemplateConstraint > & getConstraints() const
Definition API.h:125
bool empty() const
Definition API.h:135
std::vector< RawComment::CommentLine > DocComment
DocComment is a vector of RawComment::CommentLine.
Definition API.h:151
The JSON file list parser is used to communicate input to InstallAPI.
Language
The language for the input, used to select and validate the language standard and possible actions.
@ Parameter
The parameter type of a method or function.
Definition TypeBase.h:908
@ Result
The result type of a method or function.
Definition TypeBase.h:905
@ Type
The name was classified as a type.
Definition Sema.h:564
llvm::PointerUnion< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
@ Other
Other implicit parameter.
Definition Decl.h:1763
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
#define true
Definition stdbool.h:25
Storage of availability attributes for a declaration.
The base representation of an API record. Holds common symbol information.
Definition API.h:185
RecordKind getKind() const
Definition API.h:274
APIRecord(RecordKind Kind, StringRef USR, StringRef Name)
Definition API.h:294
DocComment Comment
Documentation comment lines attached to this symbol declaration.
Definition API.h:244
AvailabilityInfo Availability
Definition API.h:240
DeclarationFragments Declaration
Declaration fragments of this symbol declaration.
Definition API.h:247
RecordKind getKindForDisplay() const
Definition API.h:275
RecordKind KindForDisplay
Definition API.h:262
APIRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Location, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader, AccessControl Access=AccessControl())
Definition API.h:282
DeclarationFragments SubHeading
SubHeading provides a more detailed representation than the plain declaration name.
Definition API.h:255
APIRecord * getNextInContext() const
Definition API.h:272
AccessControl Access
Definition API.h:260
static bool classofKind(RecordKind K)
Definition API.h:300
RecordKind
Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
Definition API.h:187
@ RK_GlobalFunctionTemplateSpecialization
Definition API.h:216
@ RK_GlobalVariableTemplatePartialSpecialization
Definition API.h:212
@ RK_GlobalVariableTemplateSpecialization
Definition API.h:211
static APIRecord * castFromRecordContext(const RecordContext *Ctx)
friend class RecordContext
Definition API.h:266
static RecordContext * castToRecordContext(const APIRecord *Record)
SymbolReference Parent
Definition API.h:237
static bool classof(const RecordContext *Ctx)
Definition API.h:301
bool IsFromSystemHeader
Whether the symbol was defined in a system header.
Definition API.h:258
static bool classof(const APIRecord *Record)
Definition API.h:299
SmallVector< SymbolReference > Bases
Definition API.h:1199
static bool classofKind(RecordKind K)
Definition API.h:1214
static bool classof(const APIRecord *Record)
Definition API.h:1211
CXXClassRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, RecordKind Kind, AccessControl Access, bool IsFromSystemHeader, bool IsEmbeddedInVarDeclarator=false)
Definition API.h:1201
CXXConstructorRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:875
static bool classof(const APIRecord *Record)
Definition API.h:886
static bool classofKind(RecordKind K)
Definition API.h:889
CXXDestructorRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:896
static bool classofKind(RecordKind K)
Definition API.h:910
static bool classof(const APIRecord *Record)
Definition API.h:907
CXXFieldRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:803
static bool classofKind(RecordKind K)
Definition API.h:827
static bool classof(const APIRecord *Record)
Definition API.h:824
CXXFieldRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:813
static bool classof(const APIRecord *Record)
Definition API.h:849
static bool classofKind(RecordKind K)
Definition API.h:852
CXXFieldTemplateRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, Template Template, bool IsFromSystemHeader)
Definition API.h:838
static bool classof(const APIRecord *Record)
Definition API.h:950
static bool classofKind(RecordKind K)
Definition API.h:953
CXXInstanceMethodRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:938
CXXMethodRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:860
FunctionSignature Signature
Definition API.h:856
static bool classofKind(RecordKind K)
Definition API.h:978
static bool classof(const APIRecord *Record)
Definition API.h:975
CXXMethodTemplateRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, Template Template, bool IsFromSystemHeader)
Definition API.h:962
static bool classof(const APIRecord *Record)
Definition API.h:993
CXXMethodTemplateSpecializationRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:982
static bool classof(const APIRecord *Record)
Definition API.h:928
CXXStaticMethodRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:917
static bool classofKind(RecordKind K)
Definition API.h:931
ClassTemplatePartialSpecializationRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:1264
static bool classof(const APIRecord *Record)
Definition API.h:1275
static bool classof(const APIRecord *Record)
Definition API.h:1238
ClassTemplateRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:1227
static bool classofKind(RecordKind K)
Definition API.h:1241
ClassTemplateSpecializationRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:1245
static bool classof(const APIRecord *Record)
Definition API.h:1254
ConceptRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, bool IsFromSystemHeader)
Definition API.h:1286
static bool classof(const APIRecord *Record)
Definition API.h:1296
static bool classofKind(RecordKind K)
Definition API.h:1299
EnumConstantRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:584
static bool classofKind(RecordKind K)
Definition API.h:596
static bool classof(const APIRecord *Record)
Definition API.h:593
static bool classof(const APIRecord *Record)
Definition API.h:656
EnumRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader, bool IsEmbeddedInVarDeclarator, AccessControl Access=AccessControl())
Definition API.h:646
static bool classofKind(RecordKind K)
Definition API.h:660
static RecordContext * doCast(RecordContext *Ctx)
Definition API.h:1576
static ToTy * doCast(RecordContext *Ctx)
Definition API.h:1563
static bool isPossible(RecordContext *Ctx)
Definition API.h:1559
GlobalFunctionRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition API.h:414
static bool classof(const APIRecord *Record)
Definition API.h:426
static bool classofKind(RecordKind K)
Definition API.h:429
GlobalFunctionRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition API.h:403
GlobalFunctionTemplateRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, Template Template, bool IsFromSystemHeader)
Definition API.h:438
static bool classofKind(RecordKind K)
Definition API.h:455
static bool classof(const APIRecord *Record)
Definition API.h:452
static bool classof(const APIRecord *Record)
Definition API.h:472
GlobalFunctionTemplateSpecializationRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition API.h:461
static bool classof(const APIRecord *Record)
Definition API.h:503
GlobalVariableRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:492
static bool classofKind(RecordKind K)
Definition API.h:506
GlobalVariableRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:482
GlobalVariableTemplatePartialSpecializationRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, class Template Template, bool IsFromSystemHeader)
Definition API.h:562
static bool classof(const APIRecord *Record)
Definition API.h:531
static bool classofKind(RecordKind K)
Definition API.h:534
GlobalVariableTemplateRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, class Template Template, bool IsFromSystemHeader)
Definition API.h:519
static bool classof(const APIRecord *Record)
Definition API.h:550
GlobalVariableTemplateSpecializationRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:540
static bool classof(const APIRecord *Record)
Definition API.h:1391
static bool classofKind(RecordKind K)
Definition API.h:1394
MacroDefinitionRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1382
static bool classof(const APIRecord *Record)
Definition API.h:393
NamespaceRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:383
static bool classofKind(RecordKind K)
Definition API.h:396
static bool classofKind(RecordKind K)
Definition API.h:1321
ObjCCategoryRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference Interface, bool IsFromSystemHeader)
Definition API.h:1306
std::optional< StringRef > getExtendedExternalModule() const
Definition API.h:1325
static bool classof(const APIRecord *Record)
Definition API.h:1318
static bool classofKind(RecordKind K)
Definition API.h:1154
ObjCClassMethodRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition API.h:1141
static bool classof(const APIRecord *Record)
Definition API.h:1151
static bool classof(const APIRecord *Record)
Definition API.h:1069
static bool classofKind(RecordKind K)
Definition API.h:1072
ObjCClassPropertyRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsFromSystemHeader)
Definition API.h:1056
SmallVector< SymbolReference > Protocols
Definition API.h:1180
ObjCContainerRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1184
static bool classofKind(RecordKind K)
Definition API.h:1134
ObjCInstanceMethodRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition API.h:1121
static bool classof(const APIRecord *Record)
Definition API.h:1131
static bool classof(const APIRecord *Record)
Definition API.h:1046
static bool classofKind(RecordKind K)
Definition API.h:1049
ObjCInstancePropertyRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsFromSystemHeader)
Definition API.h:1035
static bool classofKind(RecordKind K)
Definition API.h:1094
ObjCInstanceVariableRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1080
static bool classof(const APIRecord *Record)
Definition API.h:1091
static bool classof(const APIRecord *Record)
Definition API.h:1350
static bool classofKind(RecordKind K)
Definition API.h:1353
ObjCInterfaceRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference SuperClass, bool IsFromSystemHeader)
Definition API.h:1339
ObjCMethodRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition API.h:1106
FunctionSignature Signature
Definition API.h:1102
AttributeKind
The attributes associated with an Objective-C property.
Definition API.h:1004
ObjCPropertyRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsFromSystemHeader)
Definition API.h:1015
static bool classof(const APIRecord *Record)
Definition API.h:1371
static bool classofKind(RecordKind K)
Definition API.h:1374
ObjCProtocolRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1361
std::forward_iterator_tag iterator_category
Definition API.h:336
friend bool operator==(record_iterator x, record_iterator y)
Definition API.h:355
friend bool operator!=(record_iterator x, record_iterator y)
Definition API.h:358
RecordFieldRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:668
static bool classofKind(RecordKind K)
Definition API.h:681
static bool classof(const APIRecord *Record)
Definition API.h:678
RecordRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader, bool IsEmbeddedInVarDeclarator, AccessControl Access=AccessControl())
Definition API.h:690
static bool classof(const APIRecord *Record)
Definition API.h:701
static bool classofKind(RecordKind K)
Definition API.h:704
static bool classof(const APIRecord *Record)
Definition API.h:1171
static bool classofKind(RecordKind K)
Definition API.h:1174
StaticFieldRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition API.h:1161
static bool classof(const APIRecord *Record)
Definition API.h:737
static bool classofKind(RecordKind K)
Definition API.h:740
StructFieldRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:729
StructRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader, bool IsEmbeddedInVarDeclarator)
Definition API.h:747
static bool classof(const APIRecord *Record)
Definition API.h:756
static bool classofKind(RecordKind K)
Definition API.h:759
bool empty() const
Determine if this SymbolReference is empty.
Definition API.h:175
SymbolReference(StringRef Name, StringRef USR, StringRef Source="")
Definition API.h:168
StringRef Source
The source project/module/product of the referred symbol.
Definition API.h:162
const APIRecord * Record
Definition API.h:165
static bool classof(const APIRecord *Record)
Definition API.h:615
static bool classofKind(RecordKind K)
Definition API.h:618
TagRecord(RecordKind Kind, StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader, bool IsEmbeddedInVarDeclarator, AccessControl Access=AccessControl())
Definition API.h:603
static RecordContext * doCast(FromTy *From)
Definition API.h:1535
static bool classofKind(RecordKind K)
Definition API.h:1421
SymbolReference UnderlyingType
Definition API.h:1406
TypedefRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference UnderlyingType, bool IsFromSystemHeader)
Definition API.h:1408
static bool classof(const APIRecord *Record)
Definition API.h:1418
static bool classofKind(RecordKind K)
Definition API.h:777
static bool classof(const APIRecord *Record)
Definition API.h:774
UnionFieldRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:766
static bool classof(const APIRecord *Record)
Definition API.h:793
UnionRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader, bool IsEmbeddedInVarDeclarator)
Definition API.h:784
static bool classofKind(RecordKind K)
Definition API.h:796
static ToTy * doCast(::clang::extractapi::RecordContext *Ctx)
Definition API.h:1622
static bool isPossible(::clang::extractapi::RecordContext *Ctx)
Definition API.h:1617
static inline ::clang::extractapi::RecordContext * doCast(FromTy *From)
Definition API.h:1599