clang: include/clang/ExtractAPI/ExtractAPIVisitor.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H

15#define LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H

16

32#include "llvm/ADT/SmallString.h"

33#include "llvm/ADT/StringRef.h"

34#include "llvm/Support/Casting.h"

35#include <type_traits>

36

38namespace extractapi {

39namespace impl {

40

41template

44

45protected:

48

49public:

51

53

55

57

59

61

63

65

68

71

73

76

79

81

83

85

88

91

93

95

97

99

101

103

106

109

111

112 bool

114

117

119

121

123

125

127

129

131

132protected:

133

134

137

138

139

142

145

148 const llvm::iterator_range<

150 Ivars);

151

154

157

159 if (const auto *TypedefDecl = Decl->getTypedefNameForAnonDecl())

161

162 return {};

163 }

164

167 }

168

169private:

170 Derived &getDerivedExtractAPIVisitor() {

171 return *static_cast<Derived *>(this);

172 }

173

174protected:

176

178 for (const auto &BaseSpecifier : Decl->bases()) {

179

181 continue;

182 if (auto *BaseDecl = BaseSpecifier.getType()->getAsTagDecl()) {

184 } else {

186 BaseClass.Name = API.copyString(BaseSpecifier.getType().getAsString(

188

189 if (BaseSpecifier.getType().getTypePtr()->isTemplateTypeParmType()) {

190 if (auto *TTPTD = BaseSpecifier.getType()

197 }

198 }

199 Bases.emplace_back(BaseClass);

200 }

201 }

202 return Bases;

203 }

204

206 if (Decl->isUnion())

208 if (Decl->isStruct())

210

212 }

213

215 if (auto *OwningModule = D.getImportedOwningModule())

216 return OwningModule->getTopLevelModule()->Name;

217

218 return {};

219 }

220

222 const auto *Context = cast_if_present(D.getDeclContext());

223

225 return {};

226

228 }

229

233

237

238 StringRef Name;

239 if (auto *ND = dyn_cast(&D))

240 Name = ND->getName();

241

243 }

244

247 D.isEmbeddedInDeclarator() && D.isFreeStanding();

248 }

249

252 if (!NewRecordContext)

253 return;

254 auto *Tag = D.getType()->getAsTagDecl();

257 if (auto *Record = llvm::dyn_cast_if_present(

259 if (Record->IsEmbeddedInVarDeclarator) {

262 }

263 }

264 }

265};

266

267template

269

270 if (isa(Decl))

271 return true;

272

273

274

276 return true;

277

278

280 return true;

281

282

285 return true;

286

287 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

288 return true;

289

290

291 StringRef Name = Decl->getName();

295 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

299 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

301 Context.getDiagnostics());

302

303

308 if (Decl->isStaticDataMember()) {

311 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

313 SubHeading, Access, isInSystemHeader(Decl));

314 } else {

315

317 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

319 SubHeading, isInSystemHeader(Decl));

320

321

322

323 maybeMergeWithAnonymousTag(*Decl, NewRecord);

324 }

325

326 return true;

327}

328

329template

332 if (const auto *Method = dyn_cast(Decl)) {

333

334 if (Method->getParent()->getDescribedClassTemplate() != nullptr)

335 return true;

336

337

338 for (const auto &P : Context.getParents(*Method)) {

339 if (P.template get())

340 return true;

341 }

342

343

344 if (isa(Method) || isa(Method))

345 return true;

346 }

347

348

349 switch (Decl->getTemplatedKind()) {

353 break;

357 return true;

358 }

359

360 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

361 return true;

362

363

364 auto Name = Decl->getNameAsString();

368 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

372 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

374 Context.getDiagnostics());

375

376

381 if (Decl->getTemplateSpecializationInfo())

383 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

387 SubHeading, Signature, isInSystemHeader(Decl));

388 else

389

391 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

394 Signature, isInSystemHeader(Decl));

395 return true;

396}

397

398template

400 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

401 return true;

402

406 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

409 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

411 Context.getDiagnostics());

412

413

418

419

421

422 if (Decl->hasNameForLinkage()) {

423 StringRef Name = Decl->getName();

424 if (Name.empty())

425 Name = getTypedefName(Decl);

426

427 auto *ER = API.createRecord<EnumRecord>(

428 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

430 SubHeading, isInSystemHeader(Decl), false);

432 } else {

433

434

435 ParentContainer = {};

436 }

437

438

439 getDerivedExtractAPIVisitor().recordEnumConstants(ParentContainer,

440 Decl->enumerators());

441

442 return true;

443}

444

445template

448 getDerivedExtractAPIVisitor().VisitFunctionDecl(Decl);

449 return true;

450}

451

452template

455 getDerivedExtractAPIVisitor().VisitRecordDecl(Decl);

456 return true;

457}

458

459template

462 getDerivedExtractAPIVisitor().VisitCXXRecordDecl(Decl);

463 return true;

464}

465

466template

469 getDerivedExtractAPIVisitor().VisitCXXMethodDecl(Decl);

470 return true;

471}

472

473template

476 getDerivedExtractAPIVisitor().VisitClassTemplateSpecializationDecl(Decl);

477 return true;

478}

479

480template

484 getDerivedExtractAPIVisitor().VisitClassTemplatePartialSpecializationDecl(

486 return true;

487}

488

489template

492 getDerivedExtractAPIVisitor().VisitVarTemplateDecl(Decl);

493 return true;

494}

495

496template

499 getDerivedExtractAPIVisitor().VisitVarTemplateSpecializationDecl(Decl);

500 return true;

501}

502

503template

507 getDerivedExtractAPIVisitor().VisitVarTemplatePartialSpecializationDecl(Decl);

508 return true;

509}

510

511template

514 getDerivedExtractAPIVisitor().VisitFunctionTemplateDecl(Decl);

515 return true;

516}

517

518template

521 getDerivedExtractAPIVisitor().VisitNamespaceDecl(Decl);

522 return true;

523}

524

525template

528 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

529 return true;

530 if (Decl->isAnonymousNamespace())

531 return true;

532 StringRef Name = Decl->getName();

537 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

540 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

542 Context.getDiagnostics());

543

544

550 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

552 SubHeading, isInSystemHeader(Decl));

553

554 return true;

555}

556

557template

559 bool Ret = Base::TraverseRecordDecl(Decl);

560

561 if (!isEmbeddedInVarDeclarator(*Decl) && Decl->isAnonymousStructOrUnion()) {

564 API.removeRecord(USR);

565 }

566

567 return Ret;

568}

569

570template

572 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

573 return true;

574

575

576 StringRef Name = Decl->getName();

577 if (Name.empty())

578 Name = getTypedefName(Decl);

579

583 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

586 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

588 Context.getDiagnostics());

589

590

595

596 if (Decl->isUnion())

598 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

600 SubHeading, isInSystemHeader(Decl), isEmbeddedInVarDeclarator(*Decl));

601 else

603 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

605 SubHeading, isInSystemHeader(Decl), isEmbeddedInVarDeclarator(*Decl));

606

607 return true;

608}

609

610template

613 bool Ret = Base::TraverseCXXRecordDecl(Decl);

614

615 if (!isEmbeddedInVarDeclarator(*Decl) && Decl->isAnonymousStructOrUnion()) {

618 API.removeRecord(USR);

619 }

620

621 return Ret;

622}

623

624template

627 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) ||

629 return true;

630

631 StringRef Name = Decl->getName();

632 if (Name.empty())

633 Name = getTypedefName(Decl);

634

638 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

641 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

643 Context.getDiagnostics());

648

650

652 if (Decl->getDescribedClassTemplate()) {

653

656 Decl->getDescribedClassTemplate()));

658 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

660 SubHeading, Template(Decl->getDescribedClassTemplate()), Access,

661 isInSystemHeader(Decl));

662 } else {

664 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

667 isInSystemHeader(Decl), isEmbeddedInVarDeclarator(*Decl));

668 }

669

672

673 return true;

674}

675

676template

679 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) ||

681 return true;

682

683 if (isa(Decl))

684 return true;

685 if (isa(Decl) || isa(Decl))

686 return true;

687

691 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

694 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

696 Context.getDiagnostics());

701

703 Decl->getDescribedFunctionTemplate()) {

705 USR, Decl->getNameAsString(), createHierarchyInformationForDecl(*Decl),

712 } else if (Decl->getTemplateSpecializationInfo())

714 USR, Decl->getNameAsString(), createHierarchyInformationForDecl(*Decl),

718 SubHeading, Signature, Access, isInSystemHeader(Decl));

719 else if (Decl->isOverloadedOperator())

721 USR, Decl->getNameAsString(), createHierarchyInformationForDecl(*Decl),

724 SubHeading, Signature, Access, isInSystemHeader(Decl));

725 else if (Decl->isStatic())

727 USR, Decl->getNameAsString(), createHierarchyInformationForDecl(*Decl),

730 Signature, Access, isInSystemHeader(Decl));

731 else

733 USR, Decl->getNameAsString(), createHierarchyInformationForDecl(*Decl),

736 Signature, Access, isInSystemHeader(Decl));

737

738 return true;

739}

740

741template

744 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) ||

746 return true;

747

748 auto Name = Decl->getNameAsString();

752 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

755 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

757 Context.getDiagnostics());

758

759

767

769 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

771 Signature, Access, isInSystemHeader(Decl));

772 return true;

773}

774

775template

778 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) ||

780 return true;

781

782 auto Name = Decl->getNameAsString();

786 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

789 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

791 Context.getDiagnostics());

792

793

802 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

804 Signature, Access, isInSystemHeader(Decl));

805 return true;

806}

807

808template

810 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

811 return true;

812

813 StringRef Name = Decl->getName();

817 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

820 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

822 Context.getDiagnostics());

828 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

831 return true;

832}

833

834template

837 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

838 return true;

839

840 StringRef Name = Decl->getName();

844 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

847 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

849 Context.getDiagnostics());

855

857 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

860 isInSystemHeader(Decl));

861

863

864 return true;

865}

866

867template

871 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

872 return true;

873

874 StringRef Name = Decl->getName();

878 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

881 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

883 Context.getDiagnostics());

889 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

892 isInSystemHeader(Decl));

893

895 CTPSR->Bases = getBases(Decl);

896

897 return true;

898}

899

900template

903 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

904 return true;

905

906

907 StringRef Name = Decl->getName();

911 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

915 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

917 Context.getDiagnostics());

918

919

925 Decl->getTemplatedDecl()));

926

929

932 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

936 else

938 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

941 return true;

942}

943

944template

947 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

948 return true;

949

950

951 StringRef Name = Decl->getName();

955 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

959 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

961 Context.getDiagnostics());

962

963

970 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

972 SubHeading, isInSystemHeader(Decl));

973 return true;

974}

975

976template

979 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

980 return true;

981

982

983 StringRef Name = Decl->getName();

987 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

991 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

993 Context.getDiagnostics());

994

995

1001 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1004 return true;

1005}

1006

1007template

1010 if (isa(Decl->getTemplatedDecl()))

1011 return true;

1012 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

1013 return true;

1014

1015

1016 auto Name = Decl->getNameAsString();

1020 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1024 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1026 Context.getDiagnostics());

1027

1032 Decl->getTemplatedDecl());

1034 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1037 SubHeading, Signature, Template(Decl), isInSystemHeader(Decl));

1038

1039 return true;

1040}

1041

1042template

1045 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

1046 return true;

1047

1048

1049 StringRef Name = Decl->getName();

1053 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1057 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1059 Context.getDiagnostics());

1060

1061

1066

1067

1069 if (const auto *SuperClassDecl = Decl->getSuperClass())

1070 SuperClass = createSymbolReferenceForDecl(*SuperClassDecl);

1071

1073 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1075 SubHeading, SuperClass, isInSystemHeader(Decl));

1076

1077

1078

1079 getDerivedExtractAPIVisitor().recordObjCMethods(InterfaceRecord,

1080 Decl->methods());

1081 getDerivedExtractAPIVisitor().recordObjCProperties(InterfaceRecord,

1082 Decl->properties());

1083 getDerivedExtractAPIVisitor().recordObjCInstanceVariables(InterfaceRecord,

1084 Decl->ivars());

1085 getDerivedExtractAPIVisitor().recordObjCProtocols(InterfaceRecord,

1086 Decl->protocols());

1087

1088 return true;

1089}

1090

1091template

1094 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

1095 return true;

1096

1097

1098 StringRef Name = Decl->getName();

1102 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1105 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1107 Context.getDiagnostics());

1108

1109

1114

1116 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1118 isInSystemHeader(Decl));

1119

1120 getDerivedExtractAPIVisitor().recordObjCMethods(ProtoRecord, Decl->methods());

1121 getDerivedExtractAPIVisitor().recordObjCProperties(ProtoRecord,

1122 Decl->properties());

1123 getDerivedExtractAPIVisitor().recordObjCProtocols(ProtoRecord,

1124 Decl->protocols());

1125

1126 return true;

1127}

1128

1129template

1132

1133 if (isa(Decl))

1134 return true;

1135

1137 return true;

1138

1139 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

1140 return true;

1141

1142 StringRef Name = Decl->getName();

1143

1144

1145

1146 if (auto *TagDecl = Decl->getUnderlyingType()->getAsTagDecl()) {

1151 if (auto *Record = API.findRecordForUSR(TagUSR)) {

1153 LeadingFragments.append("typedef",

1157 .prepend(std::move(LeadingFragments))

1161

1162 return true;

1163 }

1164 }

1165 }

1166

1168 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1173 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1175 Context.getDiagnostics());

1176

1180 API);

1181

1183 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1187 isInSystemHeader(Decl));

1188

1189 return true;

1190}

1191

1192template

1195 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

1196 return true;

1197

1198 StringRef Name = Decl->getName();

1202 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1205 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1207 Context.getDiagnostics());

1208

1213

1216

1218 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1221

1222 getDerivedExtractAPIVisitor().recordObjCMethods(CategoryRecord,

1223 Decl->methods());

1224 getDerivedExtractAPIVisitor().recordObjCProperties(CategoryRecord,

1225 Decl->properties());

1226 getDerivedExtractAPIVisitor().recordObjCInstanceVariables(CategoryRecord,

1227 Decl->ivars());

1228 getDerivedExtractAPIVisitor().recordObjCProtocols(CategoryRecord,

1229 Decl->protocols());

1230

1231 return true;

1232}

1233

1234

1235

1236template

1239 for (const auto *Constant : Constants) {

1240

1241 StringRef Name = Constant->getName();

1245 Context.getSourceManager().getPresumedLoc(Constant->getLocation());

1248 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Constant))

1250 Context.getDiagnostics());

1251

1252

1257

1260 Comment, Declaration, SubHeading, isInSystemHeader(Constant));

1261 }

1262}

1263

1264template

1266

1267 if (isa(Decl) || isa(Decl))

1268 return true;

1269

1270 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl))

1271 return true;

1272

1273

1274 StringRef Name = Decl->getName();

1278 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1281 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1283 Context.getDiagnostics());

1284

1285

1290

1294

1296 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1298 SubHeading, Access, isInSystemHeader(Decl));

1299 } else if (auto *RD = dyn_cast(Decl->getDeclContext())) {

1300 if (RD->isUnion())

1302 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1304 SubHeading, isInSystemHeader(Decl));

1305 else

1307 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1309 SubHeading, isInSystemHeader(Decl));

1310 }

1311

1312

1313

1314 maybeMergeWithAnonymousTag(*Decl, NewRecord);

1315

1316 return true;

1317}

1318

1319template

1322 if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) ||

1324 return true;

1325

1326 auto Name = Decl->getNameAsString();

1330 Context.getSourceManager().getPresumedLoc(Decl->getLocation());

1333 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl))

1335 Context.getDiagnostics());

1336

1337

1345

1346 if (Decl->isStatic())

1348 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1350 SubHeading, Signature, Access, isInSystemHeader(Decl));

1351 else

1353 USR, Name, createHierarchyInformationForDecl(*Decl), Loc,

1355 SubHeading, Signature, Access, isInSystemHeader(Decl));

1356

1357 return true;

1358}

1359

1360

1361

1362template

1366 for (const auto *Method : Methods) {

1367

1368 if (Method->isPropertyAccessor())

1369 continue;

1370

1371 auto Name = Method->getSelector().getAsString();

1375 Context.getSourceManager().getPresumedLoc(Method->getLocation());

1378 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Method))

1380 Context.getDiagnostics());

1381

1382

1389

1390 if (Method->isInstanceMethod())

1392 USR, Name, createHierarchyInformationForDecl(*Method), Loc,

1394 SubHeading, Signature, isInSystemHeader(Method));

1395 else

1397 USR, Name, createHierarchyInformationForDecl(*Method), Loc,

1399 SubHeading, Signature, isInSystemHeader(Method));

1400 }

1401}

1402

1403template

1407 for (const auto *Property : Properties) {

1408 StringRef Name = Property->getName();

1412 Context.getSourceManager().getPresumedLoc(Property->getLocation());

1415 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Property))

1417 Context.getDiagnostics());

1418

1419

1424

1425 auto GetterName = Property->getGetterName().getAsString();

1426 auto SetterName = Property->getSetterName().getAsString();

1427

1428

1430 if (Property->getPropertyAttributes() &

1433

1436 USR, Name, createHierarchyInformationForDecl(*Property), Loc,

1438 SubHeading,

1440 GetterName, SetterName, Property->isOptional(),

1441 isInSystemHeader(Property));

1442 else

1444 USR, Name, createHierarchyInformationForDecl(*Property), Loc,

1446 SubHeading,

1448 GetterName, SetterName, Property->isOptional(),

1449 isInSystemHeader(Property));

1450 }

1451}

1452

1453template

1456 const llvm::iterator_range<

1458 Ivars) {

1459 for (const auto *Ivar : Ivars) {

1460 StringRef Name = Ivar->getName();

1463

1465 Context.getSourceManager().getPresumedLoc(Ivar->getLocation());

1468 getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Ivar))

1470 Context.getDiagnostics());

1471

1472

1477

1479 USR, Name, createHierarchyInformationForDecl(*Ivar), Loc,

1481 SubHeading, isInSystemHeader(Ivar));

1482 }

1483}

1484

1485template

1489 for (const auto *Protocol : Protocols)

1490 Container->Protocols.emplace_back(createSymbolReferenceForDecl(*Protocol));

1491}

1492

1493}

1494

1495

1496

1497template

1500 std::is_same_v<Derived, void>, ExtractAPIVisitor<>, Derived>> {

1503

1504public:

1506

1510 return Comment;

1511

1512 if (const auto *Declarator = dyn_cast(D)) {

1513 const auto *TagTypeDecl = Declarator->getType()->getAsTagDecl();

1514 if (TagTypeDecl && TagTypeDecl->isEmbeddedInDeclarator() &&

1515 TagTypeDecl->isCompleteDefinition())

1517 }

1518

1519 return nullptr;

1520 }

1521};

1522

1523}

1524}

1525

1526#endif

This file defines the APIRecord-based structs and the APISet class.

Defines the clang::ASTContext interface.

Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....

Defines the C++ template declaration subclasses.

This file defines the Declaration Fragments related classes.

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

llvm::MachO::Record Record

Defines the clang::Module class, which describes a module in the source code.

Defines the SourceManager interface.

Defines various enumerations that describe declaration and type specifiers.

This file defines the UnderlyingTypeResolver which is a helper type for resolving the undelrying type...

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

SourceManager & getSourceManager()

TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)

const clang::PrintingPolicy & getPrintingPolicy() const

RawComment * getRawCommentForDeclNoCache(const Decl *D) const

Return the documentation comment attached to a given declaration, without looking into cache.

Represents a C++ constructor within a class.

Represents a C++ conversion function within a class.

Represents a C++ destructor within a class.

Represents a static or instance method of a struct/union/class.

Represents a C++ struct/union/class.

Represents a class template specialization, which refers to a class template with a given set of temp...

Declaration of a C++20 concept.

specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...

Decl::Kind getDeclKind() const

Decl - This represents one declaration (or definition), e.g.

ASTContext & getASTContext() const LLVM_READONLY

bool isImplicit() const

isImplicit - Indicates whether the declaration was implicitly generated by the implementation.

SourceLocation getLocation() const

bool isDefinedOutsideFunctionOrMethod() const

isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside...

DeclContext * getDeclContext()

Represents a ValueDecl that came out of a declarator.

Information about one declarator, including the parsed type information and the identifier.

llvm::iterator_range< specific_decl_iterator< EnumConstantDecl > > enumerator_range

Represents a member of a struct/union/class.

Represents a function declaration or definition.

@ TK_MemberSpecialization

@ TK_DependentNonTemplate

@ TK_FunctionTemplateSpecialization

@ TK_DependentFunctionTemplateSpecialization

Declaration of a template function.

StringRef getName() const

Get the name of identifier for this declaration as a StringRef.

Represent a C++ namespace.

ObjCCategoryDecl - Represents a category declaration.

llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range

llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range

Represents an ObjC class declaration.

llvm::iterator_range< protocol_iterator > protocol_range

Represents an Objective-C protocol declaration.

Represents an unpacked "presumed" location which can be presented to the user.

A (possibly-)qualified type.

Represents a struct/union/class.

A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...

bool isInSystemHeader(SourceLocation Loc) const

Returns if a SourceLocation is in a system header.

Represents the declaration of a struct/union/class/enum.

bool isEmbeddedInDeclarator() const

True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...

bool isCompleteDefinition() const

Return true if this decl has its body fully specified.

The base class of all kinds of template declarations (e.g., class, function, etc.).

TemplateTypeParmDecl * getDecl() const

The base class of the type hierarchy.

Represents the declaration of a typedef-name via the 'typedef' type specifier.

Base class for declarations which introduce a typedef-name.

Represents a variable declaration or definition.

Declaration of a variable template.

Represents a variable template specialization, which refers to a variable template with a given set o...

bool generateUSRForDecl(const Decl *D, SmallVectorImpl< char > &Buf)

Generate a USR for a Decl, including the USR prefix.

The JSON file list parser is used to communicate input to InstallAPI.

Linkage

Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.

@ Property

The type of a property.

@ TSK_Undeclared

This template specialization was formed from a template-id but has not yet been declared,...

@ Interface

The "__interface" keyword introduces the elaborated-type-specifier.

static AvailabilityInfo createFromDecl(const Decl *Decl)