Skip to content

Commit edba566

Browse files
committed
Fix formatting.
1 parent dc53e06 commit edba566

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

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

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class RawPtrRefLambdaCapturesChecker
7575
}
7676

7777
bool shouldCheckThis() {
78-
auto result = !ClsType.isNull() ?
79-
Checker->isUnsafePtr(ClsType) : std::nullopt;
78+
auto result =
79+
!ClsType.isNull() ? Checker->isUnsafePtr(ClsType) : std::nullopt;
8080
return result && *result;
8181
}
8282

@@ -138,9 +138,8 @@ class RawPtrRefLambdaCapturesChecker
138138
if (auto *L = findLambdaInArg(Arg)) {
139139
LambdasToIgnore.insert(L);
140140
if (!Param->hasAttr<NoEscapeAttr>())
141-
Checker->visitLambdaExpr(L, shouldCheckThis() &&
142-
!hasProtectedThis(L),
143-
ClsType);
141+
Checker->visitLambdaExpr(
142+
L, shouldCheckThis() && !hasProtectedThis(L), ClsType);
144143
}
145144
++ArgIndex;
146145
}
@@ -160,9 +159,8 @@ class RawPtrRefLambdaCapturesChecker
160159
if (auto *L = findLambdaInArg(Arg)) {
161160
LambdasToIgnore.insert(L);
162161
if (!Param->hasAttr<NoEscapeAttr>() && !TreatAllArgsAsNoEscape)
163-
Checker->visitLambdaExpr(L, shouldCheckThis() &&
164-
!hasProtectedThis(L),
165-
ClsType);
162+
Checker->visitLambdaExpr(
163+
L, shouldCheckThis() && !hasProtectedThis(L), ClsType);
166164
}
167165
++ArgIndex;
168166
}
@@ -328,8 +326,7 @@ class RawPtrRefLambdaCapturesChecker
328326
visitor.TraverseDecl(const_cast<TranslationUnitDecl *>(TUD));
329327
}
330328

331-
void visitLambdaExpr(LambdaExpr *L, bool shouldCheckThis,
332-
const QualType T,
329+
void visitLambdaExpr(LambdaExpr *L, bool shouldCheckThis, const QualType T,
333330
bool ignoreParamVarDecl = false) const {
334331
if (TFA.isTrivial(L->getBody()))
335332
return;
@@ -353,7 +350,7 @@ class RawPtrRefLambdaCapturesChecker
353350
void reportBug(const LambdaCapture &Capture, ValueDecl *CapturedVar,
354351
const QualType T) const {
355352
assert(CapturedVar);
356-
353+
357354
if (isa<ImplicitParamDecl>(CapturedVar) && !Capture.getLocation().isValid())
358355
return; // Ignore implicit captruing of self.
359356

@@ -421,7 +418,6 @@ class UncountedLambdaCapturesChecker : public RawPtrRefLambdaCapturesChecker {
421418
return "uncounted";
422419
return "unchecked";
423420
}
424-
425421
};
426422

427423
class UnretainedLambdaCapturesChecker : public RawPtrRefLambdaCapturesChecker {
@@ -436,9 +432,7 @@ class UnretainedLambdaCapturesChecker : public RawPtrRefLambdaCapturesChecker {
436432
return RTC->isUnretained(QT);
437433
}
438434

439-
const char *ptrKind(QualType QT) const final {
440-
return "unretained";
441-
}
435+
const char *ptrKind(QualType QT) const final { return "unretained"; }
442436
};
443437

444438
} // namespace

0 commit comments

Comments
 (0)