Skip to content

Commit 3a3448f

Browse files
committed
Fix formatting.
1 parent 285f64e commit 3a3448f

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class TrivialFunctionAnalysisVisitor
254254
}
255255

256256
template <typename StmtType, typename CheckFunction>
257-
bool withCachedResult(const StmtType *S, CheckFunction Function) {
257+
bool WithCachedResult(const StmtType *S, CheckFunction Function) {
258258
// Insert false to the cache first to avoid infinite recursion.
259259
auto [It, IsNew] = Cache.insert(std::make_pair(S, false));
260260
if (!IsNew)
@@ -278,7 +278,7 @@ class TrivialFunctionAnalysisVisitor
278278
bool VisitCompoundStmt(const CompoundStmt *CS) {
279279
// A compound statement is allowed as long each individual sub-statement
280280
// is trivial.
281-
return withCachedResult(CS, [&]() { return VisitChildren(CS); });
281+
return WithCachedResult(CS, [&]() { return VisitChildren(CS); });
282282
}
283283

284284
bool VisitReturnStmt(const ReturnStmt *RS) {
@@ -291,16 +291,16 @@ class TrivialFunctionAnalysisVisitor
291291
bool VisitDeclStmt(const DeclStmt *DS) { return VisitChildren(DS); }
292292
bool VisitDoStmt(const DoStmt *DS) { return VisitChildren(DS); }
293293
bool VisitIfStmt(const IfStmt *IS) {
294-
return withCachedResult(IS, [&]() { return VisitChildren(IS); });
294+
return WithCachedResult(IS, [&]() { return VisitChildren(IS); });
295295
}
296296
bool VisitForStmt(const ForStmt *FS) {
297-
return withCachedResult(FS, [&]() { return VisitChildren(FS); });
297+
return WithCachedResult(FS, [&]() { return VisitChildren(FS); });
298298
}
299299
bool VisitCXXForRangeStmt(const CXXForRangeStmt *FS) {
300-
return withCachedResult(FS, [&]() { return VisitChildren(FS); });
300+
return WithCachedResult(FS, [&]() { return VisitChildren(FS); });
301301
}
302302
bool VisitWhileStmt(const WhileStmt *WS) {
303-
return withCachedResult(WS, [&]() { return VisitChildren(WS); });
303+
return WithCachedResult(WS, [&]() { return VisitChildren(WS); });
304304
}
305305
bool VisitSwitchStmt(const SwitchStmt *SS) { return VisitChildren(SS); }
306306
bool VisitCaseStmt(const CaseStmt *CS) { return VisitChildren(CS); }

clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,14 @@ bool isSingleton(const FunctionDecl *F);
7272
class TrivialFunctionAnalysis {
7373
public:
7474
/// \returns true if \p D is a "trivial" function.
75-
bool isTrivial(const Decl *D) const {
76-
return isTrivialImpl(D, TheCache);
77-
}
78-
79-
bool isTrivial(const Stmt *S) const {
80-
return isTrivialImpl(S, TheCache);
81-
}
75+
bool isTrivial(const Decl *D) const { return isTrivialImpl(D, TheCache); }
76+
bool isTrivial(const Stmt *S) const { return isTrivialImpl(S, TheCache); }
8277

8378
private:
8479
friend class TrivialFunctionAnalysisVisitor;
8580

86-
using CacheTy = llvm::DenseMap<llvm::PointerUnion<const Decl *,
87-
const Stmt *>, bool>;
81+
using CacheTy =
82+
llvm::DenseMap<llvm::PointerUnion<const Decl *, const Stmt *>, bool>;
8883
mutable CacheTy TheCache{};
8984

9085
static bool isTrivialImpl(const Decl *D, CacheTy &Cache);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class UncountedLocalVarsChecker
168168
return Base::TraverseCompoundStmt(CS);
169169
return true;
170170
}
171-
172171
};
173172

174173
LocalVisitor visitor(this);

0 commit comments

Comments
 (0)