clang 18.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
21#include "clang/AST/Decl.h"
22#include "clang/AST/DeclObjC.h"
28#include "llvm/ADT/MapVector.h"
29#include "llvm/ADT/StringRef.h"
30#include "llvm/Support/Allocator.h"
31#include "llvm/Support/Casting.h"
32#include "llvm/TargetParser/Triple.h"
33#include <memory>
34#include <type_traits>
35
36namespace clang {
37namespace extractapi {
38
39class Template {
40 struct TemplateParameter {
41 // "class", "typename", or concept name
42 std::string Type;
43 std::string Name;
44 unsigned int Index;
45 unsigned int Depth;
46 bool IsParameterPack;
47
48 TemplateParameter(std::string Type, std::string Name, unsigned int Index,
49 unsigned int Depth, bool IsParameterPack)
50 : Type(Type), Name(Name), Index(Index), Depth(Depth),
51 IsParameterPack(IsParameterPack) {}
52 };
53
54 struct TemplateConstraint {
55 // type name of the constraint, if it has one
56 std::string Type;
57 std::string Kind;
58 std::string LHS, RHS;
59 };
62
63public:
64 Template() = default;
65
67 for (auto *const Parameter : *Decl->getTemplateParameters()) {
68 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
69 if (!Param) // some params are null
70 continue;
71 std::string Type;
72 if (Param->hasTypeConstraint())
73 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
74 else if (Param->wasDeclaredWithTypename())
75 Type = "typename";
76 else
77 Type = "class";
78
79 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
80 Param->getDepth(), Param->isParameterPack());
81 }
82 }
83
85 for (auto *const Parameter : *Decl->getTemplateParameters()) {
86 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
87 if (!Param) // some params are null
88 continue;
89 std::string Type;
90 if (Param->hasTypeConstraint())
91 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
92 else if (Param->wasDeclaredWithTypename())
93 Type = "typename";
94 else
95 Type = "class";
96
97 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
98 Param->getDepth(), Param->isParameterPack());
99 }
100 }
101
103 for (auto *const Parameter : *Decl->getTemplateParameters()) {
104 const auto *Param = dyn_cast<TemplateTypeParmDecl>(Parameter);
105 if (!Param) // some params are null
106 continue;
107 std::string Type;
108 if (Param->hasTypeConstraint())
109 Type = Param->getTypeConstraint()->getNamedConcept()->getName().str();
110 else if (Param->wasDeclaredWithTypename())
111 Type = "typename";
112 else
113 Type = "class";
114
115 addTemplateParameter(Type, Param->getName().str(), Param->getIndex(),
116 Param->getDepth(), Param->isParameterPack());
117 }
118 }
119
121 return Parameters;
122 }
123
125 return Constraints;
126 }
127
128 void addTemplateParameter(std::string Type, std::string Name,
129 unsigned int Index, unsigned int Depth,
130 bool IsParameterPack) {
131 Parameters.emplace_back(Type, Name, Index, Depth, IsParameterPack);
132 }
133
134 bool empty() const { return Parameters.empty() && Constraints.empty(); }
135};
136
137/// DocComment is a vector of RawComment::CommentLine.
138///
139/// Each line represents one line of striped documentation comment,
140/// with source range information. This simplifies calculating the source
141/// location of a character in the doc comment for pointing back to the source
142/// file.
143/// e.g.
144/// \code
145/// /// This is a documentation comment
146/// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' First line.
147/// /// with multiple lines.
148/// ^~~~~~~~~~~~~~~~~~~~~~~' Second line.
149/// \endcode
150using DocComment = std::vector<RawComment::CommentLine>;
151
152// Classes deriving from APIRecord need to have USR be the first constructor
153// argument. This is so that they are compatible with `addTopLevelRecord`
154// defined in API.cpp
155/// The base representation of an API record. Holds common symbol information.
156struct APIRecord {
157 /// Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
198 };
199
200 /// Stores information about the context of the declaration of this API.
201 /// This is roughly analogous to the DeclContext hierarchy for an AST Node.
203 /// The USR of the parent API.
204 StringRef ParentUSR;
205 /// The name of the parent API.
206 StringRef ParentName;
207 /// The record kind of the parent API.
209 /// A pointer to the parent APIRecord if known.
211
214 RecordKind Kind, APIRecord *ParentRecord = nullptr)
217
218 bool empty() const {
219 return ParentUSR.empty() && ParentName.empty() &&
220 ParentKind == RK_Unknown && ParentRecord == nullptr;
221 }
222 };
223
224 StringRef USR;
225 StringRef Name;
229
230 /// Documentation comment lines attached to this symbol declaration.
232
233 /// Declaration fragments of this symbol declaration.
235
236 /// SubHeading provides a more detailed representation than the plain
237 /// declaration name.
238 ///
239 /// SubHeading is an array of declaration fragments of tagged declaration
240 /// name, with potentially more tokens (for example the \c +/- symbol for
241 /// Objective-C class/instance methods).
243
244 /// Information about the parent record of this record.
246
247 /// Whether the symbol was defined in a system header.
249
250private:
251 const RecordKind Kind;
252
253public:
254 RecordKind getKind() const { return Kind; }
255
256 APIRecord() = delete;
257
258 APIRecord(RecordKind Kind, StringRef USR, StringRef Name,
267
268 APIRecord(RecordKind Kind, StringRef USR, StringRef Name)
269 : USR(USR), Name(Name), Kind(Kind) {}
270
271 // Pure virtual destructor to make APIRecord abstract
272 virtual ~APIRecord() = 0;
273};
274
276 NamespaceRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
283
284 static bool classof(const APIRecord *Record) {
285 return Record->getKind() == RK_Namespace;
286 }
287};
288
289/// This holds information associated with global functions.
292
293 GlobalFunctionRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
295 const DocComment &Comment,
303
304 GlobalFunctionRecord(RecordKind Kind, StringRef USR, StringRef Name,
310 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities), Linkage,
313
314 static bool classof(const APIRecord *Record) {
315 return Record->getKind() == RK_GlobalFunction;
316 }
317
318private:
319 virtual void anchor();
320};
321
324
336 Templ(Template) {}
337
338 static bool classof(const APIRecord *Record) {
339 return Record->getKind() == RK_GlobalFunctionTemplate;
340 }
341};
342
345 StringRef USR, StringRef Name, PresumedLoc Loc,
351 Loc, std::move(Availabilities), Linkage, Comment,
354
355 static bool classof(const APIRecord *Record) {
356 return Record->getKind() == RK_GlobalFunctionTemplateSpecialization;
357 }
358};
359
360/// This holds information associated with global functions.
362 GlobalVariableRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
364 const DocComment &Comment,
370
371 GlobalVariableRecord(RecordKind Kind, StringRef USR, StringRef Name,
376 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities), Linkage,
378
379 static bool classof(const APIRecord *Record) {
380 return Record->getKind() == RK_GlobalVariable;
381 }
382
383private:
384 virtual void anchor();
385};
386
389
399 Templ(Template) {}
400
401 static bool classof(const APIRecord *Record) {
402 return Record->getKind() == RK_GlobalVariableTemplate;
403 }
404};
405
408 StringRef USR, StringRef Name, PresumedLoc Loc,
413 Loc, std::move(Availabilities), Linkage, Comment,
415
416 static bool classof(const APIRecord *Record) {
417 return Record->getKind() == RK_GlobalVariableTemplateSpecialization;
418 }
419};
420
424
426 StringRef USR, StringRef Name, PresumedLoc Loc,
432 USR, Name, Loc, std::move(Availabilities), Linkage,
435 Templ(Template) {}
436
437 static bool classof(const APIRecord *Record) {
438 return Record->getKind() == RK_GlobalVariableTemplatePartialSpecialization;
439 }
440};
441
442/// This holds information associated with enum constants.
444 EnumConstantRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
451
452 static bool classof(const APIRecord *Record) {
453 return Record->getKind() == RK_EnumConstant;
454 }
455
456private:
457 virtual void anchor();
458};
459
460/// This holds information associated with enums.
463
464 EnumRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
468 : APIRecord(RK_Enum, USR, Name, Loc, std::move(Availabilities),
471
472 static bool classof(const APIRecord *Record) {
473 return Record->getKind() == RK_Enum;
474 }
475
476private:
477 virtual void anchor();
478};
479
480/// This holds information associated with struct fields.
482 StructFieldRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
489
490 static bool classof(const APIRecord *Record) {
491 return Record->getKind() == RK_StructField;
492 }
493
494private:
495 virtual void anchor();
496};
497
498/// This holds information associated with structs.
501
502 StructRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
506 : APIRecord(RK_Struct, USR, Name, Loc, std::move(Availabilities),
509
510 static bool classof(const APIRecord *Record) {
511 return Record->getKind() == RK_Struct;
512 }
513
514private:
515 virtual void anchor();
516};
517
520
521 CXXFieldRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
529 Access(Access) {}
530
531 CXXFieldRecord(RecordKind Kind, StringRef USR, StringRef Name,
536 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
539 Access(Access) {}
540
541 static bool classof(const APIRecord *Record) {
542 return Record->getKind() == RK_CXXField;
543 }
544
545private:
546 virtual void anchor();
547};
548
551
552 CXXFieldTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
554 const DocComment &Comment,
561 Templ(Template) {}
562
563 static bool classof(const APIRecord *Record) {
564 return Record->getKind() == RK_CXXFieldTemplate;
565 }
566};
567
571
572 CXXMethodRecord() = delete;
573
574 CXXMethodRecord(RecordKind Kind, StringRef USR, StringRef Name,
579 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
583
584 virtual ~CXXMethodRecord() = 0;
585};
586
588 CXXConstructorRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
590 const DocComment &Comment,
598 static bool classof(const APIRecord *Record) {
599 return Record->getKind() == RK_CXXConstructorMethod;
600 }
601
602private:
603 virtual void anchor();
604};
605
607 CXXDestructorRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
616 static bool classof(const APIRecord *Record) {
617 return Record->getKind() == RK_CXXDestructorMethod;
618 }
619
620private:
621 virtual void anchor();
622};
623
625 CXXStaticMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
627 const DocComment &Comment,
635 static bool classof(const APIRecord *Record) {
636 return Record->getKind() == RK_CXXStaticMethod;
637 }
638
639private:
640 virtual void anchor();
641};
642
644 CXXInstanceMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
646 const DocComment &Comment,
654
655 static bool classof(const APIRecord *Record) {
656 return Record->getKind() == RK_CXXInstanceMethod;
657 }
658
659private:
660 virtual void anchor();
661};
662
665
666 CXXMethodTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
668 const DocComment &Comment,
676 Templ(Template) {}
677
678 static bool classof(const APIRecord *Record) {
679 return Record->getKind() == RK_CXXMethodTemplate;
680 }
681};
682
685 StringRef USR, StringRef Name, PresumedLoc Loc,
693
694 static bool classof(const APIRecord *Record) {
695 return Record->getKind() == RK_CXXMethodTemplateSpecialization;
696 }
697};
698
699/// This holds information associated with Objective-C properties.
701 /// The attributes associated with an Objective-C property.
702 enum AttributeKind : unsigned {
705 Dynamic = 1 << 2,
706 };
707
709 StringRef GetterName;
710 StringRef SetterName;
712
713 ObjCPropertyRecord(RecordKind Kind, StringRef USR, StringRef Name,
715 const DocComment &Comment,
718 StringRef GetterName, StringRef SetterName,
720 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
725
726 bool isReadOnly() const { return Attributes & ReadOnly; }
727 bool isDynamic() const { return Attributes & Dynamic; }
728
729 virtual ~ObjCPropertyRecord() = 0;
730};
731
735 const DocComment &Comment,
739 StringRef SetterName, bool IsOptional,
745
746 static bool classof(const APIRecord *Record) {
747 return Record->getKind() == RK_ObjCInstanceProperty;
748 }
749
750private:
751 virtual void anchor();
752};
753
755 ObjCClassPropertyRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
757 const DocComment &Comment,
761 StringRef SetterName, bool IsOptional,
767
768 static bool classof(const APIRecord *Record) {
769 return Record->getKind() == RK_ObjCClassProperty;
770 }
771
772private:
773 virtual void anchor();
774};
775
776/// This holds information associated with Objective-C instance variables.
780
783 const DocComment &Comment,
790 Access(Access) {}
791
792 static bool classof(const APIRecord *Record) {
793 return Record->getKind() == RK_ObjCIvar;
794 }
795
796private:
797 virtual void anchor();
798};
799
800/// This holds information associated with Objective-C methods.
803
805
806 ObjCMethodRecord(RecordKind Kind, StringRef USR, StringRef Name,
811 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
815
816 virtual ~ObjCMethodRecord() = 0;
817};
818
820 ObjCInstanceMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
822 const DocComment &Comment,
829 static bool classof(const APIRecord *Record) {
830 return Record->getKind() == RK_ObjCInstanceMethod;
831 }
832
833private:
834 virtual void anchor();
835};
836
838 ObjCClassMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
840 const DocComment &Comment,
847
848 static bool classof(const APIRecord *Record) {
849 return Record->getKind() == RK_ObjCClassMethod;
850 }
851
852private:
853 virtual void anchor();
854};
855
856/// This represents a reference to another symbol that might come from external
857/// sources.
859 StringRef Name;
860 StringRef USR;
861
862 /// The source project/module/product of the referred symbol.
863 StringRef Source;
864
865 SymbolReference() = default;
866 SymbolReference(StringRef Name, StringRef USR = "", StringRef Source = "")
867 : Name(Name), USR(USR), Source(Source) {}
869 : Name(Record.Name), USR(Record.USR) {}
871 : Name(Record->Name), USR(Record->USR) {}
872
873 /// Determine if this SymbolReference is empty.
874 ///
875 /// \returns true if and only if all \c Name, \c USR, and \c Source is empty.
876 bool empty() const { return Name.empty() && USR.empty() && Source.empty(); }
877};
878
881
882 StaticFieldRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
890 Context(Context) {}
891
892 static bool classof(const APIRecord *Record) {
893 return Record->getKind() == RK_StaticField;
894 }
895};
896
897/// The base representation of an Objective-C container record. Holds common
898/// information associated with Objective-C containers.
904
906
907 ObjCContainerRecord(RecordKind Kind, StringRef USR, StringRef Name,
912 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities), Linkage,
914
915 virtual ~ObjCContainerRecord() = 0;
916};
917
923
924 CXXClassRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
929 : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
932 Access(Access) {}
933
934 static bool classof(const APIRecord *Record) {
935 return (Record->getKind() == RK_CXXClass);
936 }
937
938private:
939 virtual void anchor();
940};
941
944
945 ClassTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
953 Templ(Template) {}
954
955 static bool classof(const APIRecord *Record) {
956 return Record->getKind() == RK_ClassTemplate;
957 }
958};
959
962 StringRef USR, StringRef Name, PresumedLoc Loc,
969
970 static bool classof(const APIRecord *Record) {
971 return Record->getKind() == RK_ClassTemplateSpecialization;
972 }
973};
974
978 StringRef USR, StringRef Name, PresumedLoc Loc,
985 Templ(Template) {}
986
987 static bool classof(const APIRecord *Record) {
988 return Record->getKind() == RK_ClassTemplatePartialSpecialization;
989 }
990};
991
994
995 ConceptRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
1000 : APIRecord(RK_Concept, USR, Name, Loc, std::move(Availabilities),
1003 Templ(Template) {}
1004};
1005
1006/// This holds information associated with Objective-C categories.
1009 /// Determine whether the Category is derived from external class interface.
1011
1012 ObjCCategoryRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
1016 bool IsFromSystemHeader)
1018 std::move(Availabilities), LinkageInfo::none(),
1022
1023 static bool classof(const APIRecord *Record) {
1024 return Record->getKind() == RK_ObjCCategory;
1025 }
1026
1027private:
1028 virtual void anchor();
1029};
1030
1031/// This holds information associated with Objective-C interfaces/classes.
1034 // ObjCCategoryRecord%s are stored in and owned by APISet.
1036
1037 ObjCInterfaceRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
1039 const DocComment &Comment,
1047
1048 static bool classof(const APIRecord *Record) {
1049 return Record->getKind() == RK_ObjCInterface;
1050 }
1051
1052private:
1053 virtual void anchor();
1054};
1055
1056/// This holds information associated with Objective-C protocols.
1058 ObjCProtocolRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
1063 std::move(Availabilities), LinkageInfo::none(),
1066
1067 static bool classof(const APIRecord *Record) {
1068 return Record->getKind() == RK_ObjCProtocol;
1069 }
1070
1071private:
1072 virtual void anchor();
1073};
1074
1075/// This holds information associated with macro definitions.
1077 MacroDefinitionRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
1080 bool IsFromSystemHeader)
1084
1085 static bool classof(const APIRecord *Record) {
1086 return Record->getKind() == RK_MacroDefinition;
1087 }
1088
1089private:
1090 virtual void anchor();
1091};
1092
1093/// This holds information associated with typedefs.
1094///
1095/// Note: Typedefs for anonymous enums and structs typically don't get emitted
1096/// by the serializers but still get a TypedefRecord. Instead we use the
1097/// typedef name as a name for the underlying anonymous struct or enum.
1100
1101 TypedefRecord(StringRef USR, StringRef Name, PresumedLoc Loc,
1105 bool IsFromSystemHeader)
1106 : APIRecord(RK_Typedef, USR, Name, Loc, std::move(Availabilities),
1110
1111 static bool classof(const APIRecord *Record) {
1112 return Record->getKind() == RK_Typedef;
1113 }
1114
1115private:
1116 virtual void anchor();
1117};
1118
1119/// Check if a record type has a function signature mixin.
1120///
1121/// This is denoted by the record type having a ``Signature`` field of type
1122/// FunctionSignature.
1123template <typename RecordTy>
1124struct has_function_signature : public std::false_type {};
1125template <>
1126struct has_function_signature<GlobalFunctionRecord> : public std::true_type {};
1127template <>
1128struct has_function_signature<ObjCMethodRecord> : public std::true_type {};
1129template <>
1131 : public std::true_type {};
1132template <>
1133struct has_function_signature<ObjCClassMethodRecord> : public std::true_type {};
1134template <>
1135struct has_function_signature<CXXInstanceMethodRecord> : public std::true_type {};
1136template <>
1137struct has_function_signature<CXXStaticMethodRecord> : public std::true_type {};
1138template <>
1139struct has_function_signature<CXXMethodTemplateRecord> : public std::true_type {
1140};
1141template <>
1143 : public std::true_type {};
1144
1145template <typename RecordTy> struct has_access : public std::false_type {};
1146template <> struct has_access<CXXInstanceMethodRecord> : public std::true_type {};
1147template <> struct has_access<CXXStaticMethodRecord> : public std::true_type {};
1148template <> struct has_access<CXXFieldRecord> : public std::true_type {};
1149template <>
1150struct has_access<CXXMethodTemplateRecord> : public std::true_type {};
1151template <>
1153 : public std::true_type {};
1154template <>
1155struct has_access<CXXFieldTemplateRecord> : public std::true_type {};
1156template <> struct has_access<CXXClassRecord> : public std::true_type {};
1157template <> struct has_access<ClassTemplateRecord> : public std::true_type {};
1158template <>
1159struct has_access<ClassTemplateSpecializationRecord> : public std::true_type {};
1160template <>
1162 : public std::true_type {};
1163
1164template <typename RecordTy> struct has_template : public std::false_type {};
1165template <> struct has_template<ClassTemplateRecord> : public std::true_type {};
1166template <>
1168 : public std::true_type {};
1169template <> struct has_template<ConceptRecord> : public std::true_type {};
1170template <>
1171struct has_template<GlobalVariableTemplateRecord> : public std::true_type {};
1172template <>
1174 : public std::true_type {};
1175template <>
1176struct has_template<CXXMethodTemplateRecord> : public std::true_type {};
1177template <>
1178struct has_template<CXXFieldTemplateRecord> : public std::true_type {};
1179
1180template <>
1181struct has_template<GlobalFunctionTemplateRecord> : public std::true_type {};
1182template <>
1184 : public std::true_type {};
1185template <>
1187 : public std::true_type {};
1188
1189/// APISet holds the set of API records collected from given inputs.
1190class APISet {
1191public:
1192 NamespaceRecord *addNamespace(APIRecord *Parent, StringRef Name,
1193 StringRef USR, PresumedLoc Loc,
1194 AvailabilitySet Availability,
1195 LinkageInfo Linkage, const DocComment &Comment,
1197 DeclarationFragments SubHeading,
1198 bool IsFromSystemHeaderg);
1199 /// Create and add a global variable record into the API set.
1200 ///
1201 /// Note: the caller is responsible for keeping the StringRef \p Name and
1202 /// \p USR alive. APISet::copyString provides a way to copy strings into
1203 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1204 /// to generate the USR for \c D and keep it alive in APISet.
1206 addGlobalVar(StringRef Name, StringRef USR, PresumedLoc Loc,
1207 AvailabilitySet Availability, LinkageInfo Linkage,
1209 DeclarationFragments SubHeadin, bool IsFromSystemHeaderg);
1210
1212 addGlobalVariableTemplate(StringRef Name, StringRef USR, PresumedLoc Loc,
1213 AvailabilitySet Availability, LinkageInfo Linkage,
1214 const DocComment &Comment,
1217 bool IsFromSystemHeader);
1218
1219 /// Create and add a function record into the API set.
1220 ///
1221 /// Note: the caller is responsible for keeping the StringRef \p Name and
1222 /// \p USR alive. APISet::copyString provides a way to copy strings into
1223 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1224 /// to generate the USR for \c D and keep it alive in APISet.
1226 addGlobalFunction(StringRef Name, StringRef USR, PresumedLoc Loc,
1227 AvailabilitySet Availability, LinkageInfo Linkage,
1229 DeclarationFragments SubHeading,
1230 FunctionSignature Signature, bool IsFromSystemHeader);
1231
1233 StringRef Name, StringRef USR, PresumedLoc Loc,
1234 AvailabilitySet Availability, LinkageInfo Linkage,
1236 DeclarationFragments SubHeading, FunctionSignature Signature,
1237 Template Template, bool IsFromSystemHeader);
1238
1241 StringRef Name, StringRef USR, PresumedLoc Loc,
1242 AvailabilitySet Availability, LinkageInfo Linkage,
1244 DeclarationFragments SubHeading, FunctionSignature Signature,
1245 bool IsFromSystemHeader);
1246
1247 /// Create and add an enum constant record into the API set.
1248 ///
1249 /// Note: the caller is responsible for keeping the StringRef \p Name and
1250 /// \p USR alive. APISet::copyString provides a way to copy strings into
1251 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1252 /// to generate the USR for \c D and keep it alive in APISet.
1254 addEnumConstant(EnumRecord *Enum, StringRef Name, StringRef USR,
1255 PresumedLoc Loc, AvailabilitySet Availability,
1257 DeclarationFragments SubHeading, bool IsFromSystemHeader);
1258
1259 /// Create and add an enum record into the API set.
1260 ///
1261 /// Note: the caller is responsible for keeping the StringRef \p Name and
1262 /// \p USR alive. APISet::copyString provides a way to copy strings into
1263 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1264 /// to generate the USR for \c D and keep it alive in APISet.
1265 EnumRecord *addEnum(StringRef Name, StringRef USR, PresumedLoc Loc,
1266 AvailabilitySet Availability, const DocComment &Comment,
1268 DeclarationFragments SubHeading, bool IsFromSystemHeader);
1269
1270 /// Create and add a struct field record into the API set.
1271 ///
1272 /// Note: the caller is responsible for keeping the StringRef \p Name and
1273 /// \p USR alive. APISet::copyString provides a way to copy strings into
1274 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1275 /// to generate the USR for \c D and keep it alive in APISet.
1277 addStructField(StructRecord *Struct, StringRef Name, StringRef USR,
1278 PresumedLoc Loc, AvailabilitySet Availability,
1280 DeclarationFragments SubHeading, bool IsFromSystemHeader);
1281
1282 /// Create and add a struct record into the API set.
1283 ///
1284 /// Note: the caller is responsible for keeping the StringRef \p Name and
1285 /// \p USR alive. APISet::copyString provides a way to copy strings into
1286 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1287 /// to generate the USR for \c D and keep it alive in APISet.
1288 StructRecord *addStruct(StringRef Name, StringRef USR, PresumedLoc Loc,
1289 AvailabilitySet Availability,
1290 const DocComment &Comment,
1292 DeclarationFragments SubHeading,
1293 bool IsFromSystemHeader);
1294
1296 addStaticField(StringRef Name, StringRef USR, PresumedLoc Loc,
1297 AvailabilitySet Availabilities, LinkageInfo Linkage,
1299 DeclarationFragments SubHeading, SymbolReference Context,
1300 AccessControl Access, bool IsFromSystemHeaderg);
1301
1302 CXXFieldRecord *addCXXField(APIRecord *CXXClass, StringRef Name,
1303 StringRef USR, PresumedLoc Loc,
1304 AvailabilitySet Availabilities,
1305 const DocComment &Comment,
1307 DeclarationFragments SubHeading,
1308 AccessControl Access, bool IsFromSystemHeader);
1309
1311 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1312 AvailabilitySet Availability, const DocComment &Comment,
1314 AccessControl Access, Template Template, bool IsFromSystemHeader);
1315
1316 CXXClassRecord *addCXXClass(APIRecord *Parent, StringRef Name, StringRef USR,
1317 PresumedLoc Loc, AvailabilitySet Availability,
1318 const DocComment &Comment,
1320 DeclarationFragments SubHeading,
1322 bool IsFromSystemHeader);
1323
1325 addClassTemplate(APIRecord *Parent, StringRef Name, StringRef USR,
1326 PresumedLoc Loc, AvailabilitySet Availability,
1329 AccessControl Access, bool IsFromSystemHeader);
1330
1332 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1333 AvailabilitySet Availability, const DocComment &Comment,
1335 AccessControl Access, bool IsFromSystemHeader);
1336
1339 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1340 AvailabilitySet Availability, const DocComment &Comment,
1342 Template Template, AccessControl Access, bool IsFromSystemHeader);
1343
1346 StringRef Name, StringRef USR, PresumedLoc Loc,
1347 AvailabilitySet Availability, LinkageInfo Linkage,
1349 DeclarationFragments SubHeading, bool IsFromSystemHeader);
1350
1353 StringRef Name, StringRef USR, PresumedLoc Loc,
1354 AvailabilitySet Availability, LinkageInfo Linkage,
1357 bool IsFromSystemHeader);
1358
1360 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1361 AvailabilitySet Availability, const DocComment &Comment,
1363 FunctionSignature Signature, AccessControl Access,
1364 bool IsFromSystemHeader);
1365
1367 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1368 AvailabilitySet Availability, const DocComment &Comment,
1370 FunctionSignature Signature, AccessControl Access,
1371 bool IsFromSystemHeader);
1372
1374 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1375 AvailabilitySet Availability, const DocComment &Comment,
1377 FunctionSignature Signature, AccessControl Access,
1378 bool IsFromSystemHeader);
1379
1381 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1382 AvailabilitySet Availability, const DocComment &Comment,
1385 bool IsFromSystemHeader);
1386
1388 APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc,
1389 AvailabilitySet Availability, const DocComment &Comment,
1391 FunctionSignature Signature, AccessControl Access,
1392 bool IsFromSystemHeader);
1393
1394 ConceptRecord *addConcept(StringRef Name, StringRef USR, PresumedLoc Loc,
1395 AvailabilitySet Availability,
1396 const DocComment &Comment,
1399 bool IsFromSystemHeader);
1400
1401 /// Create and add an Objective-C category record into the API set.
1402 ///
1403 /// Note: the caller is responsible for keeping the StringRef \p Name and
1404 /// \p USR alive. APISet::copyString provides a way to copy strings into
1405 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1406 /// to generate the USR for \c D and keep it alive in APISet.
1408 addObjCCategory(StringRef Name, StringRef USR, PresumedLoc Loc,
1409 AvailabilitySet Availability, const DocComment &Comment,
1412 bool IsFromSystemHeader, bool IsFromExternalModule);
1413
1414 /// Create and add an Objective-C interface record into the API set.
1415 ///
1416 /// Note: the caller is responsible for keeping the StringRef \p Name and
1417 /// \p USR alive. APISet::copyString provides a way to copy strings into
1418 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1419 /// to generate the USR for \c D and keep it alive in APISet.
1421 addObjCInterface(StringRef Name, StringRef USR, PresumedLoc Loc,
1422 AvailabilitySet Availability, LinkageInfo Linkage,
1424 DeclarationFragments SubHeading, SymbolReference SuperClass,
1425 bool IsFromSystemHeader);
1426
1427 /// Create and add an Objective-C method record into the API set.
1428 ///
1429 /// Note: the caller is responsible for keeping the StringRef \p Name and
1430 /// \p USR alive. APISet::copyString provides a way to copy strings into
1431 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1432 /// to generate the USR for \c D and keep it alive in APISet.
1434 addObjCMethod(ObjCContainerRecord *Container, StringRef Name, StringRef USR,
1435 PresumedLoc Loc, AvailabilitySet Availability,
1437 DeclarationFragments SubHeading, FunctionSignature Signature,
1438 bool IsInstanceMethod, bool IsFromSystemHeader);
1439
1440 /// Create and add an Objective-C property record into the API set.
1441 ///
1442 /// Note: the caller is responsible for keeping the StringRef \p Name and
1443 /// \p USR alive. APISet::copyString provides a way to copy strings into
1444 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1445 /// to generate the USR for \c D and keep it alive in APISet.
1447 addObjCProperty(ObjCContainerRecord *Container, StringRef Name, StringRef USR,
1448 PresumedLoc Loc, AvailabilitySet Availability,
1450 DeclarationFragments SubHeading,
1452 StringRef GetterName, StringRef SetterName, bool IsOptional,
1453 bool IsInstanceProperty, bool IsFromSystemHeader);
1454
1455 /// Create and add an Objective-C instance variable record into the API set.
1456 ///
1457 /// Note: the caller is responsible for keeping the StringRef \p Name and
1458 /// \p USR alive. APISet::copyString provides a way to copy strings into
1459 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1460 /// to generate the USR for \c D and keep it alive in APISet.
1462 ObjCContainerRecord *Container, StringRef Name, StringRef USR,
1463 PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment,
1466 bool IsFromSystemHeader);
1467
1468 /// Create and add an Objective-C protocol record into the API set.
1469 ///
1470 /// Note: the caller is responsible for keeping the StringRef \p Name and
1471 /// \p USR alive. APISet::copyString provides a way to copy strings into
1472 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1473 /// to generate the USR for \c D and keep it alive in APISet.
1475 addObjCProtocol(StringRef Name, StringRef USR, PresumedLoc Loc,
1476 AvailabilitySet Availability, const DocComment &Comment,
1478 DeclarationFragments SubHeading, bool IsFromSystemHeader);
1479
1480 /// Create a macro definition record into the API set.
1481 ///
1482 /// Note: the caller is responsible for keeping the StringRef \p Name and
1483 /// \p USR alive. APISet::copyString provides a way to copy strings into
1484 /// APISet itself, and APISet::recordUSRForMacro(StringRef Name,
1485 /// SourceLocation SL, const SourceManager &SM) is a helper method to generate
1486 /// the USR for the macro and keep it alive in APISet.
1487 MacroDefinitionRecord *addMacroDefinition(StringRef Name, StringRef USR,
1488 PresumedLoc Loc,
1490 DeclarationFragments SubHeading,
1491 bool IsFromSystemHeader);
1492
1493 /// Create a typedef record into the API set.
1494 ///
1495 /// Note: the caller is responsible for keeping the StringRef \p Name and
1496 /// \p USR alive. APISet::copyString provides a way to copy strings into
1497 /// APISet itself, and APISet::recordUSR(const Decl *D) is a helper method
1498 /// to generate the USR for \c D and keep it alive in APISet.
1500 addTypedef(StringRef Name, StringRef USR, PresumedLoc Loc,
1501 AvailabilitySet Availability, const DocComment &Comment,
1503 SymbolReference UnderlyingType, bool IsFromSystemHeader);
1504
1505 /// A mapping type to store a set of APIRecord%s with the USR as the key.
1506 template <typename RecordTy,
1507 typename =
1508 std::enable_if_t<std::is_base_of<APIRecord, RecordTy>::value>>
1509 using RecordMap = llvm::MapVector<StringRef, std::unique_ptr<RecordTy>>;
1510
1511 /// Get the target triple for the ExtractAPI invocation.
1512 const llvm::Triple &getTarget() const { return Target; }
1513
1514 /// Get the language used by the APIs.
1515 Language getLanguage() const { return Lang; }
1516
1517 const RecordMap<NamespaceRecord> &getNamespaces() const { return Namespaces; }
1519 return GlobalFunctions;
1520 }
1521 const RecordMap<GlobalFunctionTemplateRecord> &
1523 return GlobalFunctionTemplates;
1524 }
1525 const RecordMap<GlobalFunctionTemplateSpecializationRecord> &
1527 return GlobalFunctionTemplateSpecializations;
1528 }
1530 return GlobalVariables;
1531 }
1532 const RecordMap<GlobalVariableTemplateRecord> &
1534 return GlobalVariableTemplates;
1535 }
1537 return StaticFields;
1538 }
1539 const RecordMap<GlobalVariableTemplateSpecializationRecord> &
1541 return GlobalVariableTemplateSpecializations;
1542 }
1543 const RecordMap<GlobalVariableTemplatePartialSpecializationRecord> &
1545 return GlobalVariableTemplatePartialSpecializations;
1546 }
1547 const RecordMap<EnumRecord> &getEnums() const { return Enums; }
1548 const RecordMap<StructRecord> &getStructs() const { return Structs; }
1549 const RecordMap<CXXClassRecord> &getCXXClasses() const { return CXXClasses; }
1551 return CXXMethodTemplates;
1552 }
1554 return CXXInstanceMethods;
1555 }
1557 return CXXStaticMethods;
1558 }
1559 const RecordMap<CXXFieldRecord> &getCXXFields() const { return CXXFields; }
1560 const RecordMap<CXXMethodTemplateSpecializationRecord> &
1562 return CXXMethodTemplateSpecializations;
1563 }
1565 return CXXFieldTemplates;
1566 }
1567 const RecordMap<ConceptRecord> &getConcepts() const { return Concepts; }
1569 return ClassTemplates;
1570 }
1571 const RecordMap<ClassTemplateSpecializationRecord> &
1573 return ClassTemplateSpecializations;
1574 }
1575 const RecordMap<ClassTemplatePartialSpecializationRecord> &
1577 return ClassTemplatePartialSpecializations;
1578 }
1579 const RecordMap<ConceptRecord> &getRecords() const { return Concepts; }
1581 return ObjCCategories;
1582 }
1584 return ObjCInterfaces;
1585 }
1587 return ObjCProtocols;
1588 }
1589 const RecordMap<MacroDefinitionRecord> &getMacros() const { return Macros; }
1590 const RecordMap<TypedefRecord> &getTypedefs() const { return Typedefs; }
1591
1592 /// Finds the APIRecord for a given USR.
1593 ///
1594 /// \returns a pointer to the APIRecord associated with that USR or nullptr.
1595 APIRecord *findRecordForUSR(StringRef USR) const;
1596
1597 /// Generate and store the USR of declaration \p D.
1598 ///
1599 /// Note: The USR string is stored in and owned by Allocator.
1600 ///
1601 /// \returns a StringRef of the generated USR string.
1602 StringRef recordUSR(const Decl *D);
1603
1604 /// Generate and store the USR for a macro \p Name.
1605 ///
1606 /// Note: The USR string is stored in and owned by Allocator.
1607 ///
1608 /// \returns a StringRef to the generate USR string.
1609 StringRef recordUSRForMacro(StringRef Name, SourceLocation SL,
1610 const SourceManager &SM);
1611
1612 /// Copy \p String into the Allocator in this APISet.
1613 ///
1614 /// \returns a StringRef of the copied string in APISet::Allocator.
1615 StringRef copyString(StringRef String);
1616
1617 APISet(const llvm::Triple &Target, Language Lang,
1618 const std::string &ProductName)
1619 : Target(Target), Lang(Lang), ProductName(ProductName) {}
1620
1621private:
1622 /// BumpPtrAllocator to store generated/copied strings.
1623 ///
1624 /// Note: The main use for this is being able to deduplicate strings.
1625 llvm::BumpPtrAllocator StringAllocator;
1626
1627 const llvm::Triple Target;
1628 const Language Lang;
1629
1630 llvm::DenseMap<StringRef, APIRecord *> USRBasedLookupTable;
1631 RecordMap<NamespaceRecord> Namespaces;
1632 RecordMap<GlobalFunctionRecord> GlobalFunctions;
1633 RecordMap<GlobalFunctionTemplateRecord> GlobalFunctionTemplates;
1634 RecordMap<GlobalFunctionTemplateSpecializationRecord>
1635 GlobalFunctionTemplateSpecializations;
1636 RecordMap<GlobalVariableRecord> GlobalVariables;
1637 RecordMap<GlobalVariableTemplateRecord> GlobalVariableTemplates;
1638 RecordMap<GlobalVariableTemplateSpecializationRecord>
1639 GlobalVariableTemplateSpecializations;
1640 RecordMap<GlobalVariableTemplatePartialSpecializationRecord>
1641 GlobalVariableTemplatePartialSpecializations;
1642 RecordMap<ConceptRecord> Concepts;
1643 RecordMap<StaticFieldRecord> StaticFields;
1644 RecordMap<EnumRecord> Enums;
1645 RecordMap<StructRecord> Structs;
1646 RecordMap<CXXClassRecord> CXXClasses;
1647 RecordMap<CXXFieldRecord> CXXFields;
1648 RecordMap<CXXMethodRecord> CXXMethods;
1649 RecordMap<CXXInstanceMethodRecord> CXXInstanceMethods;
1650 RecordMap<CXXStaticMethodRecord> CXXStaticMethods;
1651 RecordMap<CXXMethodTemplateRecord> CXXMethodTemplates;
1652 RecordMap<CXXMethodTemplateSpecializationRecord>
1653 CXXMethodTemplateSpecializations;
1654 RecordMap<CXXFieldTemplateRecord> CXXFieldTemplates;
1655 RecordMap<ClassTemplateRecord> ClassTemplates;
1656 RecordMap<ClassTemplateSpecializationRecord> ClassTemplateSpecializations;
1657 RecordMap<ClassTemplatePartialSpecializationRecord>
1658 ClassTemplatePartialSpecializations;
1659 RecordMap<ObjCCategoryRecord> ObjCCategories;
1660 RecordMap<ObjCInterfaceRecord> ObjCInterfaces;
1661 RecordMap<ObjCProtocolRecord> ObjCProtocols;
1662 RecordMap<MacroDefinitionRecord> Macros;
1663 RecordMap<TypedefRecord> Typedefs;
1664
1665public:
1666 const std::string ProductName;
1667};
1668
1669} // namespace extractapi
1670} // namespace clang
1671
1672#endif // LLVM_CLANG_EXTRACTAPI_API_H
NodeId Parent
Definition: ASTDiff.cpp:191
This file defines the AvailabilityInfo struct that collects availability attributes of a symbol.
#define SM(sm)
Definition: Cuda.cpp:80
This file defines the Declaration Fragments related classes.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
Represents an unpacked "presumed" location which can be presented to the user.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:413
The base class of the type hierarchy.
Definition: Type.h:1602
APISet holds the set of API records collected from given inputs.
Definition: API.h:1190
NamespaceRecord * addNamespace(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeaderg)
Definition: API.cpp:47
const RecordMap< GlobalVariableTemplateSpecializationRecord > & getGlobalVariableTemplateSpecializations() const
Definition: API.h:1540
ObjCMethodRecord * addObjCMethod(ObjCContainerRecord *Container, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsInstanceMethod, bool IsFromSystemHeader)
Create and add an Objective-C method record into the API set.
Definition: API.cpp:416
const RecordMap< CXXFieldRecord > & getCXXFields() const
Definition: API.h:1559
GlobalVariableTemplatePartialSpecializationRecord * addGlobalVariableTemplatePartialSpecialization(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, bool IsFromSystemHeader)
Definition: API.cpp:292
Language getLanguage() const
Get the language used by the APIs.
Definition: API.h:1515
ObjCPropertyRecord * addObjCProperty(ObjCContainerRecord *Container, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, ObjCPropertyRecord::AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsInstanceProperty, bool IsFromSystemHeader)
Create and add an Objective-C property record into the API set.
Definition: API.cpp:438
const std::string ProductName
Definition: API.h:1666
const RecordMap< CXXFieldTemplateRecord > & getCXXFieldTemplates() const
Definition: API.h:1564
CXXMethodTemplateRecord * addCXXMethodTemplate(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, Template Template, bool IsFromSystemHeader)
Definition: API.cpp:349
const RecordMap< CXXStaticMethodRecord > & getCXXStaticMethods() const
Definition: API.h:1556
const RecordMap< ClassTemplateRecord > & getClassTemplates() const
Definition: API.h:1568
StaticFieldRecord * addStaticField(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference Context, AccessControl Access, bool IsFromSystemHeaderg)
Definition: API.cpp:176
StringRef copyString(StringRef String)
Copy String into the Allocator in this APISet.
Definition: API.cpp:528
TypedefRecord * addTypedef(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference UnderlyingType, bool IsFromSystemHeader)
Create a typedef record into the API set.
Definition: API.cpp:498
GlobalVariableRecord * addGlobalVar(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeadin, bool IsFromSystemHeaderg)
Create and add a global variable record into the API set.
Definition: API.cpp:63
ClassTemplateRecord * addClassTemplate(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:233
ClassTemplateSpecializationRecord * addClassTemplateSpecialization(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:248
const RecordMap< ConceptRecord > & getConcepts() const
Definition: API.h:1567
const RecordMap< GlobalVariableTemplateRecord > & getGlobalVariableTemplates() const
Definition: API.h:1533
StructFieldRecord * addStructField(StructRecord *Struct, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Create and add a struct field record into the API set.
Definition: API.cpp:148
const RecordMap< EnumRecord > & getEnums() const
Definition: API.h:1547
const llvm::Triple & getTarget() const
Get the target triple for the ExtractAPI invocation.
Definition: API.h:1512
GlobalVariableTemplateSpecializationRecord * addGlobalVariableTemplateSpecialization(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.cpp:280
const RecordMap< GlobalFunctionTemplateRecord > & getGlobalFunctionTemplates() const
Definition: API.h:1522
ObjCProtocolRecord * addObjCProtocol(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Create and add an Objective-C protocol record into the API set.
Definition: API.cpp:476
const RecordMap< CXXMethodTemplateSpecializationRecord > & getCXXMethodTemplateSpecializations() const
Definition: API.h:1561
CXXMethodRecord * addCXXSpecialMethod(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
const RecordMap< NamespaceRecord > & getNamespaces() const
Definition: API.h:1517
ObjCInstanceVariableRecord * addObjCInstanceVariable(ObjCContainerRecord *Container, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, ObjCInstanceVariableRecord::AccessControl Access, bool IsFromSystemHeader)
Create and add an Objective-C instance variable record into the API set.
Definition: API.cpp:462
const RecordMap< TypedefRecord > & getTypedefs() const
Definition: API.h:1590
CXXMethodTemplateSpecializationRecord * addCXXMethodTemplateSpec(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:365
ObjCInterfaceRecord * addObjCInterface(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference SuperClass, bool IsFromSystemHeader)
Create and add an Objective-C interface record into the API set.
Definition: API.cpp:404
const RecordMap< ClassTemplatePartialSpecializationRecord > & getClassTemplatePartialSpecializations() const
Definition: API.h:1576
const RecordMap< GlobalVariableRecord > & getGlobalVariables() const
Definition: API.h:1529
GlobalFunctionRecord * addGlobalFunction(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Create and add a function record into the API set.
Definition: API.cpp:84
GlobalFunctionTemplateRecord * addGlobalFunctionTemplate(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, Template Template, bool IsFromSystemHeader)
Definition: API.cpp:96
const RecordMap< CXXInstanceMethodRecord > & getCXXInstanceMethods() const
Definition: API.h:1553
const RecordMap< MacroDefinitionRecord > & getMacros() const
Definition: API.h:1589
CXXMethodRecord * addCXXInstanceMethod(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:315
const RecordMap< ObjCCategoryRecord > & getObjCCategories() const
Definition: API.h:1580
const RecordMap< ClassTemplateSpecializationRecord > & getClassTemplateSpecializations() const
Definition: API.h:1572
GlobalVariableTemplateRecord * addGlobalVariableTemplate(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, bool IsFromSystemHeader)
Definition: API.cpp:72
const RecordMap< GlobalVariableTemplatePartialSpecializationRecord > & getGlobalVariableTemplatePartialSpecializations() const
Definition: API.h:1544
CXXFieldTemplateRecord * addCXXFieldTemplate(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, Template Template, bool IsFromSystemHeader)
Definition: API.cpp:202
const RecordMap< StaticFieldRecord > & getStaticFields() const
Definition: API.h:1536
MacroDefinitionRecord * addMacroDefinition(StringRef Name, StringRef USR, PresumedLoc Loc, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Create a macro definition record into the API set.
Definition: API.cpp:489
CXXMethodRecord * addCXXStaticMethod(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:332
CXXFieldRecord * addCXXField(APIRecord *CXXClass, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:189
const RecordMap< GlobalFunctionTemplateSpecializationRecord > & getGlobalFunctionTemplateSpecializations() const
Definition: API.h:1526
GlobalFunctionTemplateSpecializationRecord * addGlobalFunctionTemplateSpecialization(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.cpp:109
const RecordMap< ObjCProtocolRecord > & getObjCProtocols() const
Definition: API.h:1586
ObjCCategoryRecord * addObjCCategory(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference Interface, bool IsFromSystemHeader, bool IsFromExternalModule)
Create and add an Objective-C category record into the API set.
Definition: API.cpp:382
CXXClassRecord * addCXXClass(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, APIRecord::RecordKind Kind, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:218
EnumConstantRecord * addEnumConstant(EnumRecord *Enum, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Create and add an enum constant record into the API set.
Definition: API.cpp:121
ConceptRecord * addConcept(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, bool IsFromSystemHeader)
Definition: API.cpp:304
const RecordMap< ConceptRecord > & getRecords() const
Definition: API.h:1579
StringRef recordUSR(const Decl *D)
Generate and store the USR of declaration D.
Definition: API.cpp:515
StringRef recordUSRForMacro(StringRef Name, SourceLocation SL, const SourceManager &SM)
Generate and store the USR for a macro Name.
Definition: API.cpp:521
const RecordMap< ObjCInterfaceRecord > & getObjCInterfaces() const
Definition: API.h:1583
const RecordMap< CXXMethodTemplateRecord > & getCXXMethodTemplates() const
Definition: API.h:1550
const RecordMap< GlobalFunctionRecord > & getGlobalFunctions() const
Definition: API.h:1518
StructRecord * addStruct(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Create and add a struct record into the API set.
Definition: API.cpp:164
APIRecord * findRecordForUSR(StringRef USR) const
Finds the APIRecord for a given USR.
Definition: API.cpp:508
llvm::MapVector< StringRef, std::unique_ptr< RecordTy > > RecordMap
A mapping type to store a set of APIRecords with the USR as the key.
Definition: API.h:1509
const RecordMap< StructRecord > & getStructs() const
Definition: API.h:1548
EnumRecord * addEnum(StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Create and add an enum record into the API set.
Definition: API.cpp:137
ClassTemplatePartialSpecializationRecord * addClassTemplatePartialSpecialization(APIRecord *Parent, StringRef Name, StringRef USR, PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, AccessControl Access, bool IsFromSystemHeader)
Definition: API.cpp:264
APISet(const llvm::Triple &Target, Language Lang, const std::string &ProductName)
Definition: API.h:1617
const RecordMap< CXXClassRecord > & getCXXClasses() const
Definition: API.h:1549
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.
void addTemplateParameter(std::string Type, std::string Name, unsigned int Index, unsigned int Depth, bool IsParameterPack)
Definition: API.h:128
Template(const TemplateDecl *Decl)
Definition: API.h:66
Template(const VarTemplatePartialSpecializationDecl *Decl)
Definition: API.h:102
Template(const ClassTemplatePartialSpecializationDecl *Decl)
Definition: API.h:84
const llvm::SmallVector< TemplateParameter > & getParameters() const
Definition: API.h:120
const llvm::SmallVector< TemplateConstraint > & getConstraints() const
Definition: API.h:124
bool empty() const
Definition: API.h:134
std::vector< RawComment::CommentLine > DocComment
DocComment is a vector of RawComment::CommentLine.
Definition: API.h:150
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Definition: Linkage.h:24
Language
The language for the input, used to select and validate the language standard and possible actions.
Definition: LangStandard.h:23
@ Parameter
The parameter type of a method or function.
llvm::PointerUnion< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
Definition: DeclTemplate.h:65
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
@ Struct
The "struct" keyword introduces the elaborated-type-specifier.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
Definition: Format.h:5226
Stores information about the context of the declaration of this API.
Definition: API.h:202
RecordKind ParentKind
The record kind of the parent API.
Definition: API.h:208
APIRecord * ParentRecord
A pointer to the parent APIRecord if known.
Definition: API.h:210
HierarchyInformation(StringRef ParentUSR, StringRef ParentName, RecordKind Kind, APIRecord *ParentRecord=nullptr)
Definition: API.h:213
StringRef ParentName
The name of the parent API.
Definition: API.h:206
StringRef ParentUSR
The USR of the parent API.
Definition: API.h:204
The base representation of an API record. Holds common symbol information.
Definition: API.h:156
RecordKind getKind() const
Definition: API.h:254
APIRecord(RecordKind Kind, StringRef USR, StringRef Name)
Definition: API.h:268
DocComment Comment
Documentation comment lines attached to this symbol declaration.
Definition: API.h:231
AvailabilitySet Availabilities
Definition: API.h:227
DeclarationFragments Declaration
Declaration fragments of this symbol declaration.
Definition: API.h:234
LinkageInfo Linkage
Definition: API.h:228
virtual ~APIRecord()=0
Definition: API.cpp:541
DeclarationFragments SubHeading
SubHeading provides a more detailed representation than the plain declaration name.
Definition: API.h:242
APIRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Location, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:258
PresumedLoc Location
Definition: API.h:226
HierarchyInformation ParentInformation
Information about the parent record of this record.
Definition: API.h:245
RecordKind
Discriminator for LLVM-style RTTI (dyn_cast<> et al.)
Definition: API.h:158
@ RK_GlobalFunctionTemplateSpecialization
Definition: API.h:163
@ RK_GlobalVariableTemplatePartialSpecialization
Definition: API.h:167
@ RK_GlobalVariableTemplateSpecialization
Definition: API.h:166
@ RK_ClassTemplatePartialSpecialization
Definition: API.h:179
bool IsFromSystemHeader
Whether the symbol was defined in a system header.
Definition: API.h:248
SmallVector< SymbolReference > Bases
Definition: API.h:921
static bool classof(const APIRecord *Record)
Definition: API.h:934
SmallVector< std::unique_ptr< CXXMethodRecord > > Methods
Definition: API.h:920
CXXClassRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, RecordKind Kind, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:924
SmallVector< std::unique_ptr< CXXFieldRecord > > Fields
Definition: API.h:919
CXXConstructorRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:588
static bool classof(const APIRecord *Record)
Definition: API.h:598
static bool classof(const APIRecord *Record)
Definition: API.h:616
CXXDestructorRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:607
CXXFieldRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:531
CXXFieldRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:521
static bool classof(const APIRecord *Record)
Definition: API.h:541
static bool classof(const APIRecord *Record)
Definition: API.h:563
CXXFieldTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, Template Template, bool IsFromSystemHeader)
Definition: API.h:552
static bool classof(const APIRecord *Record)
Definition: API.h:655
CXXInstanceMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:644
CXXMethodRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:574
FunctionSignature Signature
Definition: API.h:569
static bool classof(const APIRecord *Record)
Definition: API.h:678
CXXMethodTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, Template Template, bool IsFromSystemHeader)
Definition: API.h:666
CXXMethodTemplateSpecializationRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:684
static bool classof(const APIRecord *Record)
Definition: API.h:694
static bool classof(const APIRecord *Record)
Definition: API.h:635
CXXStaticMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:625
ClassTemplatePartialSpecializationRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:977
static bool classof(const APIRecord *Record)
Definition: API.h:987
static bool classof(const APIRecord *Record)
Definition: API.h:955
ClassTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:945
ClassTemplateSpecializationRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:961
static bool classof(const APIRecord *Record)
Definition: API.h:970
ConceptRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, Template Template, bool IsFromSystemHeader)
Definition: API.h:995
This holds information associated with enum constants.
Definition: API.h:443
static bool classof(const APIRecord *Record)
Definition: API.h:452
EnumConstantRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:444
This holds information associated with enums.
Definition: API.h:461
static bool classof(const APIRecord *Record)
Definition: API.h:472
EnumRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:464
SmallVector< std::unique_ptr< EnumConstantRecord > > Constants
Definition: API.h:462
This holds information associated with global functions.
Definition: API.h:290
static bool classof(const APIRecord *Record)
Definition: API.h:314
GlobalFunctionRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.h:304
GlobalFunctionRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.h:293
static bool classof(const APIRecord *Record)
Definition: API.h:338
GlobalFunctionTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, Template Template, bool IsFromSystemHeader)
Definition: API.h:325
static bool classof(const APIRecord *Record)
Definition: API.h:355
GlobalFunctionTemplateSpecializationRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.h:344
This holds information associated with global functions.
Definition: API.h:361
static bool classof(const APIRecord *Record)
Definition: API.h:379
GlobalVariableRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:371
GlobalVariableRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:362
GlobalVariableTemplatePartialSpecializationRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, class Template Template, bool IsFromSystemHeader)
Definition: API.h:425
static bool classof(const APIRecord *Record)
Definition: API.h:401
GlobalVariableTemplateRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, class Template Template, bool IsFromSystemHeader)
Definition: API.h:390
GlobalVariableTemplateSpecializationRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:407
static bool classof(const APIRecord *Record)
Definition: API.h:416
This holds information associated with macro definitions.
Definition: API.h:1076
static bool classof(const APIRecord *Record)
Definition: API.h:1085
MacroDefinitionRecord(StringRef USR, StringRef Name, PresumedLoc Loc, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:1077
NamespaceRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:276
static bool classof(const APIRecord *Record)
Definition: API.h:284
This holds information associated with Objective-C categories.
Definition: API.h:1007
ObjCCategoryRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference Interface, bool IsFromSystemHeader)
Definition: API.h:1012
static bool classof(const APIRecord *Record)
Definition: API.h:1023
bool IsFromExternalModule
Determine whether the Category is derived from external class interface.
Definition: API.h:1010
static bool classof(const APIRecord *Record)
Definition: API.h:848
ObjCClassMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.h:838
static bool classof(const APIRecord *Record)
Definition: API.h:768
ObjCClassPropertyRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsFromSystemHeader)
Definition: API.h:755
The base representation of an Objective-C container record.
Definition: API.h:899
ObjCContainerRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:907
SmallVector< SymbolReference > Protocols
Definition: API.h:903
SmallVector< std::unique_ptr< ObjCInstanceVariableRecord > > Ivars
Definition: API.h:902
SmallVector< std::unique_ptr< ObjCMethodRecord > > Methods
Definition: API.h:900
SmallVector< std::unique_ptr< ObjCPropertyRecord > > Properties
Definition: API.h:901
static bool classof(const APIRecord *Record)
Definition: API.h:829
ObjCInstanceMethodRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.h:820
ObjCInstancePropertyRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsFromSystemHeader)
Definition: API.h:733
static bool classof(const APIRecord *Record)
Definition: API.h:746
This holds information associated with Objective-C instance variables.
Definition: API.h:777
static bool classof(const APIRecord *Record)
Definition: API.h:792
ObjCInstanceVariableRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:781
This holds information associated with Objective-C interfaces/classes.
Definition: API.h:1032
static bool classof(const APIRecord *Record)
Definition: API.h:1048
SmallVector< ObjCCategoryRecord * > Categories
Definition: API.h:1035
ObjCInterfaceRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference SuperClass, bool IsFromSystemHeader)
Definition: API.h:1037
This holds information associated with Objective-C methods.
Definition: API.h:801
ObjCMethodRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, FunctionSignature Signature, bool IsFromSystemHeader)
Definition: API.h:806
FunctionSignature Signature
Definition: API.h:802
This holds information associated with Objective-C properties.
Definition: API.h:700
ObjCPropertyRecord(RecordKind Kind, StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, AttributeKind Attributes, StringRef GetterName, StringRef SetterName, bool IsOptional, bool IsFromSystemHeader)
Definition: API.h:713
AttributeKind
The attributes associated with an Objective-C property.
Definition: API.h:702
This holds information associated with Objective-C protocols.
Definition: API.h:1057
ObjCProtocolRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:1058
static bool classof(const APIRecord *Record)
Definition: API.h:1067
StaticFieldRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, LinkageInfo Linkage, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference Context, AccessControl Access, bool IsFromSystemHeader)
Definition: API.h:882
static bool classof(const APIRecord *Record)
Definition: API.h:892
This holds information associated with struct fields.
Definition: API.h:481
StructFieldRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:482
static bool classof(const APIRecord *Record)
Definition: API.h:490
This holds information associated with structs.
Definition: API.h:499
StructRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, bool IsFromSystemHeader)
Definition: API.h:502
static bool classof(const APIRecord *Record)
Definition: API.h:510
SmallVector< std::unique_ptr< StructFieldRecord > > Fields
Definition: API.h:500
This represents a reference to another symbol that might come from external sources.
Definition: API.h:858
bool empty() const
Determine if this SymbolReference is empty.
Definition: API.h:876
SymbolReference(const APIRecord &Record)
Definition: API.h:868
SymbolReference(const APIRecord *Record)
Definition: API.h:870
StringRef Source
The source project/module/product of the referred symbol.
Definition: API.h:863
SymbolReference(StringRef Name, StringRef USR="", StringRef Source="")
Definition: API.h:866
This holds information associated with typedefs.
Definition: API.h:1098
SymbolReference UnderlyingType
Definition: API.h:1099
TypedefRecord(StringRef USR, StringRef Name, PresumedLoc Loc, AvailabilitySet Availabilities, const DocComment &Comment, DeclarationFragments Declaration, DeclarationFragments SubHeading, SymbolReference UnderlyingType, bool IsFromSystemHeader)
Definition: API.h:1101
static bool classof(const APIRecord *Record)
Definition: API.h:1111
Check if a record type has a function signature mixin.
Definition: API.h:1124