23
23
#include " clang/AST/RawCommentList.h"
24
24
#include " clang/Basic/SourceLocation.h"
25
25
#include " clang/ExtractAPI/DeclarationFragments.h"
26
- #include " llvm/ADT/SmallPtrSet .h"
26
+ #include " llvm/ADT/SmallVector .h"
27
27
#include " llvm/Support/Allocator.h"
28
28
#include " llvm/Support/Casting.h"
29
29
#include " llvm/TargetParser/Triple.h"
@@ -1420,9 +1420,8 @@ class APISet {
1420
1420
typename std::enable_if_t <std::is_base_of_v<APIRecord, RecordTy>, RecordTy> *
1421
1421
createRecord (StringRef USR, StringRef Name, CtorArgsContTy &&...CtorArgs);
1422
1422
1423
- auto getTopLevelRecords () const {
1424
- return llvm::iterator_range<decltype (TopLevelRecords)::iterator>(
1425
- TopLevelRecords);
1423
+ ArrayRef<const APIRecord *> getTopLevelRecords () const {
1424
+ return TopLevelRecords;
1426
1425
}
1427
1426
1428
1427
void removeRecord (StringRef USR);
@@ -1455,7 +1454,7 @@ class APISet {
1455
1454
// lives in the BumpPtrAllocator.
1456
1455
using APIRecordStoredPtr = std::unique_ptr<APIRecord, APIRecordDeleter>;
1457
1456
llvm::DenseMap<StringRef, APIRecordStoredPtr> USRBasedLookupTable;
1458
- llvm::SmallPtrSet <const APIRecord *, 32 > TopLevelRecords;
1457
+ llvm::SmallVector <const APIRecord *, 32 > TopLevelRecords;
1459
1458
1460
1459
public:
1461
1460
const std::string ProductName;
@@ -1481,7 +1480,7 @@ APISet::createRecord(StringRef USR, StringRef Name,
1481
1480
dyn_cast_if_present<RecordContext>(Record->Parent .Record ))
1482
1481
ParentContext->addToRecordChain (Record);
1483
1482
else
1484
- TopLevelRecords.insert (Record);
1483
+ TopLevelRecords.push_back (Record);
1485
1484
} else {
1486
1485
Record = dyn_cast<RecordTy>(Result.first ->second .get ());
1487
1486
}
0 commit comments