clang 24.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()
75 ->getNamedConcept()
76 .getAsTemplateDecl()
77 ->getName()
78 .str();
79 else if (Param->wasDeclaredWithTypename())
80 Type = "typename";
81 else
82 Type = "class";
83
84 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
85 Param->getDepth(), Param->isParameterPack());
86 }
87 }
88
90 for (auto *const Parameter : *Decl->getTemplateParameters()) {
91 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
92 if (!Param) // some params are null
93 continue;
94 std::string Type;
95 if (Param->hasTypeConstraint())
96 Type = Param->getTypeConstraint()
97 ->getNamedConcept()
98 .getAsTemplateDecl()
99 ->getName()
100 .str();
101 else if (Param->wasDeclaredWithTypename())
102 Type = "typename";
103 else
104 Type = "class";
105
106 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
107 Param->getDepth(), Param->isParameterPack());
108 }
109 }
110
112 for (auto *const Parameter : *Decl->getTemplateParameters()) {
113 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
114 if (!Param) // some params are null
115 continue;
116 std::string Type;
117 if (Param->hasTypeConstraint())
118 Type = Param->getTypeConstraint()
119 ->getNamedConcept()
120 .getAsTemplateDecl()
121 ->getName()
122 .str();
123 else if (Param->wasDeclaredWithTypename())
124 Type = "typename";
125 else
126 Type = "class";
127
128 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
129 Param->getDepth(), Param->isParameterPack());
130 }
131 }
132
134 return Parameters;
135 }
136
138 return Constraints;
139 }
140
141 void addTemplateParameter(std::string Type, std::string Name,
142 unsigned int Index, unsigned int Depth,
143 bool IsParameterPack) {
144 Parameters.emplace_back(Type, Name, Index, Depth, IsParameterPack);
145 }
146
147 bool empty() const { return Parameters.empty() && Constraints.empty(); }
148};
149
150/// DocComment is a vector of RawComment::CommentLine.
151///
152/// Each line represents one line of striped documentation comment,
153/// with source range information. This simplifies calculating the source
154/// location of a character in the doc comment for pointing back to the source
155/// file.
156/// e.g.
157/// \code
158/// /// This is a documentation comment
159/// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' First line.
160/// /// with multiple lines.
161/// ^~~~~~~~~~~~~~~~~~~~~~~' Second line.
162/// \endcode
163using DocComment = std::vector<RawComment::CommentLine>;
164
165struct APIRecord;
166
167// This represents a reference to another symbol that might come from external
168/// sources.
170 StringRef Name;
171 StringRef USR;
172
173 /// The source project/module/product of the referred symbol.
174 StringRef Source;
175
176 // A Pointer to the APIRecord for this reference if known
177 const APIRecord *Record = nullptr;
178
179 SymbolReference() = default;
180 SymbolReference(StringRef Name, StringRef USR, StringRef Source = "")
181 : Name(Name), USR(USR), Source(Source) {}
182 SymbolReference(const APIRecord *R);
183
184 /// Determine if this SymbolReference is empty.
185 ///
186 /// \returns true if and only if all \c Name, \c USR, and \c Source is empty.
187 bool empty() const { return Name.empty() && USR.empty() && Source.empty(); }
188};
189
190class RecordContext;
191
192// Concrete classes deriving from APIRecord need to have a construct with first
193// arguments USR, and Name, in that order. This is so that they
194// are compatible with `APISet::createRecord`.
195// When adding a new kind of record don't forget to update APIRecords.inc!
196/// The base representation of an API record. Holds common symbol information.
197struct APIRecord {
198 /// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
245
246 StringRef USR;
247 StringRef Name;
248
250
254
255 /// Documentation comment lines attached to this symbol declaration.
257
258 /// Declaration fragments of this symbol declaration.
260
261 /// SubHeading provides a more detailed representation than the plain
262 /// declaration name.
263 ///
264 /// SubHeading is an array of declaration fragments of tagged declaration
265 /// name, with potentially more tokens (for example the \c +/- symbol for
266 /// Objective-C class/instance methods).
268
269 /// Whether the symbol was defined in a system header.
271
273
275
276private:
277 const RecordKind Kind;
278 friend class RecordContext;
279 // Used to store the next child record in RecordContext. This works because
280 // APIRecords semantically only have one parent.
281 mutable APIRecord *NextInContext = nullptr;
282
283public:
284 APIRecord *getNextInContext() const { return NextInContext; }
285
286 RecordKind getKind() const { return Kind; }
288
291
292 APIRecord() = delete;
293
305
306 APIRecord(RecordKind Kind, StringRef USR, StringRef Name)
307 : USR(USR), Name(Name), KindForDisplay(Kind), Kind(Kind) {}
308
309 // Pure virtual destructor to make APIRecord abstract
310 virtual ~APIRecord() = 0;
311 static bool classof(const APIRecord *Record) { return true; }
312 static bool classofKind(RecordKind K) { return true; }
313 static bool classof(const RecordContext *Ctx) { return true; }
314};
315
316/// Base class used for specific record types that have children records this is
317/// analogous to the DeclContext for the AST
319public:
320 static bool classof(const APIRecord *Record) {
321 return classofKind(Record->getKind());
322 }
327
328 static bool classof(const RecordContext *Context) { return true; }
329
331
332 /// Append \p Other children chain into ours and empty out Other's record
333 /// chain.
335
337
338 APIRecord::RecordKind getKind() const { return Kind; }
339
341 private:
342 APIRecord *Current = nullptr;
343
344 public:
346 using reference = const value_type &;
347 using pointer = const value_type *;
348 using iterator_category = std::forward_iterator_tag;
349 using difference_type = std::ptrdiff_t;
350
351 record_iterator() = default;
352 explicit record_iterator(value_type R) : Current(R) {}
353 reference operator*() const { return Current; }
354 // This doesn't strictly meet the iterator requirements, but it's the
355 // behavior we want here.
356 value_type operator->() const { return Current; }
358 Current = Current->getNextInContext();
359 return *this;
360 }
362 record_iterator tmp(*this);
363 ++(*this);
364 return tmp;
365 }
366
368 return x.Current == y.Current;
369 }
371 return x.Current != y.Current;
372 }
373 };
374
375 using record_range = llvm::iterator_range<record_iterator>;
378 }
381 bool records_empty() const { return First == nullptr; };
382
383private:
385 mutable APIRecord *First = nullptr;
386 mutable APIRecord *Last = nullptr;
387 bool IsWellFormed() const;
388
389protected:
390 friend class APISet;
391 void addToRecordChain(APIRecord *) const;
392};
393
410
411/// This holds information associated with global functions.
446
471
491
492/// This holds information associated with global functions.
527
550
569
593
594/// This holds information associated with enum constants.
604
605 static bool classof(const APIRecord *Record) {
606 return classofKind(Record->getKind());
607 }
608 static bool classofKind(RecordKind K) { return K == RK_EnumConstant; }
609
610private:
611 virtual void anchor();
612};
613
626
627 static bool classof(const APIRecord *Record) {
628 return classofKind(Record->getKind());
629 }
630 static bool classofKind(RecordKind K) {
631 switch (K) {
632 case RK_Enum:
633 [[fallthrough]];
634 case RK_Struct:
635 [[fallthrough]];
636 case RK_Union:
637 [[fallthrough]];
638 case RK_CXXClass:
639 [[fallthrough]];
640 case RK_ClassTemplate:
641 [[fallthrough]];
643 [[fallthrough]];
645 return true;
646 default:
647 return false;
648 }
649 }
650
652
653 virtual ~TagRecord() = 0;
654};
655
656/// This holds information associated with enums.
667
668 static bool classof(const APIRecord *Record) {
669 return classofKind(Record->getKind());
670 }
671
672 static bool classofKind(RecordKind K) { return K == RK_Enum; }
673
674private:
675 virtual void anchor();
676};
677
678/// This holds information associated with struct or union fields fields.
689
690 static bool classof(const APIRecord *Record) {
691 return classofKind(Record->getKind());
692 }
693 static bool classofKind(RecordKind K) {
694 return K == RK_StructField || K == RK_UnionField;
695 }
696
697 virtual ~RecordFieldRecord() = 0;
698};
699
700/// This holds information associated with structs and unions.
712
713 static bool classof(const APIRecord *Record) {
714 return classofKind(Record->getKind());
715 }
716 static bool classofKind(RecordKind K) {
717 switch (K) {
718 case RK_Struct:
719 [[fallthrough]];
720 case RK_Union:
721 [[fallthrough]];
722 case RK_CXXClass:
723 [[fallthrough]];
724 case RK_ClassTemplate:
725 [[fallthrough]];
727 [[fallthrough]];
729 return true;
730 default:
731 return false;
732 }
733 }
734
735 bool isAnonymousWithNoTypedef() { return Name.empty(); }
736
737 virtual ~RecordRecord() = 0;
738};
739
748
749 static bool classof(const APIRecord *Record) {
750 return classofKind(Record->getKind());
751 }
752 static bool classofKind(RecordKind K) { return K == RK_StructField; }
753
754private:
755 virtual void anchor();
756};
757
767
768 static bool classof(const APIRecord *Record) {
769 return classofKind(Record->getKind());
770 }
771 static bool classofKind(RecordKind K) { return K == RK_Struct; }
772
773private:
774 virtual void anchor();
775};
776
785
786 static bool classof(const APIRecord *Record) {
787 return classofKind(Record->getKind());
788 }
789 static bool classofKind(RecordKind K) { return K == RK_UnionField; }
790
791private:
792 virtual void anchor();
793};
794
804
805 static bool classof(const APIRecord *Record) {
806 return classofKind(Record->getKind());
807 }
808 static bool classofKind(RecordKind K) { return K == RK_Union; }
809
810private:
811 virtual void anchor();
812};
813
846
866
885
906
927
948
970
992
1012
1013/// This holds information associated with Objective-C properties.
1015 /// The attributes associated with an Objective-C property.
1016 enum AttributeKind : unsigned {
1019 Dynamic = 1 << 2,
1020 };
1021
1023 StringRef GetterName;
1024 StringRef SetterName;
1026
1039
1040 bool isReadOnly() const { return Attributes & ReadOnly; }
1041 bool isDynamic() const { return Attributes & Dynamic; }
1042
1043 virtual ~ObjCPropertyRecord() = 0;
1044};
1045
1066
1080
1081 static bool classof(const APIRecord *Record) {
1082 return classofKind(Record->getKind());
1083 }
1084 static bool classofKind(RecordKind K) { return K == RK_ObjCClassProperty; }
1085
1086private:
1087 virtual void anchor();
1088};
1089
1090/// This holds information associated with Objective-C instance variables.
1102
1103 static bool classof(const APIRecord *Record) {
1104 return classofKind(Record->getKind());
1105 }
1106 static bool classofKind(RecordKind K) { return K == RK_ObjCIvar; }
1107
1108private:
1109 virtual void anchor();
1110};
1111
1112/// This holds information associated with Objective-C methods.
1131
1151
1171
1188
1189/// The base representation of an Objective-C container record. Holds common
1190/// information associated with Objective-C containers.
1209
1212
1222
1223 static bool classof(const APIRecord *Record) {
1224 return classofKind(Record->getKind());
1225 }
1226 static bool classofKind(RecordKind K) {
1227 return K == RK_CXXClass || K == RK_ClassTemplate ||
1230 }
1231
1232private:
1233 virtual void anchor();
1234};
1235
1255
1273
1294
1313
1314/// This holds information associated with Objective-C categories.
1317
1329
1330 static bool classof(const APIRecord *Record) {
1331 return classofKind(Record->getKind());
1332 }
1333 static bool classofKind(RecordKind K) { return K == RK_ObjCCategory; }
1334
1335 bool isExtendingExternalModule() const { return !Interface.Source.empty(); }
1336
1337 std::optional<StringRef> getExtendedExternalModule() const {
1339 return {};
1340 return Interface.Source;
1341 }
1342
1343private:
1344 virtual void anchor();
1345};
1346
1347/// This holds information associated with Objective-C interfaces/classes.
1370
1371/// This holds information associated with Objective-C protocols.
1382
1383 static bool classof(const APIRecord *Record) {
1384 return classofKind(Record->getKind());
1385 }
1386 static bool classofKind(RecordKind K) { return K == RK_ObjCProtocol; }
1387
1388private:
1389 virtual void anchor();
1390};
1391
1392/// This holds information associated with macro definitions.
1402
1403 static bool classof(const APIRecord *Record) {
1404 return classofKind(Record->getKind());
1405 }
1406 static bool classofKind(RecordKind K) { return K == RK_MacroDefinition; }
1407
1408private:
1409 virtual void anchor();
1410};
1411
1412/// This holds information associated with typedefs.
1413///
1414/// Note: Typedefs for anonymous enums and structs typically don't get emitted
1415/// by the serializers but still get a TypedefRecord. Instead we use the
1416/// typedef name as a name for the underlying anonymous struct or enum.
1438
1439/// APISet holds the set of API records collected from given inputs.
1440class APISet {
1441public:
1442 /// Get the target triple for the ExtractAPI invocation.
1443 const llvm::Triple &getTarget() const { return Target; }
1444
1445 /// Get the language used by the APIs.
1446 Language getLanguage() const { return Lang; }
1447
1448 /// Finds the APIRecord for a given USR.
1449 ///
1450 /// \returns a pointer to the APIRecord associated with that USR or nullptr.
1451 APIRecord *findRecordForUSR(StringRef USR) const;
1452
1453 /// Copy \p String into the Allocator in this APISet.
1454 ///
1455 /// \returns a StringRef of the copied string in APISet::Allocator.
1456 StringRef copyString(StringRef String);
1457
1458 SymbolReference createSymbolReference(StringRef Name, StringRef USR,
1459 StringRef Source = "");
1460
1461 /// Create a subclass of \p APIRecord and store it in the APISet.
1462 ///
1463 /// \returns A pointer to the created record or the already existing record
1464 /// matching this USR.
1465 template <typename RecordTy, typename... CtorArgsContTy>
1466 typename std::enable_if_t<std::is_base_of_v<APIRecord, RecordTy>, RecordTy> *
1467 createRecord(StringRef USR, StringRef Name, CtorArgsContTy &&...CtorArgs);
1468
1470 return TopLevelRecords;
1471 }
1472
1473 void removeRecord(StringRef USR);
1474
1476
1477 APISet(const llvm::Triple &Target, Language Lang,
1478 const std::string &ProductName)
1479 : Target(Target), Lang(Lang), ProductName(ProductName) {}
1480
1481 // Prevent moves and copies
1482 APISet(const APISet &Other) = delete;
1483 APISet &operator=(const APISet &Other) = delete;
1484 APISet(APISet &&Other) = delete;
1486
1487private:
1488 /// BumpPtrAllocator that serves as the memory arena for the allocated objects
1489 llvm::BumpPtrAllocator Allocator;
1490
1491 const llvm::Triple Target;
1492 const Language Lang;
1493
1494 struct APIRecordDeleter {
1495 void operator()(APIRecord *Record) { Record->~APIRecord(); }
1496 };
1497
1498 // Ensure that the destructor of each record is called when the LookupTable is
1499 // destroyed without calling delete operator as the memory for the record
1500 // lives in the BumpPtrAllocator.
1501 using APIRecordStoredPtr = std::unique_ptr<APIRecord, APIRecordDeleter>;
1502 llvm::DenseMap<StringRef, APIRecordStoredPtr> USRBasedLookupTable;
1504
1505public:
1506 const std::string ProductName;
1507};
1508
1509template <typename RecordTy, typename... CtorArgsContTy>
1510typename std::enable_if_t<std::is_base_of_v<APIRecord, RecordTy>, RecordTy> *
1511APISet::createRecord(StringRef USR, StringRef Name,
1512 CtorArgsContTy &&...CtorArgs) {
1513 // Ensure USR refers to a String stored in the allocator.
1514 auto USRString = copyString(USR);
1515 auto Result = USRBasedLookupTable.try_emplace(USRString);
1516 RecordTy *Record;
1517
1518 // Create the record if it does not already exist
1519 if (Result.second) {
1520 Record = new (Allocator) RecordTy(
1521 USRString, copyString(Name), std::forward<CtorArgsContTy>(CtorArgs)...);
1522 // Store the record in the record lookup map
1523 Result.first->second = APIRecordStoredPtr(Record);
1524
1525 if (auto *ParentContext =
1526 dyn_cast_if_present<RecordContext>(Record->Parent.Record))
1527 ParentContext->addToRecordChain(Record);
1528 else
1529 TopLevelRecords.push_back(Record);
1530 } else {
1531 Record = dyn_cast<RecordTy>(Result.first->second.get());
1532 }
1533
1534 return Record;
1535}
1536
1537// Helper type for implementing casting to RecordContext pointers.
1538// Selected when FromTy not a known subclass of RecordContext.
1539template <typename FromTy,
1540 bool IsKnownSubType = std::is_base_of_v<RecordContext, FromTy>>
1542 static_assert(std::is_base_of_v<APIRecord, FromTy>,
1543 "Can only cast APIRecord and derived classes to RecordContext");
1544
1545 static bool isPossible(FromTy *From) { return RecordContext::classof(From); }
1546
1547 static RecordContext *doCast(FromTy *From) {
1548 return APIRecord::castToRecordContext(From);
1549 }
1550};
1551
1552// Selected when FromTy is a known subclass of RecordContext.
1553template <typename FromTy> struct ToRecordContextCastInfoWrapper<FromTy, true> {
1554 static_assert(std::is_base_of_v<APIRecord, FromTy>,
1555 "Can only cast APIRecord and derived classes to RecordContext");
1556 static bool isPossible(const FromTy *From) { return true; }
1557 static RecordContext *doCast(FromTy *From) {
1558 return static_cast<RecordContext *>(From);
1559 }
1560};
1561
1562// Helper type for implementing casting to RecordContext pointers.
1563// Selected when ToTy isn't a known subclass of RecordContext
1564template <typename ToTy,
1565 bool IsKnownSubType = std::is_base_of_v<RecordContext, ToTy>>
1567 static_assert(
1568 std::is_base_of_v<APIRecord, ToTy>,
1569 "Can only class RecordContext to APIRecord and derived classes");
1570
1571 static bool isPossible(RecordContext *Ctx) {
1572 return ToTy::classofKind(Ctx->getKind());
1573 }
1574
1575 static ToTy *doCast(RecordContext *Ctx) {
1577 }
1578};
1579
1580// Selected when ToTy is a known subclass of RecordContext.
1581template <typename ToTy> struct FromRecordContextCastInfoWrapper<ToTy, true> {
1582 static_assert(
1583 std::is_base_of_v<APIRecord, ToTy>,
1584 "Can only class RecordContext to APIRecord and derived classes");
1585 static bool isPossible(RecordContext *Ctx) {
1586 return ToTy::classof(Ctx->getKind());
1587 }
1589 return static_cast<ToTy *>(Ctx);
1590 }
1591};
1592
1593} // namespace extractapi
1594} // namespace clang
1595
1596// Implement APIRecord (and derived classes) to and from RecordContext
1597// conversions
1598namespace llvm {
1599
1600template <typename FromTy>
1601struct CastInfo<::clang::extractapi::RecordContext, FromTy *>
1602 : public NullableValueCastFailed<::clang::extractapi::RecordContext *>,
1604 ::clang::extractapi::RecordContext *, FromTy *,
1605 CastInfo<::clang::extractapi::RecordContext, FromTy *>> {
1606 static inline bool isPossible(FromTy *From) {
1607 return ::clang::extractapi::ToRecordContextCastInfoWrapper<
1608 FromTy>::isPossible(From);
1609 }
1610
1611 static inline ::clang::extractapi::RecordContext *doCast(FromTy *From) {
1612 return ::clang::extractapi::ToRecordContextCastInfoWrapper<FromTy>::doCast(
1613 From);
1614 }
1615};
1616
1617template <typename FromTy>
1618struct CastInfo<::clang::extractapi::RecordContext, const FromTy *>
1620 ::clang::extractapi::RecordContext, const FromTy *,
1621 CastInfo<::clang::extractapi::RecordContext, FromTy *>> {};
1622
1623template <typename ToTy>
1624struct CastInfo<ToTy, ::clang::extractapi::RecordContext *>
1625 : public NullableValueCastFailed<ToTy *>,
1627 ToTy *, ::clang::extractapi::RecordContext *,
1628 CastInfo<ToTy, ::clang::extractapi::RecordContext *>> {
1630 return ::clang::extractapi::FromRecordContextCastInfoWrapper<
1631 ToTy>::isPossible(Ctx);
1632 }
1633
1634 static inline ToTy *doCast(::clang::extractapi::RecordContext *Ctx) {
1635 return ::clang::extractapi::FromRecordContextCastInfoWrapper<ToTy>::doCast(
1636 Ctx);
1637 }
1638};
1639
1640template <typename ToTy>
1641struct CastInfo<ToTy, const ::clang::extractapi::RecordContext *>
1643 ToTy, const ::clang::extractapi::RecordContext *,
1644 CastInfo<ToTy, ::clang::extractapi::RecordContext *>> {};
1645
1646} // namespace llvm
1647
1648#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:1879
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:1511
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:1446
ArrayRef< const APIRecord * > getTopLevelRecords() const
Definition API.h:1469
const std::string ProductName
Definition API.h:1506
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:1443
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:1477
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:318
void removeFromRecordChain(APIRecord *Record)
Definition API.cpp:94
record_iterator records_begin() const
Definition API.h:379
static bool classof(const RecordContext *Context)
Definition API.h:328
llvm::iterator_range< record_iterator > record_range
Definition API.h:375
APIRecord::RecordKind getKind() const
Definition API.h:338
record_range records() const
Definition API.h:376
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:380
static bool classofKind(APIRecord::RecordKind K)
Definition API.h:323
void addToRecordChain(APIRecord *) const
Definition API.cpp:82
RecordContext(APIRecord::RecordKind Kind)
Definition API.h:330
static bool classof(const APIRecord *Record)
Definition API.h:320
void addTemplateParameter(std::string Type, std::string Name, unsigned int Index, unsigned int Depth, bool IsParameterPack)
Definition API.h:141
Template(const TemplateDecl *Decl)
Definition API.h:67
Template(const VarTemplatePartialSpecializationDecl *Decl)
Definition API.h:111
Template(const ClassTemplatePartialSpecializationDecl *Decl)
Definition API.h:89
const llvm::SmallVector< TemplateParameter > & getParameters() const
Definition API.h:133
const llvm::SmallVector< TemplateConstraint > & getConstraints() const
Definition API.h:137
bool empty() const
Definition API.h:147
std::vector< RawComment::CommentLine > DocComment
DocComment is a vector of RawComment::CommentLine.
Definition API.h:163
Top level wrappers for InstallAPI frontend operations.
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:909
@ Result
The result type of a method or function.
Definition TypeBase.h:906
@ Type
The name was classified as a type.
Definition Sema.h:559
llvm::PointerUnion< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
@ Other
Other implicit parameter.
Definition Decl.h:1774
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:197
RecordKind getKind() const
Definition API.h:286
APIRecord(RecordKind Kind, StringRef USR, StringRef Name)
Definition API.h:306
DocComment Comment
Documentation comment lines attached to this symbol declaration.
Definition API.h:256
AvailabilityInfo Availability
Definition API.h:252
DeclarationFragments Declaration
Declaration fragments of this symbol declaration.
Definition API.h:259
RecordKind getKindForDisplay() const
Definition API.h:287
RecordKind KindForDisplay
Definition API.h:274
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:294
DeclarationFragments SubHeading
SubHeading provides a more detailed representation than the plain declaration name.
Definition API.h:267
APIRecord * getNextInContext() const
Definition API.h:284
AccessControl Access
Definition API.h:272
static bool classofKind(RecordKind K)
Definition API.h:312
RecordKind
Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
Definition API.h:199
@ RK_GlobalFunctionTemplateSpecialization
Definition API.h:228
@ RK_GlobalVariableTemplatePartialSpecialization
Definition API.h:224
@ RK_GlobalVariableTemplateSpecialization
Definition API.h:223
static APIRecord * castFromRecordContext(const RecordContext *Ctx)
friend class RecordContext
Definition API.h:278
static RecordContext * castToRecordContext(const APIRecord *Record)
SymbolReference Parent
Definition API.h:249
static bool classof(const RecordContext *Ctx)
Definition API.h:313
bool IsFromSystemHeader
Whether the symbol was defined in a system header.
Definition API.h:270
static bool classof(const APIRecord *Record)
Definition API.h:311
SmallVector< SymbolReference > Bases
Definition API.h:1211
static bool classofKind(RecordKind K)
Definition API.h:1226
static bool classof(const APIRecord *Record)
Definition API.h:1223
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:1213
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:887
static bool classof(const APIRecord *Record)
Definition API.h:898
static bool classofKind(RecordKind K)
Definition API.h:901
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:908
static bool classofKind(RecordKind K)
Definition API.h:922
static bool classof(const APIRecord *Record)
Definition API.h:919
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:815
static bool classofKind(RecordKind K)
Definition API.h:839
static bool classof(const APIRecord *Record)
Definition API.h:836
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:825
static bool classof(const APIRecord *Record)
Definition API.h:861
static bool classofKind(RecordKind K)
Definition API.h:864
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:850
static bool classof(const APIRecord *Record)
Definition API.h:962
static bool classofKind(RecordKind K)
Definition API.h:965
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:950
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:872
FunctionSignature Signature
Definition API.h:868
static bool classofKind(RecordKind K)
Definition API.h:990
static bool classof(const APIRecord *Record)
Definition API.h:987
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:974
static bool classof(const APIRecord *Record)
Definition API.h:1005
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:994
static bool classof(const APIRecord *Record)
Definition API.h:940
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:929
static bool classofKind(RecordKind K)
Definition API.h:943
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:1276
static bool classof(const APIRecord *Record)
Definition API.h:1287
static bool classof(const APIRecord *Record)
Definition API.h:1250
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:1239
static bool classofKind(RecordKind K)
Definition API.h:1253
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:1257
static bool classof(const APIRecord *Record)
Definition API.h:1266
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:1298
static bool classof(const APIRecord *Record)
Definition API.h:1308
static bool classofKind(RecordKind K)
Definition API.h:1311
EnumConstantRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:596
static bool classofKind(RecordKind K)
Definition API.h:608
static bool classof(const APIRecord *Record)
Definition API.h:605
static bool classof(const APIRecord *Record)
Definition API.h:668
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:658
static bool classofKind(RecordKind K)
Definition API.h:672
static RecordContext * doCast(RecordContext *Ctx)
Definition API.h:1588
static ToTy * doCast(RecordContext *Ctx)
Definition API.h:1575
static bool isPossible(RecordContext *Ctx)
Definition API.h:1571
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:426
static bool classof(const APIRecord *Record)
Definition API.h:438
static bool classofKind(RecordKind K)
Definition API.h:441
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:415
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:450
static bool classofKind(RecordKind K)
Definition API.h:467
static bool classof(const APIRecord *Record)
Definition API.h:464
static bool classof(const APIRecord *Record)
Definition API.h:484
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:473
static bool classof(const APIRecord *Record)
Definition API.h:515
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:504
static bool classofKind(RecordKind K)
Definition API.h:518
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:494
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:574
static bool classof(const APIRecord *Record)
Definition API.h:543
static bool classofKind(RecordKind K)
Definition API.h:546
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:531
static bool classof(const APIRecord *Record)
Definition API.h:562
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:552
static bool classof(const APIRecord *Record)
Definition API.h:1403
static bool classofKind(RecordKind K)
Definition API.h:1406
MacroDefinitionRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1394
static bool classof(const APIRecord *Record)
Definition API.h:405
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:395
static bool classofKind(RecordKind K)
Definition API.h:408
static bool classofKind(RecordKind K)
Definition API.h:1333
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:1318
std::optional< StringRef > getExtendedExternalModule() const
Definition API.h:1337
static bool classof(const APIRecord *Record)
Definition API.h:1330
static bool classofKind(RecordKind K)
Definition API.h:1166
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:1153
static bool classof(const APIRecord *Record)
Definition API.h:1163
static bool classof(const APIRecord *Record)
Definition API.h:1081
static bool classofKind(RecordKind K)
Definition API.h:1084
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:1068
SmallVector< SymbolReference > Protocols
Definition API.h:1192
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:1196
static bool classofKind(RecordKind K)
Definition API.h:1146
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:1133
static bool classof(const APIRecord *Record)
Definition API.h:1143
static bool classof(const APIRecord *Record)
Definition API.h:1058
static bool classofKind(RecordKind K)
Definition API.h:1061
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:1047
static bool classofKind(RecordKind K)
Definition API.h:1106
ObjCInstanceVariableRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1092
static bool classof(const APIRecord *Record)
Definition API.h:1103
static bool classof(const APIRecord *Record)
Definition API.h:1362
static bool classofKind(RecordKind K)
Definition API.h:1365
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:1351
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:1118
FunctionSignature Signature
Definition API.h:1114
AttributeKind
The attributes associated with an Objective-C property.
Definition API.h:1016
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:1027
static bool classof(const APIRecord *Record)
Definition API.h:1383
static bool classofKind(RecordKind K)
Definition API.h:1386
ObjCProtocolRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:1373
std::forward_iterator_tag iterator_category
Definition API.h:348
friend bool operator==(record_iterator x, record_iterator y)
Definition API.h:367
friend bool operator!=(record_iterator x, record_iterator y)
Definition API.h:370
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:680
static bool classofKind(RecordKind K)
Definition API.h:693
static bool classof(const APIRecord *Record)
Definition API.h:690
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:702
static bool classof(const APIRecord *Record)
Definition API.h:713
static bool classofKind(RecordKind K)
Definition API.h:716
static bool classof(const APIRecord *Record)
Definition API.h:1183
static bool classofKind(RecordKind K)
Definition API.h:1186
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:1173
static bool classof(const APIRecord *Record)
Definition API.h:749
static bool classofKind(RecordKind K)
Definition API.h:752
StructFieldRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:741
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:759
static bool classof(const APIRecord *Record)
Definition API.h:768
static bool classofKind(RecordKind K)
Definition API.h:771
bool empty() const
Determine if this SymbolReference is empty.
Definition API.h:187
SymbolReference(StringRef Name, StringRef USR, StringRef Source="")
Definition API.h:180
StringRef Source
The source project/module/product of the referred symbol.
Definition API.h:174
const APIRecord * Record
Definition API.h:177
static bool classof(const APIRecord *Record)
Definition API.h:627
static bool classofKind(RecordKind K)
Definition API.h:630
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:615
static RecordContext * doCast(FromTy *From)
Definition API.h:1547
static bool classofKind(RecordKind K)
Definition API.h:1433
SymbolReference UnderlyingType
Definition API.h:1418
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:1420
static bool classof(const APIRecord *Record)
Definition API.h:1430
static bool classofKind(RecordKind K)
Definition API.h:789
static bool classof(const APIRecord *Record)
Definition API.h:786
UnionFieldRecord(StringRef USR, StringRef Name, SymbolReference Parent, PresumedLoc Loc, AvailabilityInfo Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition API.h:778
static bool classof(const APIRecord *Record)
Definition API.h:805
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:796
static bool classofKind(RecordKind K)
Definition API.h:808
static ToTy * doCast(::clang::extractapi::RecordContext *Ctx)
Definition API.h:1634
static bool isPossible(::clang::extractapi::RecordContext *Ctx)
Definition API.h:1629
static inline ::clang::extractapi::RecordContext * doCast(FromTy *From)
Definition API.h:1611