Skip to content

Commit 469b560

Browse files
committed
Fix formatting
1 parent c768954 commit 469b560

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefMemberChecker.cpp

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -197,43 +197,44 @@ class RawPtrRefMemberChecker
197197
}
198198

199199
void visitPropImpl(const ObjCContainerDecl *CD,
200-
const ObjCPropertyImplDecl* PID) const {
201-
if (BR->getSourceManager().isInSystemHeader(PID->getLocation()))
202-
return;
203-
204-
if (PID->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
205-
return;
206-
207-
auto *PropDecl = PID->getPropertyDecl();
208-
if (auto *IvarDecl = PID->getPropertyIvarDecl()) {
209-
if (IvarDeclsToIgnore.contains(IvarDecl))
210-
return;
211-
IvarDeclsToIgnore.insert(IvarDecl);
212-
}
213-
auto [IsUnsafe, PropType] = isPropImplUnsafePtr(PropDecl);
214-
if (!IsUnsafe)
215-
return;
216-
217-
if (auto *MemberCXXRD = PropType->getPointeeCXXRecordDecl())
218-
reportBug(PropDecl, PropType, MemberCXXRD, CD);
219-
else if (auto *ObjCDecl = getObjCDecl(PropType))
220-
reportBug(PropDecl, PropType, ObjCDecl, CD);
200+
const ObjCPropertyImplDecl *PID) const {
201+
if (BR->getSourceManager().isInSystemHeader(PID->getLocation()))
202+
return;
203+
204+
if (PID->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
205+
return;
206+
207+
auto *PropDecl = PID->getPropertyDecl();
208+
if (auto *IvarDecl = PID->getPropertyIvarDecl()) {
209+
if (IvarDeclsToIgnore.contains(IvarDecl))
210+
return;
211+
IvarDeclsToIgnore.insert(IvarDecl);
212+
}
213+
auto [IsUnsafe, PropType] = isPropImplUnsafePtr(PropDecl);
214+
if (!IsUnsafe)
215+
return;
216+
217+
if (auto *MemberCXXRD = PropType->getPointeeCXXRecordDecl())
218+
reportBug(PropDecl, PropType, MemberCXXRD, CD);
219+
else if (auto *ObjCDecl = getObjCDecl(PropType))
220+
reportBug(PropDecl, PropType, ObjCDecl, CD);
221221
}
222222

223-
std::pair<bool, const Type*> isPropImplUnsafePtr(const ObjCPropertyDecl *PD) const {
223+
std::pair<bool, const Type *>
224+
isPropImplUnsafePtr(const ObjCPropertyDecl *PD) const {
224225
if (!PD)
225-
return { false, nullptr };
226+
return {false, nullptr};
226227

227228
auto QT = PD->getType();
228229
const Type *PropType = QT.getTypePtrOrNull();
229230
if (!PropType)
230-
return { false, nullptr };
231+
return {false, nullptr};
231232

232233
// "assign" property doesn't retain even under ARC so treat it as unsafe.
233234
bool ignoreARC =
234235
!PD->isReadOnly() && PD->getSetterKind() == ObjCPropertyDecl::Assign;
235236
auto IsUnsafePtr = isUnsafePtr(QT, ignoreARC);
236-
return { IsUnsafePtr && *IsUnsafePtr, PropType };
237+
return {IsUnsafePtr && *IsUnsafePtr, PropType};
237238
}
238239

239240
bool shouldSkipDecl(const RecordDecl *RD) const {

0 commit comments

Comments
 (0)