22
22
#include " clang/AST/DeclObjC.h"
23
23
#include " clang/AST/RawCommentList.h"
24
24
#include " clang/Basic/SourceLocation.h"
25
- #include " clang/Basic/Specifiers.h"
26
25
#include " clang/ExtractAPI/AvailabilityInfo.h"
27
26
#include " clang/ExtractAPI/DeclarationFragments.h"
28
27
#include " llvm/ADT/MapVector.h"
@@ -65,14 +64,6 @@ struct APIRecord {
65
64
RK_Enum,
66
65
RK_StructField,
67
66
RK_Struct,
68
- RK_Union,
69
- RK_StaticField,
70
- RK_CXXField,
71
- RK_CXXClass,
72
- RK_CXXStaticMethod,
73
- RK_CXXInstanceMethod,
74
- RK_CXXConstructorMethod,
75
- RK_CXXDestructorMethod,
76
67
RK_ObjCInstanceProperty,
77
68
RK_ObjCClassProperty,
78
69
RK_ObjCIvar,
@@ -275,132 +266,6 @@ struct StructRecord : APIRecord {
275
266
virtual void anchor ();
276
267
};
277
268
278
- struct CXXFieldRecord : APIRecord {
279
- AccessControl Access;
280
-
281
- CXXFieldRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
282
- AvailabilitySet Availabilities, const DocComment &Comment,
283
- DeclarationFragments Declaration,
284
- DeclarationFragments SubHeading, AccessControl Access,
285
- bool IsFromSystemHeader)
286
- : APIRecord(RK_CXXField, USR, Name, Loc, std::move(Availabilities),
287
- LinkageInfo::none (), Comment, Declaration, SubHeading,
288
- IsFromSystemHeader),
289
- Access(Access) {}
290
-
291
- CXXFieldRecord (RecordKind Kind, StringRef USR, StringRef Name,
292
- PresumedLoc Loc, AvailabilitySet Availabilities,
293
- const DocComment &Comment, DeclarationFragments Declaration,
294
- DeclarationFragments SubHeading, AccessControl Access,
295
- bool IsFromSystemHeader)
296
- : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
297
- LinkageInfo::none(), Comment, Declaration, SubHeading,
298
- IsFromSystemHeader),
299
- Access(Access) {}
300
-
301
- static bool classof (const APIRecord *Record) {
302
- return Record->getKind () == RK_CXXField;
303
- }
304
-
305
- private:
306
- virtual void anchor ();
307
- };
308
-
309
- struct CXXMethodRecord : APIRecord {
310
- FunctionSignature Signature;
311
- AccessControl Access;
312
-
313
- CXXMethodRecord () = delete ;
314
-
315
- CXXMethodRecord (RecordKind Kind, StringRef USR, StringRef Name,
316
- PresumedLoc Loc, AvailabilitySet Availabilities,
317
- const DocComment &Comment, DeclarationFragments Declaration,
318
- DeclarationFragments SubHeading, FunctionSignature Signature,
319
- AccessControl Access, bool IsFromSystemHeader)
320
- : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
321
- LinkageInfo::none (), Comment, Declaration, SubHeading,
322
- IsFromSystemHeader),
323
- Signature(Signature), Access(Access) {}
324
-
325
- virtual ~CXXMethodRecord () = 0 ;
326
- };
327
-
328
- struct CXXConstructorRecord : CXXMethodRecord {
329
- CXXConstructorRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
330
- AvailabilitySet Availabilities,
331
- const DocComment &Comment,
332
- DeclarationFragments Declaration,
333
- DeclarationFragments SubHeading,
334
- FunctionSignature Signature, AccessControl Access,
335
- bool IsFromSystemHeader)
336
- : CXXMethodRecord(RK_CXXConstructorMethod, USR, Name, Loc,
337
- std::move (Availabilities), Comment, Declaration,
338
- SubHeading, Signature, Access, IsFromSystemHeader) {}
339
- static bool classof (const APIRecord *Record) {
340
- return Record->getKind () == RK_CXXConstructorMethod;
341
- }
342
-
343
- private:
344
- virtual void anchor ();
345
- };
346
-
347
- struct CXXDestructorRecord : CXXMethodRecord {
348
- CXXDestructorRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
349
- AvailabilitySet Availabilities, const DocComment &Comment,
350
- DeclarationFragments Declaration,
351
- DeclarationFragments SubHeading,
352
- FunctionSignature Signature, AccessControl Access,
353
- bool IsFromSystemHeader)
354
- : CXXMethodRecord(RK_CXXDestructorMethod, USR, Name, Loc,
355
- std::move (Availabilities), Comment, Declaration,
356
- SubHeading, Signature, Access, IsFromSystemHeader) {}
357
- static bool classof (const APIRecord *Record) {
358
- return Record->getKind () == RK_CXXDestructorMethod;
359
- }
360
-
361
- private:
362
- virtual void anchor ();
363
- };
364
-
365
- struct CXXStaticMethodRecord : CXXMethodRecord {
366
- CXXStaticMethodRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
367
- AvailabilitySet Availabilities,
368
- const DocComment &Comment,
369
- DeclarationFragments Declaration,
370
- DeclarationFragments SubHeading,
371
- FunctionSignature Signature, AccessControl Access,
372
- bool IsFromSystemHeader)
373
- : CXXMethodRecord(RK_CXXStaticMethod, USR, Name, Loc,
374
- std::move (Availabilities), Comment, Declaration,
375
- SubHeading, Signature, Access, IsFromSystemHeader) {}
376
- static bool classof (const APIRecord *Record) {
377
- return Record->getKind () == RK_CXXStaticMethod;
378
- }
379
-
380
- private:
381
- virtual void anchor ();
382
- };
383
-
384
- struct CXXInstanceMethodRecord : CXXMethodRecord {
385
- CXXInstanceMethodRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
386
- AvailabilitySet Availabilities,
387
- const DocComment &Comment,
388
- DeclarationFragments Declaration,
389
- DeclarationFragments SubHeading,
390
- FunctionSignature Signature, AccessControl Access,
391
- bool IsFromSystemHeader)
392
- : CXXMethodRecord(RK_CXXInstanceMethod, USR, Name, Loc,
393
- std::move (Availabilities), Comment, Declaration,
394
- SubHeading, Signature, Access, IsFromSystemHeader) {}
395
-
396
- static bool classof (const APIRecord *Record) {
397
- return Record->getKind () == RK_CXXInstanceMethod;
398
- }
399
-
400
- private:
401
- virtual void anchor ();
402
- };
403
-
404
269
// / This holds information associated with Objective-C properties.
405
270
struct ObjCPropertyRecord : APIRecord {
406
271
// / The attributes associated with an Objective-C property.
@@ -579,24 +444,6 @@ struct SymbolReference {
579
444
bool empty () const { return Name.empty () && USR.empty () && Source.empty (); }
580
445
};
581
446
582
- struct StaticFieldRecord : CXXFieldRecord {
583
- SymbolReference Context;
584
-
585
- StaticFieldRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
586
- AvailabilitySet Availabilities, LinkageInfo Linkage,
587
- const DocComment &Comment, DeclarationFragments Declaration,
588
- DeclarationFragments SubHeading, SymbolReference Context,
589
- AccessControl Access, bool IsFromSystemHeader)
590
- : CXXFieldRecord(RK_StaticField, USR, Name, Loc,
591
- std::move (Availabilities), Comment, Declaration,
592
- SubHeading, Access, IsFromSystemHeader),
593
- Context(Context) {}
594
-
595
- static bool classof (const APIRecord *Record) {
596
- return Record->getKind () == RK_StaticField;
597
- }
598
- };
599
-
600
447
// / The base representation of an Objective-C container record. Holds common
601
448
// / information associated with Objective-C containers.
602
449
struct ObjCContainerRecord : APIRecord {
@@ -618,28 +465,6 @@ struct ObjCContainerRecord : APIRecord {
618
465
virtual ~ObjCContainerRecord () = 0 ;
619
466
};
620
467
621
- struct CXXClassRecord : APIRecord {
622
- SmallVector<std::unique_ptr<CXXFieldRecord>> Fields;
623
- SmallVector<std::unique_ptr<CXXMethodRecord>> Methods;
624
- SmallVector<SymbolReference> Bases;
625
-
626
- CXXClassRecord (StringRef USR, StringRef Name, PresumedLoc Loc,
627
- AvailabilitySet Availabilities, const DocComment &Comment,
628
- DeclarationFragments Declaration,
629
- DeclarationFragments SubHeading, RecordKind Kind,
630
- bool IsFromSystemHeader)
631
- : APIRecord(Kind, USR, Name, Loc, std::move(Availabilities),
632
- LinkageInfo::none (), Comment, Declaration, SubHeading,
633
- IsFromSystemHeader) {}
634
-
635
- static bool classof (const APIRecord *Record) {
636
- return (Record->getKind () == RK_CXXClass);
637
- }
638
-
639
- private:
640
- virtual void anchor ();
641
- };
642
-
643
468
// / This holds information associated with Objective-C categories.
644
469
struct ObjCCategoryRecord : ObjCContainerRecord {
645
470
SymbolReference Interface;
@@ -766,12 +591,6 @@ struct has_function_signature<ObjCInstanceMethodRecord>
766
591
: public std::true_type {};
767
592
template <>
768
593
struct has_function_signature <ObjCClassMethodRecord> : public std::true_type {};
769
- template <>
770
- struct has_function_signature <CXXMethodRecord> : public std::true_type {};
771
-
772
- template <typename RecordTy> struct has_access : public std ::false_type {};
773
- template <> struct has_access <CXXMethodRecord> : public std::true_type {};
774
- template <> struct has_access <CXXFieldRecord> : public std::true_type {};
775
594
776
595
// / APISet holds the set of API records collected from given inputs.
777
596
class APISet {
@@ -849,41 +668,6 @@ class APISet {
849
668
DeclarationFragments SubHeading,
850
669
bool IsFromSystemHeader);
851
670
852
- StaticFieldRecord *
853
- addStaticField (StringRef Name, StringRef USR, PresumedLoc Loc,
854
- AvailabilitySet Availabilities, LinkageInfo Linkage,
855
- const DocComment &Comment, DeclarationFragments Declaration,
856
- DeclarationFragments SubHeading, SymbolReference Context,
857
- AccessControl Access, bool IsFromSystemHeaderg);
858
-
859
- CXXFieldRecord *addCXXField (CXXClassRecord *CXXClass, StringRef Name,
860
- StringRef USR, PresumedLoc Loc,
861
- AvailabilitySet Availabilities,
862
- const DocComment &Comment,
863
- DeclarationFragments Declaration,
864
- DeclarationFragments SubHeading,
865
- AccessControl Access, bool IsFromSystemHeader);
866
-
867
- CXXClassRecord *
868
- addCXXClass (StringRef Name, StringRef USR, PresumedLoc Loc,
869
- AvailabilitySet Availability, const DocComment &Comment,
870
- DeclarationFragments Declaration, DeclarationFragments SubHeading,
871
- APIRecord::RecordKind Kind, bool IsFromSystemHeader);
872
-
873
- CXXMethodRecord *
874
- addCXXMethod (CXXClassRecord *CXXClassRecord, StringRef Name, StringRef USR,
875
- PresumedLoc Loc, AvailabilitySet Availability,
876
- const DocComment &Comment, DeclarationFragments Declaration,
877
- DeclarationFragments SubHeading, FunctionSignature Signature,
878
- bool IsStatic, AccessControl Access, bool IsFromSystemHeader);
879
-
880
- CXXMethodRecord *addCXXSpecialMethod (
881
- CXXClassRecord *CXXClassRecord, StringRef Name, StringRef USR,
882
- PresumedLoc Loc, AvailabilitySet Availability, const DocComment &Comment,
883
- DeclarationFragments Declaration, DeclarationFragments SubHeading,
884
- FunctionSignature Signature, bool IsConstructor, AccessControl Access,
885
- bool IsFromSystemHeader);
886
-
887
671
// / Create and add an Objective-C category record into the API set.
888
672
// /
889
673
// / Note: the caller is responsible for keeping the StringRef \p Name and
@@ -1006,12 +790,8 @@ class APISet {
1006
790
const RecordMap<GlobalVariableRecord> &getGlobalVariables () const {
1007
791
return GlobalVariables;
1008
792
}
1009
- const RecordMap<StaticFieldRecord> &getStaticFields () const {
1010
- return StaticFields;
1011
- }
1012
793
const RecordMap<EnumRecord> &getEnums () const { return Enums; }
1013
794
const RecordMap<StructRecord> &getStructs () const { return Structs; }
1014
- const RecordMap<CXXClassRecord> &getCXXClasses () const { return CXXClasses; }
1015
795
const RecordMap<ObjCCategoryRecord> &getObjCCategories () const {
1016
796
return ObjCCategories;
1017
797
}
@@ -1065,10 +845,8 @@ class APISet {
1065
845
llvm::DenseMap<StringRef, APIRecord *> USRBasedLookupTable;
1066
846
RecordMap<GlobalFunctionRecord> GlobalFunctions;
1067
847
RecordMap<GlobalVariableRecord> GlobalVariables;
1068
- RecordMap<StaticFieldRecord> StaticFields;
1069
848
RecordMap<EnumRecord> Enums;
1070
849
RecordMap<StructRecord> Structs;
1071
- RecordMap<CXXClassRecord> CXXClasses;
1072
850
RecordMap<ObjCCategoryRecord> ObjCCategories;
1073
851
RecordMap<ObjCInterfaceRecord> ObjCInterfaces;
1074
852
RecordMap<ObjCProtocolRecord> ObjCProtocols;
0 commit comments