@@ -50,13 +50,13 @@ namespace extractapi {
50
50
// / \endcode
51
51
using DocComment = std::vector<RawComment::CommentLine>;
52
52
53
- // Classes deriving from APIRecord need to have Name be the first constructor
53
+ // Classes deriving from APIRecord need to have USR be the first constructor
54
54
// argument. This is so that they are compatible with `addTopLevelRecord`
55
55
// defined in API.cpp
56
56
// / The base representation of an API record. Holds common symbol information.
57
57
struct APIRecord {
58
- StringRef Name;
59
58
StringRef USR;
59
+ StringRef Name;
60
60
PresumedLoc Location;
61
61
AvailabilityInfo Availability;
62
62
LinkageInfo Linkage;
@@ -101,11 +101,11 @@ struct APIRecord {
101
101
102
102
APIRecord () = delete ;
103
103
104
- APIRecord (RecordKind Kind, StringRef Name , StringRef USR ,
104
+ APIRecord (RecordKind Kind, StringRef USR , StringRef Name ,
105
105
PresumedLoc Location, const AvailabilityInfo &Availability,
106
106
LinkageInfo Linkage, const DocComment &Comment,
107
107
DeclarationFragments Declaration, DeclarationFragments SubHeading)
108
- : Name(Name ), USR(USR ), Location(Location), Availability(Availability),
108
+ : USR(USR ), Name(Name ), Location(Location), Availability(Availability),
109
109
Linkage (Linkage), Comment(Comment), Declaration(Declaration),
110
110
SubHeading(SubHeading), Kind(Kind) {}
111
111
@@ -117,13 +117,13 @@ struct APIRecord {
117
117
struct GlobalFunctionRecord : APIRecord {
118
118
FunctionSignature Signature;
119
119
120
- GlobalFunctionRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
120
+ GlobalFunctionRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
121
121
const AvailabilityInfo &Availability,
122
122
LinkageInfo Linkage, const DocComment &Comment,
123
123
DeclarationFragments Declaration,
124
124
DeclarationFragments SubHeading,
125
125
FunctionSignature Signature)
126
- : APIRecord(RK_GlobalFunction, Name, USR , Loc, Availability, Linkage,
126
+ : APIRecord(RK_GlobalFunction, USR, Name , Loc, Availability, Linkage,
127
127
Comment, Declaration, SubHeading),
128
128
Signature (Signature) {}
129
129
@@ -137,12 +137,12 @@ struct GlobalFunctionRecord : APIRecord {
137
137
138
138
// / This holds information associated with global functions.
139
139
struct GlobalVariableRecord : APIRecord {
140
- GlobalVariableRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
140
+ GlobalVariableRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
141
141
const AvailabilityInfo &Availability,
142
142
LinkageInfo Linkage, const DocComment &Comment,
143
143
DeclarationFragments Declaration,
144
144
DeclarationFragments SubHeading)
145
- : APIRecord(RK_GlobalVariable, Name, USR , Loc, Availability, Linkage,
145
+ : APIRecord(RK_GlobalVariable, USR, Name , Loc, Availability, Linkage,
146
146
Comment, Declaration, SubHeading) {}
147
147
148
148
static bool classof (const APIRecord *Record) {
@@ -155,12 +155,12 @@ struct GlobalVariableRecord : APIRecord {
155
155
156
156
// / This holds information associated with enum constants.
157
157
struct EnumConstantRecord : APIRecord {
158
- EnumConstantRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
158
+ EnumConstantRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
159
159
const AvailabilityInfo &Availability,
160
160
const DocComment &Comment,
161
161
DeclarationFragments Declaration,
162
162
DeclarationFragments SubHeading)
163
- : APIRecord(RK_EnumConstant, Name, USR , Loc, Availability,
163
+ : APIRecord(RK_EnumConstant, USR, Name , Loc, Availability,
164
164
LinkageInfo::none (), Comment, Declaration, SubHeading) {}
165
165
166
166
static bool classof (const APIRecord *Record) {
@@ -175,10 +175,10 @@ struct EnumConstantRecord : APIRecord {
175
175
struct EnumRecord : APIRecord {
176
176
SmallVector<std::unique_ptr<EnumConstantRecord>> Constants;
177
177
178
- EnumRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
178
+ EnumRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
179
179
const AvailabilityInfo &Availability, const DocComment &Comment,
180
180
DeclarationFragments Declaration, DeclarationFragments SubHeading)
181
- : APIRecord(RK_Enum, Name, USR , Loc, Availability, LinkageInfo::none(),
181
+ : APIRecord(RK_Enum, USR, Name , Loc, Availability, LinkageInfo::none(),
182
182
Comment, Declaration, SubHeading) {}
183
183
184
184
static bool classof (const APIRecord *Record) {
@@ -191,11 +191,11 @@ struct EnumRecord : APIRecord {
191
191
192
192
// / This holds information associated with struct fields.
193
193
struct StructFieldRecord : APIRecord {
194
- StructFieldRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
194
+ StructFieldRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
195
195
const AvailabilityInfo &Availability,
196
196
const DocComment &Comment, DeclarationFragments Declaration,
197
197
DeclarationFragments SubHeading)
198
- : APIRecord(RK_StructField, Name, USR , Loc, Availability,
198
+ : APIRecord(RK_StructField, USR, Name , Loc, Availability,
199
199
LinkageInfo::none (), Comment, Declaration, SubHeading) {}
200
200
201
201
static bool classof (const APIRecord *Record) {
@@ -210,11 +210,11 @@ struct StructFieldRecord : APIRecord {
210
210
struct StructRecord : APIRecord {
211
211
SmallVector<std::unique_ptr<StructFieldRecord>> Fields;
212
212
213
- StructRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
213
+ StructRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
214
214
const AvailabilityInfo &Availability, const DocComment &Comment,
215
215
DeclarationFragments Declaration,
216
216
DeclarationFragments SubHeading)
217
- : APIRecord(RK_Struct, Name, USR , Loc, Availability, LinkageInfo::none(),
217
+ : APIRecord(RK_Struct, USR, Name , Loc, Availability, LinkageInfo::none(),
218
218
Comment, Declaration, SubHeading) {}
219
219
220
220
static bool classof (const APIRecord *Record) {
@@ -240,14 +240,14 @@ struct ObjCPropertyRecord : APIRecord {
240
240
StringRef SetterName;
241
241
bool IsOptional;
242
242
243
- ObjCPropertyRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
243
+ ObjCPropertyRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
244
244
const AvailabilityInfo &Availability,
245
245
const DocComment &Comment,
246
246
DeclarationFragments Declaration,
247
247
DeclarationFragments SubHeading, AttributeKind Attributes,
248
248
StringRef GetterName, StringRef SetterName,
249
249
bool IsOptional)
250
- : APIRecord(RK_ObjCProperty, Name, USR , Loc, Availability,
250
+ : APIRecord(RK_ObjCProperty, USR, Name , Loc, Availability,
251
251
LinkageInfo::none (), Comment, Declaration, SubHeading),
252
252
Attributes(Attributes), GetterName(GetterName), SetterName(SetterName),
253
253
IsOptional(IsOptional) {}
@@ -269,13 +269,13 @@ struct ObjCInstanceVariableRecord : APIRecord {
269
269
using AccessControl = ObjCIvarDecl::AccessControl;
270
270
AccessControl Access;
271
271
272
- ObjCInstanceVariableRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
272
+ ObjCInstanceVariableRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
273
273
const AvailabilityInfo &Availability,
274
274
const DocComment &Comment,
275
275
DeclarationFragments Declaration,
276
276
DeclarationFragments SubHeading,
277
277
AccessControl Access)
278
- : APIRecord(RK_ObjCIvar, Name, USR , Loc, Availability,
278
+ : APIRecord(RK_ObjCIvar, USR, Name , Loc, Availability,
279
279
LinkageInfo::none (), Comment, Declaration, SubHeading),
280
280
Access(Access) {}
281
281
@@ -292,12 +292,12 @@ struct ObjCMethodRecord : APIRecord {
292
292
FunctionSignature Signature;
293
293
bool IsInstanceMethod;
294
294
295
- ObjCMethodRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
295
+ ObjCMethodRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
296
296
const AvailabilityInfo &Availability,
297
297
const DocComment &Comment, DeclarationFragments Declaration,
298
298
DeclarationFragments SubHeading, FunctionSignature Signature,
299
299
bool IsInstanceMethod)
300
- : APIRecord(RK_ObjCMethod, Name, USR , Loc, Availability,
300
+ : APIRecord(RK_ObjCMethod, USR, Name , Loc, Availability,
301
301
LinkageInfo::none (), Comment, Declaration, SubHeading),
302
302
Signature(Signature), IsInstanceMethod(IsInstanceMethod) {}
303
303
@@ -340,12 +340,12 @@ struct ObjCContainerRecord : APIRecord {
340
340
341
341
ObjCContainerRecord () = delete ;
342
342
343
- ObjCContainerRecord (RecordKind Kind, StringRef Name , StringRef USR ,
343
+ ObjCContainerRecord (RecordKind Kind, StringRef USR , StringRef Name ,
344
344
PresumedLoc Loc, const AvailabilityInfo &Availability,
345
345
LinkageInfo Linkage, const DocComment &Comment,
346
346
DeclarationFragments Declaration,
347
347
DeclarationFragments SubHeading)
348
- : APIRecord(Kind, Name, USR , Loc, Availability, Linkage, Comment,
348
+ : APIRecord(Kind, USR, Name , Loc, Availability, Linkage, Comment,
349
349
Declaration, SubHeading) {}
350
350
351
351
virtual ~ObjCContainerRecord () = 0 ;
@@ -355,12 +355,12 @@ struct ObjCContainerRecord : APIRecord {
355
355
struct ObjCCategoryRecord : ObjCContainerRecord {
356
356
SymbolReference Interface;
357
357
358
- ObjCCategoryRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
358
+ ObjCCategoryRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
359
359
const AvailabilityInfo &Availability,
360
360
const DocComment &Comment,
361
361
DeclarationFragments Declaration,
362
362
DeclarationFragments SubHeading, SymbolReference Interface)
363
- : ObjCContainerRecord(RK_ObjCCategory, Name, USR , Loc, Availability,
363
+ : ObjCContainerRecord(RK_ObjCCategory, USR, Name , Loc, Availability,
364
364
LinkageInfo::none (), Comment, Declaration,
365
365
SubHeading),
366
366
Interface(Interface) {}
@@ -379,13 +379,13 @@ struct ObjCInterfaceRecord : ObjCContainerRecord {
379
379
// ObjCCategoryRecord%s are stored in and owned by APISet.
380
380
SmallVector<ObjCCategoryRecord *> Categories;
381
381
382
- ObjCInterfaceRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
382
+ ObjCInterfaceRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
383
383
const AvailabilityInfo &Availability, LinkageInfo Linkage,
384
384
const DocComment &Comment,
385
385
DeclarationFragments Declaration,
386
386
DeclarationFragments SubHeading,
387
387
SymbolReference SuperClass)
388
- : ObjCContainerRecord(RK_ObjCInterface, Name, USR , Loc, Availability,
388
+ : ObjCContainerRecord(RK_ObjCInterface, USR, Name , Loc, Availability,
389
389
Linkage, Comment, Declaration, SubHeading),
390
390
SuperClass (SuperClass) {}
391
391
@@ -399,12 +399,12 @@ struct ObjCInterfaceRecord : ObjCContainerRecord {
399
399
400
400
// / This holds information associated with Objective-C protocols.
401
401
struct ObjCProtocolRecord : ObjCContainerRecord {
402
- ObjCProtocolRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
402
+ ObjCProtocolRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
403
403
const AvailabilityInfo &Availability,
404
404
const DocComment &Comment,
405
405
DeclarationFragments Declaration,
406
406
DeclarationFragments SubHeading)
407
- : ObjCContainerRecord(RK_ObjCProtocol, Name, USR , Loc, Availability,
407
+ : ObjCContainerRecord(RK_ObjCProtocol, USR, Name , Loc, Availability,
408
408
LinkageInfo::none (), Comment, Declaration,
409
409
SubHeading) {}
410
410
@@ -418,10 +418,10 @@ struct ObjCProtocolRecord : ObjCContainerRecord {
418
418
419
419
// / This holds information associated with macro definitions.
420
420
struct MacroDefinitionRecord : APIRecord {
421
- MacroDefinitionRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
421
+ MacroDefinitionRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
422
422
DeclarationFragments Declaration,
423
423
DeclarationFragments SubHeading)
424
- : APIRecord(RK_MacroDefinition, Name, USR , Loc, AvailabilityInfo(),
424
+ : APIRecord(RK_MacroDefinition, USR, Name , Loc, AvailabilityInfo(),
425
425
LinkageInfo (), {}, Declaration, SubHeading) {}
426
426
427
427
static bool classof (const APIRecord *Record) {
@@ -440,11 +440,11 @@ struct MacroDefinitionRecord : APIRecord {
440
440
struct TypedefRecord : APIRecord {
441
441
SymbolReference UnderlyingType;
442
442
443
- TypedefRecord (StringRef Name , StringRef USR , PresumedLoc Loc,
443
+ TypedefRecord (StringRef USR , StringRef Name , PresumedLoc Loc,
444
444
const AvailabilityInfo &Availability, const DocComment &Comment,
445
445
DeclarationFragments Declaration,
446
446
DeclarationFragments SubHeading, SymbolReference UnderlyingType)
447
- : APIRecord(RK_Typedef, Name, USR , Loc, Availability, LinkageInfo(),
447
+ : APIRecord(RK_Typedef, USR, Name , Loc, Availability, LinkageInfo(),
448
448
Comment, Declaration, SubHeading),
449
449
UnderlyingType (UnderlyingType) {}
450
450
@@ -647,8 +647,7 @@ class APISet {
647
647
DeclarationFragments SubHeading,
648
648
SymbolReference UnderlyingType);
649
649
650
- // / A mapping type to store a set of APIRecord%s with the declaration name as
651
- // / the key.
650
+ // / A mapping type to store a set of APIRecord%s with the USR as the key.
652
651
template <typename RecordTy,
653
652
typename =
654
653
std::enable_if_t <std::is_base_of<APIRecord, RecordTy>::value>>
0 commit comments