[clang] [Clang] [-Wunsafe-buffer-usage] Rename variable to upper camel case. (PR #176286)
Rohan Jacob-Rao via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 15 16:48:12 PST 2026
https://github.com/rohanjr updated https://github.com/llvm/llvm-project/pull/176286
>From 29a206ed17f6add09b6824b6a266563c67d2064e Mon Sep 17 00:00:00 2001
From: Rohan Jacob-Rao <rohanjr at google.com>
Date: Thu, 15 Jan 2026 23:41:25 +0000
Subject: [PATCH] [Clang] [-Wunsafe-buffer-usage] Rename variable to upper
camel case.
Following https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
---
clang/lib/Analysis/UnsafeBufferUsage.cpp | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index 6bb08102c0345..3e4d14c51ca1e 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -128,10 +128,10 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
// descendants of a given node "n" except for the ones
// belonging to a different callable of "n".
MatchDescendantVisitor(ASTContext &Context, FastMatcher &Matcher,
- bool FindAll, bool ignoreUnevaluatedContext,
+ bool FindAll, bool IgnoreUnevaluatedContext,
const UnsafeBufferUsageHandler &NewHandler)
: Matcher(&Matcher), FindAll(FindAll), Matches(false),
- ignoreUnevaluatedContext(ignoreUnevaluatedContext),
+ IgnoreUnevaluatedContext(IgnoreUnevaluatedContext),
ActiveASTContext(&Context), Handler(&NewHandler) {
ShouldVisitTemplateInstantiations = true;
ShouldVisitImplicitCode = false; // TODO: let's ignore implicit code for now
@@ -169,7 +169,7 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
bool TraverseGenericSelectionExpr(GenericSelectionExpr *Node) override {
// These are unevaluated, except the result expression.
- if (ignoreUnevaluatedContext)
+ if (IgnoreUnevaluatedContext)
return TraverseStmt(Node->getResultExpr());
return DynamicRecursiveASTVisitor::TraverseGenericSelectionExpr(Node);
}
@@ -177,7 +177,7 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
bool
TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *Node) override {
// Unevaluated context.
- if (ignoreUnevaluatedContext)
+ if (IgnoreUnevaluatedContext)
return true;
return DynamicRecursiveASTVisitor::TraverseUnaryExprOrTypeTraitExpr(Node);
}
@@ -185,7 +185,7 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
bool TraverseTypeOfExprTypeLoc(TypeOfExprTypeLoc Node,
bool TraverseQualifier) override {
// Unevaluated context.
- if (ignoreUnevaluatedContext)
+ if (IgnoreUnevaluatedContext)
return true;
return DynamicRecursiveASTVisitor::TraverseTypeOfExprTypeLoc(
Node, TraverseQualifier);
@@ -194,7 +194,7 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
bool TraverseDecltypeTypeLoc(DecltypeTypeLoc Node,
bool TraverseQualifier) override {
// Unevaluated context.
- if (ignoreUnevaluatedContext)
+ if (IgnoreUnevaluatedContext)
return true;
return DynamicRecursiveASTVisitor::TraverseDecltypeTypeLoc(
Node, TraverseQualifier);
@@ -202,14 +202,14 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
bool TraverseCXXNoexceptExpr(CXXNoexceptExpr *Node) override {
// Unevaluated context.
- if (ignoreUnevaluatedContext)
+ if (IgnoreUnevaluatedContext)
return true;
return DynamicRecursiveASTVisitor::TraverseCXXNoexceptExpr(Node);
}
bool TraverseCXXTypeidExpr(CXXTypeidExpr *Node) override {
// Unevaluated context.
- if (ignoreUnevaluatedContext)
+ if (IgnoreUnevaluatedContext)
return true;
return DynamicRecursiveASTVisitor::TraverseCXXTypeidExpr(Node);
}
@@ -247,7 +247,7 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {
// When true, finds all matches. When false, finds the first match and stops.
const bool FindAll;
bool Matches;
- bool ignoreUnevaluatedContext;
+ bool IgnoreUnevaluatedContext;
ASTContext *ActiveASTContext;
const UnsafeBufferUsageHandler *Handler;
};
@@ -266,7 +266,7 @@ forEachDescendantEvaluatedStmt(const Stmt *S, ASTContext &Ctx,
const UnsafeBufferUsageHandler &Handler,
FastMatcher &Matcher) {
MatchDescendantVisitor Visitor(Ctx, Matcher, /*FindAll=*/true,
- /*ignoreUnevaluatedContext=*/true, Handler);
+ /*IgnoreUnevaluatedContext=*/true, Handler);
Visitor.findMatch(DynTypedNode::create(*S));
}
@@ -274,7 +274,7 @@ static void forEachDescendantStmt(const Stmt *S, ASTContext &Ctx,
const UnsafeBufferUsageHandler &Handler,
FastMatcher &Matcher) {
MatchDescendantVisitor Visitor(Ctx, Matcher, /*FindAll=*/true,
- /*ignoreUnevaluatedContext=*/false, Handler);
+ /*IgnoreUnevaluatedContext=*/false, Handler);
Visitor.findMatch(DynTypedNode::create(*S));
}
More information about the cfe-commits
mailing list