@@ -70,7 +70,8 @@ void RecordContext::stealRecordChain(RecordContext &Other) {
70
70
71
71
Last = Other.Last ;
72
72
73
- for (auto *StolenRecord = Other.First ; StolenRecord != nullptr ; StolenRecord = StolenRecord->getNextInContext ())
73
+ for (auto *StolenRecord = Other.First ; StolenRecord != nullptr ;
74
+ StolenRecord = StolenRecord->getNextInContext ())
74
75
StolenRecord->Parent = SymbolReference (cast<APIRecord>(this ));
75
76
76
77
// Delete Other's chain to ensure we don't accidentally traverse it.
@@ -135,25 +136,22 @@ SymbolReference APISet::createSymbolReference(StringRef Name, StringRef USR,
135
136
return SymbolReference (copyString (Name), copyString (USR), copyString (Source));
136
137
}
137
138
138
-
139
139
void APISet::removeRecord (StringRef USR) {
140
140
auto Result = USRBasedLookupTable.find (USR);
141
141
if (Result != USRBasedLookupTable.end ()) {
142
142
auto *Record = Result->getSecond ().get ();
143
- auto &ParentReference= Record->Parent ;
143
+ auto &ParentReference = Record->Parent ;
144
144
auto *ParentRecord = const_cast <APIRecord *>(ParentReference.Record );
145
145
if (!ParentRecord)
146
146
ParentRecord = findRecordForUSR (ParentReference.USR );
147
147
148
148
if (auto *ParentCtx = llvm::cast_if_present<RecordContext>(ParentRecord)) {
149
149
ParentCtx->removeFromRecordChain (Record);
150
- if (auto *RecordAsCtx=
151
- llvm::dyn_cast<RecordContext>(Record))
150
+ if (auto *RecordAsCtx = llvm::dyn_cast<RecordContext>(Record))
152
151
ParentCtx->stealRecordChain (*RecordAsCtx);
153
152
} else {
154
153
TopLevelRecords.erase (Record);
155
- if (auto *RecordAsCtx=
156
- llvm::dyn_cast<RecordContext>(Record)) {
154
+ if (auto *RecordAsCtx = llvm::dyn_cast<RecordContext>(Record)) {
157
155
for (const auto *Child = RecordAsCtx->First ; Child != nullptr ;
158
156
Child = Child->getNextInContext ())
159
157
TopLevelRecords.insert (Child);
@@ -163,9 +161,7 @@ void APISet::removeRecord(StringRef USR) {
163
161
}
164
162
}
165
163
166
- void APISet::removeRecord (APIRecord *Record) {
167
- removeRecord (Record->USR );
168
- }
164
+ void APISet::removeRecord (APIRecord *Record) { removeRecord (Record->USR ); }
169
165
170
166
APIRecord::~APIRecord () {}
171
167
TagRecord::~TagRecord () {}
0 commit comments